Changes in [2519:61b3fb5e6a1f:2520:6c1482f9960e]
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/_charte.php
r2501 r2504 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> 33 34 <script type="text/javascript" src="js/jquery/jquery.pageTabs.js"></script> 34 35 <script type="text/javascript" src="js/jquery/jquery.biscuit.js"></script> -
admin/categories.php
r2464 r2496 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'); 111 112 $starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js'); 112 113 } -
admin/preferences.php
r2449 r2496 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'). 307 308 dcPage::jsLoad('js/jquery/jquery.pwstrength.js'). 308 309 '<script type="text/javascript">'."\n". … … 320 321 dcPage::jsPageTabs($default_tab). 321 322 dcPage::jsConfirmClose('user-form'). 322 323 323 324 # --BEHAVIOR-- adminPreferencesHeaders 324 325 $core->callBehavior('adminPreferencesHeaders'), … … 386 387 echo 387 388 '<h4 class="vertical-separator pretty-title">'.__('Change my password').'</h4>'. 388 389 389 390 '<div class="pw-table">'. 390 391 '<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'. … … 395 396 '</div>'. 396 397 '</div>'. 397 398 398 399 '<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'. 399 400 form::password('new_pwd_c',20,255).'</p>'. 400 401 401 402 '<p><label for="cur_pwd">'.__('Your current password:').'</label>'. 402 403 form::password('cur_pwd',20,255).'</p>'. … … 589 590 590 591 if (count($iconsets_combo) > 1) { 591 echo 592 echo 592 593 '<div class="fieldset">'. 593 594 '<h4>'.__('Dashboard icons').'</h4>'. -
inc/core/class.dc.namespace.php
r1179 r2505 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 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 126 156 /** 127 157 Magic __get method. … … 132 162 return $this->get($n); 133 163 } 134 164 135 165 /** 136 166 Sets a setting in $settings property. This sets the setting for script 137 167 execution time only and if setting exists. 138 168 139 169 @param n <b>string</b> Setting name 140 170 @param v <b>mixed</b> Setting value … … 146 176 } 147 177 } 148 178 149 179 /** 150 180 Magic __set method. … … 155 185 $this->set($n,$v); 156 186 } 157 187 158 188 /** 159 189 Creates or updates a setting. 160 190 161 191 $type could be 'string', 'integer', 'float', 'boolean' or null. If $type is 162 192 null and setting exists, it will keep current setting type. 163 193 164 194 $value_change allow you to not change setting. Useful if you need to change 165 195 a setting label or type and don't want to change its value. 166 196 167 197 @param id <b>string</b> Setting ID 168 198 @param value <b>mixed</b> Setting value … … 177 207 throw new Exception(sprintf(__('%s is not a valid setting id'),$id)); 178 208 } 179 209 180 210 # We don't want to change setting value 181 211 if (!$value_change) … … 187 217 } 188 218 } 189 219 190 220 # Setting type 191 221 if ($type == 'double') … … 207 237 $type = 'string'; 208 238 } 209 239 210 240 # We don't change label 211 241 if ($label == null) … … 217 247 } 218 248 } 219 249 220 250 settype($value,$type); 221 251 222 252 $cur = $this->con->openCursor($this->table); 223 253 $cur->setting_value = ($type == 'boolean') ? (string) (integer) $value : (string) $value; 224 254 $cur->setting_type = $type; 225 255 $cur->setting_label = $label; 226 256 227 257 #If we are local, compare to global value 228 258 if (!$global && $this->settingExists($id,true)) … … 231 261 $same_setting = $g['ns'] == $this->ns && $g['value'] == $value 232 262 && $g['type'] == $type && $g['label'] == $label; 233 263 234 264 # Drop setting if same value as global 235 265 if ($same_setting && $this->settingExists($id,false)) { … … 239 269 } 240 270 } 241 271 242 272 if ($this->settingExists($id,$global) && $this->ns == $this->settings[$id]['ns']) 243 273 { … … 247 277 $where = "WHERE blog_id = '".$this->con->escape($this->blog_id)."' "; 248 278 } 249 279 250 280 $cur->update($where."AND setting_id = '".$this->con->escape($id)."' AND setting_ns = '".$this->con->escape($this->ns)."' "); 251 281 } … … 255 285 $cur->blog_id = $global ? null : $this->blog_id; 256 286 $cur->setting_ns = $this->ns; 257 287 258 288 $cur->insert(); 259 289 } … … 272 302 throw new Exception(__('No namespace specified')); 273 303 } 274 304 275 305 if (!array_key_exists($oldId,$this->settings) || array_key_exists($newId,$this->settings)) { 276 306 return false; … … 291 321 292 322 /** 293 Removes an existing setting in a Namespace 294 323 Removes an existing setting in a Namespace 324 295 325 @param id <b>string</b> Setting ID 296 326 */ … … 300 330 throw new Exception(__('No namespace specified')); 301 331 } 302 332 303 333 $strReq = 'DELETE FROM '.$this->table.' '; 304 334 305 335 if ($this->blog_id === null) { 306 336 $strReq .= 'WHERE blog_id IS NULL '; … … 308 338 $strReq .= "WHERE blog_id = '".$this->con->escape($this->blog_id)."' "; 309 339 } 310 340 311 341 $strReq .= "AND setting_id = '".$this->con->escape($id)."' "; 312 342 $strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' "; 313 343 314 344 $this->con->execute($strReq); 315 345 } 316 317 /** 318 Removes all existing settings in a Namespace 319 346 347 /** 348 Removes all existing settings in a Namespace 349 320 350 @param force_global <b>boolean</b> Force global pref drop 321 351 */ … … 325 355 throw new Exception(__('No namespace specified')); 326 356 } 327 357 328 358 $strReq = 'DELETE FROM '.$this->table.' '; 329 359 330 360 if (($force_global) || ($this->blog_id === null)) { 331 361 $strReq .= 'WHERE blog_id IS NULL '; … … 335 365 $global = false; 336 366 } 337 367 338 368 $strReq .= "AND setting_ns = '".$this->con->escape($this->ns)."' "; 339 369 340 370 $this->con->execute($strReq); 341 371 342 372 $array = $global ? 'global' : 'local'; 343 373 unset($this->{$array.'_settings'}); 344 374 $this->{$array.'_settings'} = array(); 345 375 346 376 $array = $global ? 'local' : 'global'; 347 377 $this->settings = $this->{$array.'_settings'}; 348 378 } 349 379 350 380 /** 351 381 Returns $settings property content. 352 382 353 383 @return <b>array</b> 354 384 */ … … 357 387 return $this->settings; 358 388 } 359 389 360 390 /** 361 391 Returns $global_settings property content. 362 392 363 393 @return <b>array</b> 364 394 */ -
inc/prepend.php
r2492 r2496 135 135 # Constants 136 136 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 137 define('DC_VERSION','2. 6-RC');137 define('DC_VERSION','2.7-dev'); 138 138 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 139 139 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); -
plugins/antispam/index.php
r2322 r2495 117 117 echo 118 118 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 119 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 119 120 dcPage::jsLoad('index.php?pf=antispam/antispam.js'); 120 121 } -
plugins/blogroll/index.php
r2256 r2495 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'). 179 180 dcPage::jsLoad('index.php?pf=blogroll/blogroll.js'); 180 181 } … … 213 214 { 214 215 $position = (string) $rs->index()+1; 215 216 216 217 echo 217 218 '<tr class="line" id="l_'.$rs->link_id.'">'. 218 219 '<td class="handle minimal">'.form::field(array('order['.$rs->link_id.']'),2,5,$position,'position','',false,'title="'.__('position').'"').'</td>'. 219 220 '<td class="minimal">'.form::checkbox(array('remove[]'),$rs->link_id,'','','',false,'title="'.__('select this link').'"').'</td>'; 220 221 221 222 222 223 if ($rs->is_cat) 223 224 { … … 235 236 '<td>'.html::escapeHTML($rs->link_lang).'</td>'; 236 237 } 237 238 238 239 echo '</tr>'; 239 240 } … … 245 246 <p class="col"> 246 247 <?php 247 echo 248 echo 248 249 form::hidden('links_order',''). 249 250 form::hidden(array('p'),'blogroll'). … … 252 253 <input type="submit" name="saveorder" value="<?php echo __('Save order'); ?>" /></p> 253 254 <p class="col right"><input type="submit" class="delete" name="removeaction" 254 value="<?php echo __('Delete selected links'); ?>" 255 value="<?php echo __('Delete selected links'); ?>" 255 256 onclick="return window.confirm(' 256 257 <?php echo html::escapeJS(__('Are you sure you want to delete selected links?')); ?>');" /></p> … … 330 331 '<th>'.__('Description').'</th>'. 331 332 '</tr>'; 332 333 333 334 $i = 0; 334 335 foreach ($imported as $entry) { … … 336 337 $title = html::escapeHTML($entry->title); 337 338 $desc = html::escapeHTML($entry->desc); 338 339 echo 339 340 echo 340 341 '<tr><td>'.form::checkbox(array('entries[]'),$i,'','','').'</td>'. 341 342 '<td nowrap><a href="'.$url.'">'.$title.'</a>'. … … 345 346 '<td>'.$desc. 346 347 '<input type="hidden" name="desc['.$i.']" value="'.$desc.'" />'. 347 '</td></tr>'."\n"; 348 '</td></tr>'."\n"; 348 349 $i++; 349 350 } … … 352 353 '<div class="two-cols">'. 353 354 '<p class="col checkboxes-helpers"></p>'. 354 355 355 356 '<p class="col right">'. 356 357 form::hidden(array('p'),'blogroll'). -
plugins/pages/list.php
r2442 r2496 55 55 <title><?php echo __('Pages'); ?></title> 56 56 <?php 57 echo dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 57 echo 58 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 59 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 58 60 dcPage::jsLoad('index.php?pf=pages/list.js'). 59 61 '<script type="text/javascript">'. … … 89 91 $post_list->display($page,$nb_per_page, 90 92 '<form action="plugin.php" method="post" id="form-entries">'. 91 93 92 94 '%s'. 93 95 94 96 '<div class="two-cols">'. 95 97 '<p class="col checkboxes-helpers"></p>'. 96 98 97 99 '<p class="col right"><label for="action" class="classic">'.__('Selected pages action:').'</label> '. 98 100 form::combo('action',$pages_actions_page->getCombo()). -
plugins/simpleMenu/index.php
r2455 r2496 347 347 echo 348 348 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 349 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 349 350 dcPage::jsLoad('index.php?pf=simpleMenu/simplemenu.js'); 350 351 } -
plugins/widgets/index.php
r2509 r2520 218 218 echo 219 219 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 220 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'). 220 221 dcPage::jsLoad('index.php?pf=widgets/widgets.js'); 221 222 ?> … … 366 367 $altUp = $i == 0 ? ' alt=""' : ' alt="'.__('Up the widget').'"'; 367 368 $altDown = $i == count($widgets->elements())-1 ? ' alt=""' : ' alt="'.__('Down the widget').'"'; 368 369 369 370 $iname = 'w['.$pr.']['.$i.']'; 370 371 -
themes/ductile/_prepend.php
r1133 r2495 26 26 if (!$core->auth->user_prefs->accessibility->nodragdrop) { 27 27 echo 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'); 28 dcPage::jsLoad('js/jquery/jquery-ui.custom.js'). 29 dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 29 30 echo <<<EOT 30 31 <script type="text/javascript">
Note: See TracChangeset
for help on using the changeset viewer.