Changes in [2520:6c1482f9960e:2519:61b3fb5e6a1f]
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/_charte.php
r2504 r2501 31 31 <script type="text/javascript" src="js/jquery/jquery.js"></script> 32 32 <script type="text/javascript" src="js/jquery/jquery-ui.custom.js"></script> 33 <script type="text/javascript" src="js/jquery/jquery.ui.touch-punch.js"></script>34 33 <script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script> 35 34 <script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script> -
admin/categories.php
r2496 r2464 109 109 && $rs->count()>1) { 110 110 $starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 111 $starting_script .= dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js');112 111 $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js'); 113 112 } -
admin/preferences.php
r2496 r2449 47 47 $default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'user-profile'; 48 48 49 if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 50 !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 49 if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 50 !empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction']) || 51 51 !empty($_GET['db-updated'])) { 52 52 $default_tab = 'user-favorites'; … … 84 84 { 85 85 $pwd_check = !empty($_POST['cur_pwd']) && $core->auth->checkPassword(crypt::hmac(DC_MASTER_KEY,$_POST['cur_pwd'])); 86 86 87 87 if ($core->auth->allowPassChange() && !$pwd_check && $user_email != $_POST['user_email']) { 88 88 throw new Exception(__('If you want to change your email or password you must provide your current password.')); 89 89 } 90 90 91 91 $cur = $core->con->openCursor($core->prefix.'user'); 92 92 93 93 $cur->user_name = $user_name = $_POST['user_name']; 94 94 $cur->user_firstname = $user_firstname = $_POST['user_firstname']; … … 100 100 101 101 $cur->user_options = new ArrayObject($user_options); 102 102 103 103 if ($core->auth->allowPassChange() && !empty($_POST['new_pwd'])) 104 104 { … … 106 106 throw new Exception(__('If you want to change your email or password you must provide your current password.')); 107 107 } 108 108 109 109 if ($_POST['new_pwd'] != $_POST['new_pwd_c']) { 110 110 throw new Exception(__("Passwords don't match")); 111 111 } 112 112 113 113 $cur->user_pwd = $_POST['new_pwd']; 114 114 } 115 115 116 116 # --BEHAVIOR-- adminBeforeUserUpdate 117 117 $core->callBehavior('adminBeforeUserProfileUpdate',$cur,$core->auth->userID()); 118 118 119 119 # Udate user 120 120 $core->updUser($core->auth->userID(),$cur); 121 121 122 122 # --BEHAVIOR-- adminAfterUserUpdate 123 123 $core->callBehavior('adminAfterUserProfileUpdate',$cur,$core->auth->userID()); 124 124 125 125 dcPage::addSuccessNotice(__('Personal information has been successfully updated.')); 126 126 … … 134 134 135 135 # Update user options 136 if (isset($_POST['user_post_format'])) 136 if (isset($_POST['user_post_format'])) 137 137 { 138 138 try 139 139 { 140 140 $cur = $core->con->openCursor($core->prefix.'user'); 141 141 142 142 $cur->user_name = $user_name; 143 143 $cur->user_firstname = $user_firstname; … … 149 149 150 150 $cur->user_post_status = $user_post_status = $_POST['user_post_status']; 151 151 152 152 $user_options['edit_size'] = (integer) $_POST['user_edit_size']; 153 153 if ($user_options['edit_size'] < 1) { … … 156 156 $user_options['post_format'] = $_POST['user_post_format']; 157 157 $user_options['enable_wysiwyg'] = !empty($_POST['user_wysiwyg']); 158 158 159 159 $cur->user_options = new ArrayObject($user_options); 160 160 161 161 # --BEHAVIOR-- adminBeforeUserOptionsUpdate 162 162 $core->callBehavior('adminBeforeUserOptionsUpdate',$cur,$core->auth->userID()); 163 163 164 164 # Update user prefs 165 165 $core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_acc_nodragdrop']),'boolean'); … … 170 170 } 171 171 $core->auth->user_prefs->interface->put('media_by_page',(integer)$_POST['user_ui_media_by_page'],'integer'); 172 172 173 173 # Udate user 174 174 $core->updUser($core->auth->userID(),$cur); 175 175 176 176 # --BEHAVIOR-- adminAfterUserOptionsUpdate 177 177 $core->callBehavior('adminAfterUserOptionsUpdate',$cur,$core->auth->userID()); 178 178 179 179 dcPage::addSuccessNotice(__('Personal options has been successfully updated.')); 180 180 http::redirect('preferences.php#user-options'); … … 192 192 # --BEHAVIOR-- adminBeforeUserOptionsUpdate 193 193 $core->callBehavior('adminBeforeDashboardOptionsUpdate',$core->auth->userID()); 194 194 195 195 # Update user prefs 196 196 $core->auth->user_prefs->dashboard->put('doclinks',!empty($_POST['user_dm_doclinks']),'boolean'); … … 199 199 $core->auth->user_prefs->interface->put('iconset',(!empty($_POST['user_ui_iconset']) ? $_POST['user_ui_iconset'] : '')); 200 200 $core->auth->user_prefs->interface->put('nofavmenu',empty($_POST['user_ui_nofavmenu']),'boolean'); 201 201 202 202 # --BEHAVIOR-- adminAfterUserOptionsUpdate 203 203 $core->callBehavior('adminAfterDashboardOptionsUpdate',$core->auth->userID()); 204 204 205 205 dcPage::addSuccessNotice(__('Dashboard options has been successfully updated.')); 206 206 http::redirect('preferences.php#user-favorites'); … … 213 213 214 214 # Add selected favorites 215 if (!empty($_POST['appendaction'])) 215 if (!empty($_POST['appendaction'])) 216 216 { 217 217 try { … … 280 280 unset($order[$k]); 281 281 } 282 } 282 } 283 283 $core->favs->setFavoriteIDs($order,false); 284 284 if (!$core->error->flag()) { … … 305 305 ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')). 306 306 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 307 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').308 307 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 309 308 '<script type="text/javascript">'."\n". … … 321 320 dcPage::jsPageTabs($default_tab). 322 321 dcPage::jsConfirmClose('user-form'). 323 322 324 323 # --BEHAVIOR-- adminPreferencesHeaders 325 324 $core->callBehavior('adminPreferencesHeaders'), … … 387 386 echo 388 387 '<h4 class="vertical-separator pretty-title">'.__('Change my password').'</h4>'. 389 388 390 389 '<div class="pw-table">'. 391 390 '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. … … 396 395 '</div>'. 397 396 '</div>'. 398 397 399 398 '<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'. 400 399 form::password('new_pwd_c',20,255).'</p>'. 401 400 402 401 '<p><label for="cur_pwd">'.__('Your current password:').'</label>'. 403 402 form::password('cur_pwd',20,255).'</p>'. … … 590 589 591 590 if (count($iconsets_combo) > 1) { 592 echo 591 echo 593 592 '<div class="fieldset">'. 594 593 '<h4>'.__('Dashboard icons').'</h4>'. -
inc/core/class.dc.namespace.php
r2505 r1179 22 22 protected $table; ///< <b>string</b> Settings table name 23 23 protected $blog_id; ///< <b>string</b> Blog ID 24 24 25 25 protected $global_settings = array(); ///< <b>array</b> Global settings array 26 26 protected $local_settings = array(); ///< <b>array</b> Local settings array 27 27 protected $settings = array(); ///< <b>array</b> Associative settings array 28 28 protected $ns; ///< <b>string</b> Current namespace 29 29 30 30 /** 31 31 Object constructor. Retrieves blog settings and puts them in $settings 32 32 array. Local (blog) settings have a highest priority than global settings. 33 33 34 34 @param name <b>string</b> ID for this namespace 35 35 */ … … 41 41 throw new Exception(sprintf(__('Invalid setting dcNamespace: %s'),$name)); 42 42 } 43 43 44 44 $this->con =& $core->con; 45 45 $this->table = $core->prefix.'setting'; 46 46 $this->blog_id =& $blog_id; 47 47 48 48 $this->getSettings($rs); 49 49 } 50 50 51 51 private function getSettings($rs=null) 52 { 52 { 53 53 if ($rs == null) { 54 54 $strReq = 'SELECT blog_id, setting_id, setting_value, '. … … 59 59 "AND setting_ns = '".$this->con->escape($this->ns)."' ". 60 60 'ORDER BY setting_id DESC '; 61 61 62 62 try { 63 63 $rs = $this->con->select($strReq); … … 74 74 $value = $rs->f('setting_value'); 75 75 $type = $rs->f('setting_type'); 76 76 77 77 if ($type == 'float' || $type == 'double') { 78 78 $type = 'float'; … … 80 80 $type = 'string'; 81 81 } 82 82 83 83 settype($value,$type); 84 84 85 85 $array = $rs->blog_id ? 'local' : 'global'; 86 86 87 87 $this->{$array.'_settings'}[$id] = array( 88 88 'ns' => $this->ns, … … 93 93 ); 94 94 } 95 95 96 96 $this->settings = $this->global_settings; 97 97 98 98 foreach ($this->local_settings as $id => $v) { 99 99 $this->settings[$id] = $v; 100 100 } 101 101 102 102 return true; 103 103 } 104 104 105 105 private function settingExists($id,$global=false) 106 106 { … … 108 108 return isset($this->{$array.'_settings'}[$id]); 109 109 } 110 110 111 111 /** 112 112 Returns setting value if exists. 113 113 114 114 @param n <b>string</b> Setting name 115 115 @return <b>mixed</b> … … 120 120 return $this->settings[$n]['value']; 121 121 } 122 122 123 123 return null; 124 124 } 125 126 /** 127 Returns global setting value if exists. 128 129 @param n <b>string</b> setting name 130 @return <b>mixed</b> 131 */ 132 public function getGlobal($n) 133 { 134 if (isset($this->global_settings[$n]['value'])) { 135 return $this->global_settings[$n]['value']; 136 } 137 138 return null; 139 } 140 141 /** 142 Returns local setting value if exists. 143 144 @param n <b>string</b> setting name 145 @return <b>mixed</b> 146 */ 147 public function getLocal($n) 148 { 149 if (isset($this->local_settings[$n]['value'])) { 150 return $this->local_settings[$n]['value']; 151 } 152 153 return null; 154 } 155 125 156 126 /** 157 127 Magic __get method. … … 162 132 return $this->get($n); 163 133 } 164 134 165 135 /** 166 136 Sets a setting in $settings property. This sets the setting for script 167 137 execution time only and if setting exists. 168 138 169 139 @param n <b>string</b> Setting name 170 140 @param v <b>mixed</b> Setting value … … 176 146 } 177 147 } 178 148 179 149 /** 180 150 Magic __set method. … … 185 155 $this->set($n,$v); 186 156 } 187 157 188 158 /** 189 159 Creates or updates a setting. 190 160 191 161 $type could be 'string', 'integer', 'float', 'boolean' or null. If $type is 192 162 null and setting exists, it will keep current setting type. 193 163 194 164 $value_change allow you to not change setting. Useful if you need to change 195 165 a setting label or type and don't want to change its value. 196 166 197 167 @param id <b>string</b> Setting ID 198 168 @param value <b>mixed</b> Setting value … … 207 177 throw new Exception(sprintf(__('%s is not a valid setting id'),$id)); 208 178 } 209 179 210 180 # We don't want to change setting value 211 181 if (!$value_change) … … 217 187 } 218 188 } 219 189 220 190 # Setting type 221 191 if ($type == 'double') … … 237 207 $type = 'string'; 238 208 } 239 209 240 210 # We don't change label 241 211 if ($label == null) … … 247 217 } 248 218 } 249 219 250 220 settype($value,$type); 251 221 252 222 $cur = $this->con->openCursor($this->table); 253 223 $cur->setting_value = ($type == 'boolean') ? (string) (integer) $value : (string) $value; 254 224 $cur->setting_type = $type; 255 225 $cur->setting_label = $label; 256 226 257 227 #If we are local, compare to global value 258 228 if (!$global && $this->settingExists($id,true)) … … 261 231 $same_setting = $g['ns'] == $this->ns && $g['value'] == $value 262 232 && $g['type'] == $type && $g['label'] == $label; 263 233 264 234 # Drop setting if same value as global 265 235 if ($same_setting && $this->settingExists($id,false)) { … … 269 239 } 270 240 } 271 241 272 242 if ($this->settingExists($id,$global) && $this->ns == $this->settings[$id]['ns']) 273 243 { … … 277 247 $where = "WHERE blog_id = '".$this->con->escape($this->blog_id)."' "; 278 248 } 279 249 280 250 $cur->update($where."AND setting_id = '".$this->con->escape($id)."' AND setting_ns = '".$this->con->escape($this->ns)."' "); 281 251 } … … 285 255 $cur->blog_id = $global ? null : $this->blog_id; 286 256 $cur->setting_ns = $this->ns; 287 257 288 258 $cur->insert(); 289 259 } … … 302 272 throw new Exception(__('No namespace specified')); 303 273 } 304 274 305 275 if (!array_key_exists($oldId,$this->settings) || array_key_exists($newId,$this->settings)) { 306 276 return false; … … 321 291 322 292 /** 323 Removes an existing setting in a Namespace 324 293 Removes an existing setting in a Namespace 294 325 295 @param id <b>string</b> Setting ID 326 296 */ … … 330 300 throw new Exception(__('No namespace specified')); 331 301 } 332 302 333 303 $strReq = 'DELETE FROM '.$this->table.' '; 334 304 335 305 if ($this->blog_id === null) { 336 306 $strReq .= 'WHERE blog_id IS NULL '; … … 338 308 $strReq .= "WHERE blog_id = '".$this->con->escape($this->blog_id)."' "; 339 309 } 340 310 341 311 $strReq .= "AND setting_id = '".$this->con->escape($id)."' "; 342 312 $strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' "; 343 313 344 314 $this->con->execute($strReq); 345 315 } 346 347 /** 348 Removes all existing settings in a Namespace 349 316 317 /** 318 Removes all existing settings in a Namespace 319 350 320 @param force_global <b>boolean</b> Force global pref drop 351 321 */ … … 355 325 throw new Exception(__('No namespace specified')); 356 326 } 357 327 358 328 $strReq = 'DELETE FROM '.$this->table.' '; 359 329 360 330 if (($force_global) || ($this->blog_id === null)) { 361 331 $strReq .= 'WHERE blog_id IS NULL '; … … 365 335 $global = false; 366 336 } 367 337 368 338 $strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' "; 369 339 370 340 $this->con->execute($strReq); 371 341 372 342 $array = $global ? 'global' : 'local'; 373 343 unset($this->{$array.'_settings'}); 374 344 $this->{$array.'_settings'} = array(); 375 345 376 346 $array = $global ? 'local' : 'global'; 377 347 $this->settings = $this->{$array.'_settings'}; 378 348 } 379 349 380 350 /** 381 351 Returns $settings property content. 382 352 383 353 @return <b>array</b> 384 354 */ … … 387 357 return $this->settings; 388 358 } 389 359 390 360 /** 391 361 Returns $global_settings property content. 392 362 393 363 @return <b>array</b> 394 364 */ -
inc/prepend.php
r2496 r2492 135 135 # Constants 136 136 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 137 define('DC_VERSION','2. 7-dev');137 define('DC_VERSION','2.6-RC'); 138 138 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 139 139 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); -
plugins/antispam/index.php
r2495 r2322 117 117 echo 118 118 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 119 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').120 119 dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 121 120 } -
plugins/blogroll/index.php
r2495 r2256 27 27 { 28 28 $default_tab = 'import-links'; 29 29 30 30 try 31 31 { … … 35 35 throw new Exception(__('Unable to move uploaded file.')); 36 36 } 37 37 38 38 require_once dirname(__FILE__).'/class.dc.importblogroll.php'; 39 39 try { … … 44 44 throw $e; 45 45 } 46 47 46 47 48 48 if (empty($imported)) { 49 49 unset($imported); … … 69 69 } 70 70 } 71 71 72 72 dcPage::addSuccessNotice(__('links have been successfully imported.')); 73 http::redirect($p_url); 73 http::redirect($p_url); 74 74 } 75 75 76 76 if (!empty($_POST['cancel_import'])) { 77 77 $core->error->add(__('Import operation cancelled.')); 78 $default_tab = 'import-links'; 78 $default_tab = 'import-links'; 79 79 } 80 80 … … 86 86 $link_desc = $_POST['link_desc']; 87 87 $link_lang = $_POST['link_lang']; 88 88 89 89 try { 90 90 $blogroll->addLink($link_title,$link_href,$link_desc,$link_lang); … … 102 102 { 103 103 $cat_title = $_POST['cat_title']; 104 104 105 105 try { 106 106 $blogroll->addCategory($cat_title); … … 124 124 } 125 125 } 126 126 127 127 if (!$core->error->flag()) { 128 128 dcPage::addSuccessNotice(__('Items have been successfully removed.')); … … 145 145 foreach ($order as $pos => $l) { 146 146 $pos = ((integer) $pos)+1; 147 147 148 148 try { 149 149 $blogroll->updateOrder($l,$pos); … … 152 152 } 153 153 } 154 154 155 155 if (!$core->error->flag()) { 156 156 dcPage::addSuccessNotice(__('Items order has been successfully updated')); … … 172 172 <title><?php echo __('Blogroll'); ?></title> 173 173 <?php echo dcPage::jsConfirmClose('links-form','add-link-form','add-category-form'); ?> 174 <?php 174 <?php 175 175 $core->auth->user_prefs->addWorkspace('accessibility'); 176 176 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 177 177 echo 178 178 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 179 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').180 179 dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 181 180 } … … 214 213 { 215 214 $position = (string) $rs->index()+1; 216 215 217 216 echo 218 217 '<tr class="line" id="l_'.$rs->link_id.'">'. 219 218 '<td class="handle minimal">'.form::field(array('order['.$rs->link_id.']'),2,5,$position,'position','',false,'title="'.__('position').'"').'</td>'. 220 219 '<td class="minimal">'.form::checkbox(array('remove[]'),$rs->link_id,'','','',false,'title="'.__('select this link').'"').'</td>'; 221 222 220 221 223 222 if ($rs->is_cat) 224 223 { … … 236 235 '<td>'.html::escapeHTML($rs->link_lang).'</td>'; 237 236 } 238 237 239 238 echo '</tr>'; 240 239 } … … 246 245 <p class="col"> 247 246 <?php 248 echo 247 echo 249 248 form::hidden('links_order',''). 250 249 form::hidden(array('p'),'blogroll'). … … 253 252 <input type="submit" name="saveorder" value="<?php echo __('Save order'); ?>" /></p> 254 253 <p class="col right"><input type="submit" class="delete" name="removeaction" 255 value="<?php echo __('Delete selected links'); ?>" 254 value="<?php echo __('Delete selected links'); ?>" 256 255 onclick="return window.confirm(' 257 256 <?php echo html::escapeJS(__('Are you sure you want to delete selected links?')); ?>');" /></p> … … 331 330 '<th>'.__('Description').'</th>'. 332 331 '</tr>'; 333 332 334 333 $i = 0; 335 334 foreach ($imported as $entry) { … … 337 336 $title = html::escapeHTML($entry->title); 338 337 $desc = html::escapeHTML($entry->desc); 339 340 echo 338 339 echo 341 340 '<tr><td>'.form::checkbox(array('entries[]'),$i,'','','').'</td>'. 342 341 '<td nowrap><a href="'.$url.'">'.$title.'</a>'. … … 346 345 '<td>'.$desc. 347 346 '<input type="hidden" name="desc['.$i.']" value="'.$desc.'" />'. 348 '</td></tr>'."\n"; 347 '</td></tr>'."\n"; 349 348 $i++; 350 349 } … … 353 352 '<div class="two-cols">'. 354 353 '<p class="col checkboxes-helpers"></p>'. 355 354 356 355 '<p class="col right">'. 357 356 form::hidden(array('p'),'blogroll'). -
plugins/pages/list.php
r2496 r2442 55 55 <title><?php echo __('Pages'); ?></title> 56 56 <?php 57 echo 58 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 59 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 57 echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 60 58 dcPage::jsLoad('index.php?pf=pages/list.js'). 61 59 '<script type="text/javascript">'. … … 91 89 $post_list->display($page,$nb_per_page, 92 90 '<form action="plugin.php" method="post" id="form-entries">'. 93 91 94 92 '%s'. 95 93 96 94 '<div class="two-cols">'. 97 95 '<p class="col checkboxes-helpers"></p>'. 98 96 99 97 '<p class="col right"><label for="action" class="classic">'.__('Selected pages action:').'</label> '. 100 98 form::combo('action',$pages_actions_page->getCombo()). -
plugins/simpleMenu/index.php
r2496 r2455 347 347 echo 348 348 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 349 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').350 349 dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 351 350 } -
plugins/widgets/index.php
r2520 r2509 218 218 echo 219 219 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 220 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js').221 220 dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 222 221 ?> … … 367 366 $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 368 367 $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 369 368 370 369 $iname = 'w['.$pr.']['.$i.']'; 371 370 -
themes/ductile/_prepend.php
r2495 r1133 26 26 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 27 27 echo 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 29 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 30 29 echo <<<EOT 31 30 <script type="text/javascript">
Note: See TracChangeset
for help on using the changeset viewer.