Changeset 2227:bfa7b3467627
- Timestamp:
- 10/03/13 13:47:05 (10 years ago)
- Branch:
- dcRepo
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/blog_theme.php
r2222 r2227 62 62 63 63 # -- Display module configuration page -- 64 if ($list->setConfiguration File($core->blog->settings->system->theme)) {64 if ($list->setConfiguration($core->blog->settings->system->theme)) { 65 65 66 66 # Get content before page headers 67 include $list-> getConfigurationFile();67 include $list->includeConfiguration(); 68 68 69 69 # Gather content 70 $list-> setConfigurationContent();70 $list->getConfiguration(); 71 71 72 72 # Display page … … 81 81 array( 82 82 html::escapeHTML($core->blog->name) => '', 83 __('Blog appearance') => 'blog_theme.php',83 __('Blog appearance') => $list->getURL('',false), 84 84 '<span class="page-title">'.__('Theme configuration').'</span>' => '' 85 85 )) … … 87 87 88 88 # Display previously gathered content 89 $list-> getConfigurationContent();89 $list->displayConfiguration(); 90 90 91 91 dcPage::close(); … … 107 107 dcPage::jsLoad('js/_blog_theme.js'). 108 108 dcPage::jsPageTabs(). 109 dcPage::jsColorPicker() ,109 dcPage::jsColorPicker(). 110 110 111 111 # --BEHAVIOR-- themesToolsHeaders … … 120 120 121 121 # -- Display modules lists -- 122 if ($core->auth->isSuperAdmin() && $list->is PathWritable()) {122 if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 123 123 124 124 # Updated modules from repo … … 129 129 '<h3>'.html::escapeHTML(__('Update themes')).'</h3>'. 130 130 '<p>'.sprintf( 131 __('There is one theme to update available from %2$s.', 'There are %s themes to update available from %s.', count($modules)), 132 count($modules), 133 '<a href="http://dotaddict.org/dc2/themes">Dotaddict</a>' 131 __('There is one theme to update available from repository.', 'There are %s themes to update available from repository.', count($modules)), 132 count($modules) 134 133 ).'</p>'; 135 134 136 135 $list 137 ->newList('theme-update') 136 ->initList('theme-update') 137 ->setTab('themes') 138 138 ->setModules($modules) 139 ->setPageTab('themes') 140 ->displayModulesList( 139 ->displayModules( 141 140 /*cols */ array('sshot', 'name', 'desc', 'author', 'version', 'current_version', 'parent'), 142 141 /* actions */ array('update', 'delete') 143 );144 145 echo146 '</div>';147 }148 }149 150 # List all active plugins151 echo152 '<div class="multi-part" id="themes" title="'.__('Installed themes').'">';153 154 $modules = $list->modules->getModules();155 if (!empty($modules)) {156 157 echo158 '<h3>'.__('Activated themes').'</h3>'.159 '<p>'.__('Manage installed themes from this list.').'</p>';160 161 $list162 ->newList('theme-activate')163 ->setModules($modules)164 ->setPageTab('themes')165 ->displayModulesList(166 /* cols */ array('sshot', 'distrib', 'name', 'config', 'desc', 'author', 'version', 'parent'),167 /* actions */ array('select', 'deactivate', 'delete')168 );169 }170 171 $modules = $list->modules->getDisabledModules();172 if (!empty($modules)) {173 174 echo175 '<h3>'.__('Deactivated themes').'</h3>'.176 '<p>'.__('Deactivated themes are installed but not usable. You can activate them from here.').'</p>';177 178 $list179 ->newList('theme-deactivate')180 ->setModules($modules)181 ->setPageTab('themes')182 ->displayModulesList(183 /* cols */ array('name', 'distrib'),184 /* actions */ array('activate', 'delete')185 );186 }187 188 echo189 '</div>';190 191 if ($core->auth->isSuperAdmin() && $list->isPathWritable()) {192 193 # New modules from repo194 $search = $list->getSearchQuery();195 $modules = $search ? $list->store->search($search) : $list->store->get();196 197 if (!empty($search) || !empty($modules)) {198 echo199 '<div class="multi-part" id="new" title="'.__('Add themes from Dotaddict').'">'.200 '<h3>'.__('Add themes from Dotaddict repository').'</h3>';201 202 $list203 ->newList('theme-new')204 ->setModules($modules)205 ->setPageTab('new')206 ->displaySearchForm()207 ->displayNavMenu()208 ->displayModulesList(209 /* cols */ array('expander', 'sshot', 'name', 'score', 'config', 'desc', 'author', 'version', 'parent', 'details', 'support'),210 /* actions */ array('install'),211 /* nav limit */ true212 142 ); 213 143 … … 221 151 '</div>'; 222 152 } 153 } 154 155 # Activated modules 156 $modules = $list->modules->getModules(); 157 if (!empty($modules)) { 158 159 echo 160 '<div class="multi-part" id="themes" title="'.__('Installed themes').'">'. 161 '<h3>'.__('Installed themes').'</h3>'. 162 '<p>'.__('You can configure and manage installed themes from this list.').'</p>'; 163 164 $list 165 ->initList('theme-activate') 166 ->setTab('themes') 167 ->setModules($modules) 168 ->displayModules( 169 /* cols */ array('sshot', 'distrib', 'name', 'config', 'desc', 'author', 'version', 'parent'), 170 /* actions */ array('select', 'deactivate', 'delete') 171 ); 172 173 echo 174 '</div>'; 175 } 176 177 # Deactivated modules 178 $modules = $list->modules->getDisabledModules(); 179 if (!empty($modules)) { 180 181 echo 182 '<div class="multi-part" id="deactivate" title="'.__('Deactivated themes').'">'. 183 '<h3>'.__('Deactivated themes').'</h3>'. 184 '<p>'.__('Deactivated themes are installed but not usable. You can activate them from here.').'</p>'; 185 186 $list 187 ->initList('theme-deactivate') 188 ->setTab('themes') 189 ->setModules($modules) 190 ->displayModules( 191 /* cols */ array('name', 'distrib'), 192 /* actions */ array('activate', 'delete') 193 ); 194 195 echo 196 '</div>'; 197 } 198 199 if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 200 201 # New modules from repo 202 $search = $list->getSearch(); 203 $modules = $search ? $list->store->search($search) : $list->store->get(); 204 205 if (!empty($search) || !empty($modules)) { 206 echo 207 '<div class="multi-part" id="new" title="'.__('Add themes').'">'. 208 '<h3>'.__('Add themes from repository').'</h3>'. 209 '<p>'.__('You can search and install themes directly from repository.').'</p>'; 210 211 $list 212 ->initList('theme-new') 213 ->setTab('new') 214 ->setModules($modules) 215 ->displaySearch() 216 ->displayIndex() 217 ->displayModules( 218 /* cols */ array('expander', 'sshot', 'name', 'score', 'config', 'desc', 'author', 'version', 'parent', 'details', 'support'), 219 /* actions */ array('install'), 220 /* nav limit */ true 221 ); 222 223 echo 224 '<p class="info vertical-separator">'.sprintf( 225 __("Visit %s repository, the resources center for Dotclear."), 226 '<a href="http://dotaddict.org/dc2/themes">Dotaddict</a>' 227 ). 228 '</p>'. 229 230 '</div>'; 231 } 223 232 224 233 # Add a new plugin 225 234 echo 226 235 '<div class="multi-part" id="addtheme" title="'.__('Install or upgrade manually').'">'. 236 '<h3>'.__('Add themes from a package').'</h3>'. 227 237 '<p>'.__('You can install themes by uploading or downloading zip files.').'</p>'; 228 238 -
admin/plugins.php
r2222 r2227 56 56 57 57 # -- Display module configuration page -- 58 if ($list->setConfiguration File()) {58 if ($list->setConfiguration()) { 59 59 60 60 # Get content before page headers 61 include $list-> getConfigurationFile();61 include $list->includeConfiguration(); 62 62 63 63 # Gather content 64 $list-> setConfigurationContent();64 $list->getConfiguration(); 65 65 66 66 # Display page … … 73 73 array( 74 74 html::escapeHTML($core->blog->name) => '', 75 '<a href="'.$list->getPageURL().'">'.__('Plugins management').'</a>' => '',75 __('Plugins management') => $list->getURL('',false), 76 76 '<span class="page-title">'.__('Plugin configuration').'</span>' => '' 77 77 )) … … 79 79 80 80 # Display previously gathered content 81 $list-> getConfigurationContent();81 $list->displayConfiguration(); 82 82 83 83 dcPage::close(); … … 125 125 '<li>'.$k.'</li>'; 126 126 } 127 echo 128 127 128 echo 129 129 '</ul></div>'; 130 130 } … … 143 143 144 144 # -- Display modules lists -- 145 if ($core->auth->isSuperAdmin() && $list->is PathWritable()) {145 if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 146 146 147 147 # Updated modules from repo … … 152 152 '<h3>'.html::escapeHTML(__('Update plugins')).'</h3>'. 153 153 '<p>'.sprintf( 154 __('There is one plugin to update available from %2$s.', 'There are %s plugins to update available from %s.', count($modules)), 155 count($modules), 156 '<a href="http://dotaddict.org/dc2/plugins">Dotaddict</a>' 154 __('There is one plugin to update available from repository.', 'There are %s plugins to update available from repository.', count($modules)), 155 count($modules) 157 156 ).'</p>'; 158 157 159 158 $list 160 ->newList('plugin-update') 159 ->initList('plugin-update') 160 ->setTab('update') 161 161 ->setModules($modules) 162 ->setPageTab('update') 163 ->displayModulesList( 162 ->displayModules( 164 163 /*cols */ array('icon', 'name', 'version', 'current_version', 'desc'), 165 164 /* actions */ array('update') 166 );167 168 echo169 '</div>';170 }171 }172 173 # List all active plugins174 echo175 '<div class="multi-part" id="plugins" title="'.__('Installed plugins').'">';176 177 $modules = $list->modules->getModules();178 if (!empty($modules)) {179 echo180 '<h3>'.__('Activated plugins').'</h3>'.181 '<p>'.__('Manage installed plugins from this list.').'</p>';182 183 $list184 ->newList('plugin-activate')185 ->setModules($modules)186 ->setPageTab('plugins')187 ->displayModulesList(188 /* cols */ array('expander', 'icon', 'name', 'config', 'version', 'desc', 'distrib'),189 /* actions */ array('deactivate', 'delete')190 );191 }192 193 # Deactivated modules194 $modules = $list->modules->getDisabledModules();195 if (!empty($modules)) {196 echo197 '<h3>'.__('Deactivated plugins').'</h3>'.198 '<p>'.__('Deactivated plugins are installed but not usable. You can activate them from here.').'</p>';199 200 $list201 ->newList('plugin-deactivate')202 ->setModules($modules)203 ->setPageTab('plugins')204 ->displayModulesList(205 /* cols */ array('icon', 'name', 'distrib'),206 /* actions */ array('activate', 'delete')207 );208 }209 210 echo211 '</div>';212 213 if ($core->auth->isSuperAdmin() && $list->isPathWritable()) {214 215 # New modules from repo216 $search = $list->getSearchQuery();217 $modules = $search ? $list->store->search($search) : $list->store->get();218 219 if (!empty($search) || !empty($modules)) {220 echo221 '<div class="multi-part" id="new" title="'.__('Add plugins from Dotaddict').'">'.222 '<h3>'.__('Add plugins from Dotaddict repository').'</h3>';223 224 $list225 ->newList('plugin-new')226 ->setModules($modules)227 ->setPageTab('new')228 ->displaySearchForm()229 ->displayNavMenu()230 ->displayModulesList(231 /* cols */ array('expander', 'name', 'score', 'version', 'desc'),232 /* actions */ array('install'),233 /* nav limit */ true234 165 ); 235 166 … … 243 174 '</div>'; 244 175 } 176 } 177 178 echo 179 '<div class="multi-part" id="plugins" title="'.__('Installed plugins').'">'; 180 181 # Activated modules 182 $modules = $list->modules->getModules(); 183 if (!empty($modules)) { 184 185 echo 186 '<h3>'.($core->auth->isSuperAdmin() ?__('Activated plugins') : __('Installed plugins')).'</h3>'. 187 '<p>'.__('You can configure and manage installed plugins from this list.').'</p>'; 188 189 $list 190 ->initList('plugin-activate') 191 ->setTab('plugins') 192 ->setModules($modules) 193 ->displayModules( 194 /* cols */ array('expander', 'icon', 'name', 'config', 'version', 'desc', 'distrib'), 195 /* actions */ array('deactivate', 'delete') 196 ); 197 } 198 199 # Deactivated modules 200 if ($core->auth->isSuperAdmin()) { 201 $modules = $list->modules->getDisabledModules(); 202 if (!empty($modules)) { 203 echo 204 '<h3>'.__('Deactivated plugins').'</h3>'. 205 '<p>'.__('Deactivated plugins are installed but not usable. You can activate them from here.').'</p>'; 206 207 $list 208 ->initList('plugin-deactivate') 209 ->setTab('plugins') 210 ->setModules($modules) 211 ->displayModules( 212 /* cols */ array('icon', 'name', 'distrib'), 213 /* actions */ array('activate', 'delete') 214 ); 215 } 216 } 217 218 echo 219 '</div>'; 220 221 if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { 222 223 # New modules from repo 224 $search = $list->getSearch(); 225 $modules = $search ? $list->store->search($search) : $list->store->get(); 226 227 if (!empty($search) || !empty($modules)) { 228 echo 229 '<div class="multi-part" id="new" title="'.__('Add plugins').'">'. 230 '<h3>'.__('Add plugins from repository').'</h3>'. 231 '<p>'.__('You can search and install plugins directly from repository.').'</p>'; 232 233 $list 234 ->initList('plugin-new') 235 ->setTab('new') 236 ->setModules($modules) 237 ->displaySearch() 238 ->displayIndex() 239 ->displayModules( 240 /* cols */ array('expander', 'name', 'score', 'version', 'desc'), 241 /* actions */ array('install'), 242 /* nav limit */ true 243 ); 244 245 echo 246 '<p class="info vertical-separator">'.sprintf( 247 __("Visit %s repository, the resources center for Dotclear."), 248 '<a href="http://dotaddict.org/dc2/plugins">Dotaddict</a>' 249 ). 250 '</p>'. 251 252 '</div>'; 253 } 245 254 246 255 # Add a new plugin 247 256 echo 248 257 '<div class="multi-part" id="addplugin" title="'.__('Install or upgrade manually').'">'. 258 '<h3>'.__('Add plugins from a package').'</h3>'. 249 259 '<p>'.__('You can install plugins by uploading or downloading zip files.').'</p>'; 250 260 … … 259 269 260 270 # -- Notice for super admin -- 261 if ($core->auth->isSuperAdmin() && !$list->is PathWritable()) {271 if ($core->auth->isSuperAdmin() && !$list->isWritablePath()) { 262 272 echo 263 273 '<p class="warning">'.__('Some functions are disabled, please give write access to your plugins directory to enable them.').'</p>'; -
admin/services.php
r2216 r2227 485 485 } 486 486 487 $module = adminModulesList:: parseModuleInfo($id, $module);487 $module = adminModulesList::sanitizeModule($id, $module); 488 488 489 489 $rsp = new xmlTag('module'); -
admin/style/default.css
r2221 r2227 2348 2348 display: block; 2349 2349 } 2350 .debug { 2351 background: #ff6; 2352 padding: 3px 0.5em 2px; 2353 } 2350 2354 /* ---------------------------------------------- Couleurs ajoutées via javascript 2351 2355 /* color-picker.js */ -
inc/admin/lib.moduleslist.php
r2222 r2227 12 12 if (!defined('DC_ADMIN_CONTEXT')) { return; } 13 13 14 /** 15 * @ingroup DC_CORE 16 * @brief Helper for admin list of modules. 17 * @since 2.6 18 19 * Provides an object to parse XML feed of modules from a repository. 20 */ 14 21 class adminModulesList 15 22 { 16 public $core; 17 public $modules; 18 public $store; 19 20 public static $allow_multi_install = false; 21 public static $distributed_modules = array(); 22 23 protected $list_id = 'unknow'; 24 protected $data = array(); 25 26 protected $config_module = ''; 27 protected $config_file = ''; 28 protected $config_content = ''; 29 30 protected $path = false; 31 protected $path_writable = false; 32 protected $path_pattern = false; 33 34 protected $page_url = 'plugins.php'; 35 protected $page_qs = '?'; 36 protected $page_tab = ''; 37 38 public static $nav_indexes = 'abcdefghijklmnopqrstuvwxyz0123456789'; 39 protected $nav_list = array(); 40 protected $nav_special = 'other'; 41 42 protected $sort_field = 'sname'; 43 protected $sort_asc = true; 44 23 public $core; /**< @var object dcCore instance */ 24 public $modules; /**< @var object dcModules instance */ 25 public $store; /**< @var object dcStore instance */ 26 27 public static $allow_multi_install = false; /**< @var boolean Work with multiple root directories */ 28 public static $distributed_modules = array(); /**< @var array List of modules distributed with Dotclear */ 29 30 protected $list_id = 'unknow'; /**< @var string Current list ID */ 31 protected $data = array(); /**< @var array Current modules */ 32 33 protected $config_module = ''; /**< @var string Module ID to configure */ 34 protected $config_file = ''; /**< @var string Module path to configure */ 35 protected $config_content = ''; /**< @var string Module configuration page content */ 36 37 protected $path = false; /**< @var string Modules root directory */ 38 protected $path_writable = false; /**< @var boolean Indicate if modules root directory is writable */ 39 protected $path_pattern = false; /**< @var string Directory pattern to work on */ 40 41 protected $page_url = 'plugins.php'; /**< @var string Page URL */ 42 protected $page_qs = '?'; /**< @var string Page query string */ 43 protected $page_tab = ''; /**< @var string Page tab */ 44 45 public static $nav_indexes = 'abcdefghijklmnopqrstuvwxyz0123456789'; /**< @var string Index list */ 46 protected $nav_list = array(); /**< @var array Index list with special index */ 47 protected $nav_special = 'other'; /**< @var string Text for other special index */ 48 49 protected $sort_field = 'sname'; /**< @var string Field used to sort modules */ 50 protected $sort_asc = true; /**< @var boolean Sort order asc */ 51 52 /** 53 * Constructor. 54 * 55 * Note that this creates dcStore instance. 56 * 57 * @param object $modules dcModules instance 58 * @param string $modules_root Modules root directories 59 * @param string $xml_url URL of modules feed from repository 60 */ 45 61 public function __construct(dcModules $modules, $modules_root, $xml_url) 46 62 { … … 49 65 $this->store = new dcStore($modules, $xml_url); 50 66 51 $this->setPathInfo($modules_root); 52 $this->setNavSpecial(__('other')); 53 } 54 55 public function newList($list_id) 67 $this->setPath($modules_root); 68 $this->setIndex(__('other')); 69 } 70 71 /** 72 * Begin a new list. 73 * 74 * @param string $id New list ID 75 * @return adminModulesList self instance 76 */ 77 public function initList($id) 56 78 { 57 79 $this->data = array(); 58 80 $this->page_tab = ''; 59 $this->list_id = $ list_id;81 $this->list_id = $id; 60 82 61 83 return $this; 62 84 } 63 85 64 protected function setPathInfo($root) 86 /// @name Modules root directory methods 87 //@{ 88 /** 89 * Set path info. 90 * 91 * @param string $root Modules root directories 92 * @return adminModulesList self instance 93 */ 94 protected function setPath($root) 65 95 { 66 96 $paths = explode(PATH_SEPARATOR, $root); … … 77 107 } 78 108 109 /** 110 * Get modules root directory. 111 * 112 * @return Path to work on 113 */ 79 114 public function getPath() 80 115 { … … 82 117 } 83 118 84 public function isPathWritable() 119 /** 120 * Check if modules root directory is writable. 121 * 122 * @return True if directory is writable 123 */ 124 public function isWritablePath() 85 125 { 86 126 return $this->path_writable; 87 127 } 88 128 89 public function isPathDeletable($root) 129 /** 130 * Check if root directory of a module is deletable. 131 * 132 * @param string $root Module root directory 133 * @return True if directory is delatable 134 */ 135 public function isDeletablePath($root) 90 136 { 91 137 return $this->path_writable … … 93 139 && $this->core->auth->isSuperAdmin(); 94 140 } 95 96 public function setPageURL($url) 141 //@} 142 143 /// @name Page methods 144 //@{ 145 /** 146 * Set page base URL. 147 * 148 * @param string $url Page base URL 149 * @return adminModulesList self instance 150 */ 151 public function setURL($url) 97 152 { 98 153 $this->page_qs = strpos('?', $url) ? '&' : '?'; … … 102 157 } 103 158 104 public function getPageURL($queries='', $with_tab=true) 159 /** 160 * Get page URL. 161 * 162 * @param string|array $queries Additionnal query string 163 * @param booleany $with_tab Add current tab to URL end 164 * @return Clean page URL 165 */ 166 public function getURL($queries='', $with_tab=true) 105 167 { 106 168 return $this->page_url. … … 110 172 } 111 173 112 public function setPageTab($tab) 174 /** 175 * Set page tab. 176 * 177 * @param string $tab Page tab 178 * @return adminModulesList self instance 179 */ 180 public function setTab($tab) 113 181 { 114 182 $this->page_tab = $tab; … … 117 185 } 118 186 119 public function getPageTab() 187 /** 188 * Get page tab. 189 * 190 * @return Page tab 191 */ 192 public function getTab() 120 193 { 121 194 return $this->page_tab; 122 195 } 123 124 public function getSearchQuery() 196 //@} 197 198 /// @name Search methods 199 //@{ 200 /** 201 * Get search query. 202 * 203 * @return Search query 204 */ 205 public function getSearch() 125 206 { 126 207 $query = !empty($_REQUEST['m_search']) ? trim($_REQUEST['m_search']) : null; 127 return strlen($query) > 1 ? $query : null; 128 } 129 130 public function displaySearchForm() 131 { 132 $query = $this->getSearchQuery(); 208 return strlen($query) > 2 ? $query : null; 209 } 210 211 /** 212 * Display searh form. 213 * 214 * @return adminModulesList self instance 215 */ 216 public function displaySearch() 217 { 218 $query = $this->getSearch(); 133 219 134 220 if (empty($this->data) && $query === null) { … … 137 223 138 224 echo 139 '<form action="'.$this->get PageURL().'" method="get" class="fieldset">'.225 '<form action="'.$this->getURL().'" method="get" class="fieldset">'. 140 226 '<p><label for="m_search" class="classic">'.__('Search in repository:').' </label><br />'. 141 227 form::field(array('m_search','m_search'), 30, 255, html::escapeHTML($query)). 142 228 '<input type="submit" value="'.__('Search').'" /> '; 143 if ($query) { echo ' <a href="'.$this->get PageURL().'" class="button">'.__('Reset search').'</a>'; }229 if ($query) { echo ' <a href="'.$this->getURL().'" class="button">'.__('Reset search').'</a>'; } 144 230 echo '</p>'. 145 231 '</form>'; … … 155 241 return $this; 156 242 } 157 158 public function setNavSpecial($str) 243 //@} 244 245 /// @name Navigation menu methods 246 //@{ 247 /** 248 * Set navigation special index. 249 * 250 * @return adminModulesList self instance 251 */ 252 public function setIndex($str) 159 253 { 160 254 $this->nav_special = (string) $str; … … 164 258 } 165 259 166 public function getNavQuery() 260 /** 261 * Get index from query. 262 * 263 * @return Query index or default one 264 */ 265 public function getIndex() 167 266 { 168 267 return isset($_REQUEST['m_nav']) && in_array($_REQUEST['m_nav'], $this->nav_list) ? $_REQUEST['m_nav'] : $this->nav_list[0]; 169 268 } 170 269 171 public function displayNavMenu() 172 { 173 if (empty($this->data) || $this->getSearchQuery() !== null) { 270 /** 271 * Display navigation by index menu. 272 * 273 * @return adminModulesList self instance 274 */ 275 public function displayIndex() 276 { 277 if (empty($this->data) || $this->getSearch() !== null) { 174 278 return $this; 175 279 } … … 194 298 foreach($this->nav_list as $char) { 195 299 # Selected letter 196 if ($this->get NavQuery() == $char) {300 if ($this->getIndex() == $char) { 197 301 $buttons[] = '<li class="active" title="'.__('current selection').'"><strong> '.$char.' </strong></li>'; 198 302 } … … 200 304 elseif (!empty($indexes[$char])) { 201 305 $title = sprintf(__('%d module', '%d modules', $indexes[$char]), $indexes[$char]); 202 $buttons[] = '<li class="btn" title="'.$title.'"><a href="'.$this->get PageURL('m_nav='.$char).'" title="'.$title.'"> '.$char.' </a></li>';306 $buttons[] = '<li class="btn" title="'.$title.'"><a href="'.$this->getURL('m_nav='.$char).'" title="'.$title.'"> '.$char.' </a></li>'; 203 307 } 204 308 # Letter without modules … … 212 316 return $this; 213 317 } 214 215 public function setSortField($field, $asc=true) 318 //@} 319 320 /// @name Sort methods 321 //@{ 322 /** 323 * Set default sort field. 324 * 325 * @return adminModulesList self instance 326 */ 327 public function setSort($field, $asc=true) 216 328 { 217 329 $this->sort_field = $field; … … 221 333 } 222 334 223 public function getSortQuery() 335 /** 336 * Get sort field from query. 337 * 338 * @return Query sort field or default one 339 */ 340 public function getSort() 224 341 { 225 342 return !empty($_REQUEST['m_sort']) ? $_REQUEST['m_sort'] : $this->sort_field; 226 343 } 227 344 228 public function displaySortForm() 229 { 230 //not yet implemented 231 } 232 345 /** 346 * Display sort field form. 347 * 348 * @note This method is not implemented yet 349 * @return adminModulesList self instance 350 */ 351 public function displaySort() 352 { 353 // 354 355 return $this; 356 } 357 //@} 358 359 /// @name Modules methods 360 //@{ 361 /** 362 * Set modules and sanitize them. 363 * 364 * @return adminModulesList self instance 365 */ 233 366 public function setModules($modules) 234 367 { … … 236 369 if (!empty($modules) && is_array($modules)) { 237 370 foreach($modules as $id => $module) { 238 $this->data[$id] = self:: parseModuleInfo($id, $module);371 $this->data[$id] = self::sanitizeModule($id, $module); 239 372 } 240 373 } … … 242 375 } 243 376 377 /** 378 * Get modules currently set. 379 * 380 * @return Array of modules 381 */ 244 382 public function getModules() 245 383 { … … 247 385 } 248 386 249 public static function parseModuleInfo($id, $module) 387 /** 388 * Sanitize a module. 389 * 390 * This clean infos of a module by adding default keys 391 * and clean some of them, sanitize module can safely 392 * be used in lists. 393 * 394 * @return Array of the module informations 395 */ 396 public static function sanitizeModule($id, $module) 250 397 { 251 398 $label = empty($module['label']) ? $id : $module['label']; … … 285 432 } 286 433 287 public static function isDistributedModule($module) 434 /** 435 * Check if a module is part of the distribution. 436 * 437 * @param string $id Module root directory 438 * @return True if module is part of the distribution 439 */ 440 public static function isDistributedModule($id) 288 441 { 289 442 $distributed_modules = self::$distributed_modules; 290 443 291 return is_array($distributed_modules) && in_array($module, $distributed_modules); 292 } 293 444 return is_array($distributed_modules) && in_array($id, $distributed_modules); 445 } 446 447 /** 448 * Sort modules list by specific field. 449 * 450 * @param string $module Array of modules 451 * @param string $field Field to sort from 452 * @param bollean $asc Sort asc if true, else decs 453 * @return Array of sorted modules 454 */ 294 455 public static function sortModules($modules, $field, $asc=true) 295 456 { … … 303 464 } 304 465 305 public function displayModulesList($cols=array('name', 'config', 'version', 'desc'), $actions=array(), $nav_limit=false) 466 /** 467 * Display list of modules. 468 * 469 * @param array $cols List of colones (module field) to display 470 * @param array $actions List of predefined actions to show on form 471 * @param boolean $nav_limit Limit list to previously selected index 472 * @return adminModulesList self instance 473 */ 474 public function displayModules($cols=array('name', 'version', 'desc'), $actions=array(), $nav_limit=false) 306 475 { 307 476 echo … … 315 484 } 316 485 317 if (in_array('score', $cols) && $this->getSearch Query() !== null && defined('DC_DEBUG') && DC_DEBUG) {486 if (in_array('score', $cols) && $this->getSearch() !== null && defined('DC_DEBUG') && DC_DEBUG) { 318 487 echo 319 488 '<th class="nowrap">'.__('Score').'</th>'; … … 347 516 '</tr>'; 348 517 349 $sort_field = $this->getSort Query();518 $sort_field = $this->getSort(); 350 519 351 520 # Sort modules by $sort_field (default sname) 352 $modules = $this->getSearch Query() === null ?521 $modules = $this->getSearch() === null ? 353 522 self::sortModules($this->data, $sort_field, $this->sort_asc) : 354 523 $this->data; … … 358 527 { 359 528 # Show only requested modules 360 if ($nav_limit && $this->getSearch Query() === null) {529 if ($nav_limit && $this->getSearch() === null) { 361 530 $char = substr($module[$sort_field], 0, 1); 362 531 if (!in_array($char, $this->nav_list)) { 363 532 $char = $this->nav_special; 364 533 } 365 if ($this->get NavQuery() != $char) {534 if ($this->getIndex() != $char) { 366 535 continue; 367 536 } … … 384 553 echo 385 554 '<td class="module-name nowrap" scope="row">'.($config ? 386 '<a href="'.$this->get PageURL('module='.$id.'&conf=1').'" title"'.sprintf(__('Configure module "%s"'), html::escapeHTML($module['name'])).'">'.html::escapeHTML($module['name']).'</a>' :555 '<a href="'.$this->getURL('module='.$id.'&conf=1').'" title"'.sprintf(__('Configure module "%s"'), html::escapeHTML($module['name'])).'">'.html::escapeHTML($module['name']).'</a>' : 387 556 html::escapeHTML($module['name']) 388 557 ).'</td>'; 389 558 390 559 # Display score only for debug purpose 391 if (in_array('score', $cols) && $this->getSearch Query() !== null && defined('DC_DEBUG') && DC_DEBUG) {560 if (in_array('score', $cols) && $this->getSearch() !== null && defined('DC_DEBUG') && DC_DEBUG) { 392 561 echo 393 562 '<td class="module-version nowrap count"><span class="debug">'.$module['score'].'</span></td>'; … … 424 593 '<td class="module-actions nowrap">'. 425 594 426 '<form action="'.$this->get PageURL().'" method="post">'.595 '<form action="'.$this->getURL().'" method="post">'. 427 596 '<div>'. 428 597 $this->core->formNonce(). 429 598 form::hidden(array('module'), html::escapeHTML($id)). 430 form::hidden(array('tab'), $this->page_tab).431 599 432 600 implode(' ', $buttons). … … 446 614 '</table></div>'; 447 615 448 if(!$count && $this->getSearch Query() === null) {616 if(!$count && $this->getSearch() === null) { 449 617 echo 450 618 '<p class="message">'.__('No module matches your search.').'</p>'; 451 619 } 452 } 453 620 621 return $this; 622 } 623 624 /** 625 * Get action buttons to add to modules list. 626 * 627 * @param string $id Module ID 628 * @param array $module Module info 629 * @param array $actions Actions keys 630 * @return Array of actions buttons 631 */ 454 632 protected function getActions($id, $module, $actions) 455 633 { … … 473 651 474 652 # Delete 475 case 'delete': if ($this->is PathDeletable($module['root'])) {653 case 'delete': if ($this->isDeletablePath($module['root'])) { 476 654 $submits[] = 477 655 '<input type="submit" class="delete" name="delete" value="'.__('Delete').'" />'; … … 495 673 } 496 674 675 /** 676 * Execute POST action. 677 * 678 * @note Set a notice on success through dcPage::addSuccessNotice 679 * @throw Exception Module not find or command failed 680 * @param string $prefix Prefix used on behaviors 681 * @return Null 682 */ 497 683 public function doActions($prefix) 498 684 { 499 685 if (empty($_POST) || !empty($_REQUEST['conf']) 500 || !$this->core->auth->isSuperAdmin() || !$this->is PathWritable()) {686 || !$this->core->auth->isSuperAdmin() || !$this->isWritablePath()) { 501 687 return null; 502 688 } … … 523 709 524 710 dcPage::addSuccessNotice(__('Module has been successfully activated.')); 525 http::redirect($this->get PageURL());711 http::redirect($this->getURL()); 526 712 } 527 713 … … 548 734 549 735 dcPage::addSuccessNotice(__('Module has been successfully deactivated.')); 550 http::redirect($this->get PageURL());736 http::redirect($this->getURL()); 551 737 } 552 738 … … 563 749 $module['id'] = $id; 564 750 565 if (!$this->is PathDeletable($module['root'])) {751 if (!$this->isDeletablePath($module['root'])) { 566 752 throw new Exception(__("You don't have permissions to delete this module.")); 567 753 } … … 580 766 581 767 dcPage::addSuccessNotice(__('Module has been successfully deleted.')); 582 http::redirect($this->get PageURL());768 http::redirect($this->getURL()); 583 769 } 584 770 … … 607 793 __('Module has been successfully installed.') 608 794 ); 609 http::redirect($this->get PageURL());795 http::redirect($this->getURL()); 610 796 } 611 797 … … 623 809 $module = $updated[$id]; 624 810 $module['id'] = $id; 625 811 626 812 if (!self::$allow_multi_install) { 627 813 $dest = $module['root'].'/../'.basename($module['file']); … … 643 829 644 830 dcPage::addSuccessNotice(__('Module has been successfully updated.')); 645 http::redirect($this->get PageURL());831 http::redirect($this->getURL()); 646 832 } 647 833 } … … 680 866 __('Module has been successfully installed.') 681 867 ); 682 http::redirect($this->get PageURL().'#'.$prefix);868 http::redirect($this->getURL().'#'.$prefix); 683 869 } 684 870 … … 686 872 } 687 873 874 /** 875 * Display tab for manual installation. 876 * 877 * @return adminModulesList self instance 878 */ 688 879 public function displayManualForm() 689 880 { 690 if (!$this->core->auth->isSuperAdmin() || !$this->is PathWritable()) {881 if (!$this->core->auth->isSuperAdmin() || !$this->isWritablePath()) { 691 882 return null; 692 883 } … … 694 885 # 'Upload module' form 695 886 echo 696 '<form method="post" action="'.$this->get PageURL().'" id="uploadpkg" enctype="multipart/form-data" class="fieldset">'.887 '<form method="post" action="'.$this->getURL().'" id="uploadpkg" enctype="multipart/form-data" class="fieldset">'. 697 888 '<h4>'.__('Upload a zip file').'</h4>'. 698 889 '<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Zip file path:').'</label> '. … … 701 892 form::password(array('your_pwd','your_pwd1'),20,255).'</p>'. 702 893 '<p><input type="submit" name="upload_pkg" value="'.__('Upload').'" />'. 703 form::hidden(array('tab'), $this->getPageTab()).704 894 $this->core->formNonce().'</p>'. 705 895 '</form>'; 706 896 707 897 # 'Fetch module' form 708 898 echo 709 '<form method="post" action="'.$this->get PageURL().'" id="fetchpkg" class="fieldset">'.899 '<form method="post" action="'.$this->getURL().'" id="fetchpkg" class="fieldset">'. 710 900 '<h4>'.__('Download a zip file').'</h4>'. 711 901 '<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Zip file URL:').'</label> '. … … 714 904 form::password(array('your_pwd','your_pwd2'),20,255).'</p>'. 715 905 '<p><input type="submit" name="fetch_pkg" value="'.__('Download').'" />'. 716 form::hidden(array('tab'), $this->getPageTab()).717 906 $this->core->formNonce().'</p>'. 718 907 '</form>'; 719 } 720 721 /** 908 909 return $this; 910 } 911 //@} 912 913 /// @name Module configuration methods 914 //@{ 915 /** 916 * Prepare module configuration. 722 917 * 723 918 * We need to get configuration content in three steps 724 919 * and out of this class to keep backward compatibility. 725 920 * 726 * if ($xxx->setConfiguration File()) {727 * include $xxx-> getConfigurationFile();921 * if ($xxx->setConfiguration()) { 922 * include $xxx->includeConfiguration(); 728 923 * } 729 * $xxx-> setConfigurationContent();924 * $xxx->getConfiguration(); 730 925 * ... [put here page headers and other stuff] 731 * $xxx->getConfigurationContent(); 732 * 733 */ 734 public function setConfigurationFile($id=null) 926 * $xxx->displayConfiguration(); 927 * 928 * @param string $id Module to work on or it gather through REQUEST 929 * @return True if config set 930 */ 931 public function setConfiguration($id=null) 735 932 { 736 933 if (empty($_REQUEST['conf']) || empty($_REQUEST['module']) && !$id) { … … 748 945 749 946 $module = $this->modules->getModules($id); 750 $module = self:: parseModuleInfo($id, $module);947 $module = self::sanitizeModule($id, $module); 751 948 $file = path::real($module['root'].'/_config.php'); 752 949 … … 767 964 } 768 965 769 public function getConfigurationFile() 966 /** 967 * Get path of module configuration file. 968 * 969 * @note Required previously set file info 970 * @return Full path of config file or null 971 */ 972 public function includeConfiguration() 770 973 { 771 974 if (!$this->config_file) { … … 778 981 } 779 982 780 public function setConfigurationContent() 983 /** 984 * Gather module configuration file content. 985 * 986 * @note Required previously file inclusion 987 * @return True if content has been captured 988 */ 989 public function getConfiguration() 781 990 { 782 991 if ($this->config_file) { … … 789 998 } 790 999 791 public function getConfigurationContent() 792 { 793 if (!$this->config_file) { 794 return null; 795 } 796 797 if (!$this->config_module['standalone_config']) { 798 echo 799 '<form id="module_config" action="'.$this->getPageURL('conf=1').'" method="post" enctype="multipart/form-data">'. 800 '<h3>'.sprintf(__('Configure plugin "%s"'), html::escapeHTML($this->config_module['name'])).'</h3>'. 801 '<p><a class="back" href="'.$this->getPageURL().'#plugins">'.__('Back').'</a></p>'; 802 } 803 804 echo $this->config_content; 805 806 if (!$this->config_module['standalone_config']) { 807 echo 808 '<p class="clear"><input type="submit" name="save" value="'.__('Save').'" />'. 809 form::hidden('module', $this->config_module['id']). 810 $this->core->formNonce().'</p>'. 811 '</form>'; 812 } 813 814 return true; 815 } 816 1000 /** 1001 * Display module configuration form. 1002 * 1003 * @note Required previously gathered content 1004 * @return adminModulesList self instance 1005 */ 1006 public function displayConfiguration() 1007 { 1008 if ($this->config_file) { 1009 1010 if (!$this->config_module['standalone_config']) { 1011 echo 1012 '<form id="module_config" action="'.$this->getURL('conf=1').'" method="post" enctype="multipart/form-data">'. 1013 '<h3>'.sprintf(__('Configure plugin "%s"'), html::escapeHTML($this->config_module['name'])).'</h3>'. 1014 '<p><a class="back" href="'.$this->getURL().'#plugins">'.__('Back').'</a></p>'; 1015 } 1016 1017 echo $this->config_content; 1018 1019 if (!$this->config_module['standalone_config']) { 1020 echo 1021 '<p class="clear"><input type="submit" name="save" value="'.__('Save').'" />'. 1022 form::hidden('module', $this->config_module['id']). 1023 $this->core->formNonce().'</p>'. 1024 '</form>'; 1025 } 1026 } 1027 1028 return $this; 1029 } 1030 //@} 1031 1032 /** 1033 * Helper to sanitize a string. 1034 * 1035 * Used for search or id. 1036 * 1037 * @param string $str String to sanitize 1038 * @return Sanitized string 1039 */ 817 1040 public static function sanitizeString($str) 818 1041 { … … 821 1044 } 822 1045 1046 /** 1047 * @ingroup DC_CORE 1048 * @brief Helper to manage list of themes. 1049 * @since 2.6 1050 */ 823 1051 class adminThemesList extends adminModulesList 824 1052 { 825 1053 protected $page_url = 'blog_theme.php'; 826 1054 827 public function displayModules List($cols=array('name', 'config', 'version', 'desc'), $actions=array(), $nav_limit=false)1055 public function displayModules($cols=array('name', 'config', 'version', 'desc'), $actions=array(), $nav_limit=false) 828 1056 { 829 1057 echo 830 1058 '<div id="'.html::escapeHTML($this->list_id).'" class="modules'.(in_array('expander', $cols) ? ' expandable' : '').' one-box">'; 831 1059 832 $sort_field = $this->getSort Query();1060 $sort_field = $this->getSort(); 833 1061 834 1062 # Sort modules by id 835 $modules = $this->getSearch Query() === null ?1063 $modules = $this->getSearch() === null ? 836 1064 self::sortModules($this->data, $sort_field, $this->sort_asc) : 837 1065 $this->data; … … 842 1070 { 843 1071 # Show only requested modules 844 if ($nav_limit && $this->getSearch Query() === null) {1072 if ($nav_limit && $this->getSearch() === null) { 845 1073 $char = substr($module[$sort_field], 0, 1); 846 1074 if (!in_array($char, $this->nav_list)) { 847 1075 $char = $this->nav_special; 848 1076 } 849 if ($this->get NavQuery() != $char) {1077 if ($this->getIndex() != $char) { 850 1078 continue; 851 1079 } 852 1080 } 853 1081 854 $current = $this->core->blog->settings->system->theme == $id ;1082 $current = $this->core->blog->settings->system->theme == $id && $this->modules->moduleExists($id); 855 1083 $distrib = self::isDistributedModule($id) ? ' dc-box' : ''; 856 857 $theme_url = preg_match('#^http(s)?://#', $this->core->blog->settings->system->themes_url) ?858 http::concatURL($this->core->blog->settings->system->themes_url, '/'.$id) :859 http::concatURL($this->core->blog->url, $this->core->blog->settings->system->themes_url.'/'.$id);860 861 $has_conf = file_exists(path::real($this->core->blog->themes_path.'/'.$id).'/_config.php');862 $has_css = file_exists(path::real($this->core->blog->themes_path.'/'.$id).'/style.css');863 $parent = $module['parent'];864 $has_parent = !empty($module['parent']);865 if ($has_parent) {866 $is_parent_present = $this->modules->moduleExists($parent);867 }868 1084 869 1085 $line = … … 876 1092 877 1093 # Display score only for debug purpose 878 if (in_array('score', $cols) && $this->getSearch Query() !== null && defined('DC_DEBUG') && DC_DEBUG) {1094 if (in_array('score', $cols) && $this->getSearch() !== null && defined('DC_DEBUG') && DC_DEBUG) { 879 1095 $line .= 880 1096 '<p class="module-score debug">'.sprintf(__('Score: %s'), $module['score']).'</p>'; … … 888 1104 # Screenshot from installed module 889 1105 elseif (file_exists($this->core->blog->themes_path.'/'.$id.'/screenshot.jpg')) { 890 $sshot = $this->get PageURL('shot='.rawurlencode($id));1106 $sshot = $this->getURL('shot='.rawurlencode($id)); 891 1107 } 892 1108 # Default screenshot … … 924 1140 } 925 1141 926 if (in_array('parent', $cols) && $has_parent) {927 if ($ is_parent_present) {1142 if (in_array('parent', $cols) && !empty($module['parent'])) { 1143 if ($this->modules->moduleExists($module['parent'])) { 928 1144 $line .= 929 '<span class="module-parent-ok">'.sprintf(__('(built on "%s")'),html::escapeHTML($ parent)).'</span> ';1145 '<span class="module-parent-ok">'.sprintf(__('(built on "%s")'),html::escapeHTML($module['parent'])).'</span> '; 930 1146 } 931 1147 else { 932 1148 $line .= 933 '<span class="module-parent-missing">'.sprintf(__('(requires "%s")'),html::escapeHTML($ parent)).'</span> ';1149 '<span class="module-parent-missing">'.sprintf(__('(requires "%s")'),html::escapeHTML($module['parent'])).'</span> '; 934 1150 } 935 1151 } … … 962 1178 '<div class="module-actions toggle-bloc">'; 963 1179 964 # _GET actions965 966 if ($current && $has_css) {967 $line .=968 '<p><a href="'.$theme_url.'/style.css">'.__('View stylesheet').'</a></p>';969 }970 if ($current && $has_conf) {971 $line .=972 '<p><a href="'.$this->getPageURL('module='.$id.'&conf=1', false).'" class="button">'.__('Configure theme').'</a></p>';973 }974 975 1180 # Plugins actions 976 1181 if ($current) { 1182 1183 # _GET actions 1184 if (file_exists(path::real($this->core->blog->themes_path.'/'.$id).'/style.css')) { 1185 $theme_url = preg_match('#^http(s)?://#', $this->core->blog->settings->system->themes_url) ? 1186 http::concatURL($this->core->blog->settings->system->themes_url, '/'.$id) : 1187 http::concatURL($this->core->blog->url, $this->core->blog->settings->system->themes_url.'/'.$id); 1188 $line .= 1189 '<p><a href="'.$theme_url.'/style.css">'.__('View stylesheet').'</a></p>'; 1190 } 1191 1192 if (file_exists(path::real($this->core->blog->themes_path.'/'.$id).'/_config.php')) { 1193 $line .= 1194 '<p><a href="'.$this->getURL('module='.$id.'&conf=1', false).'" class="button">'.__('Configure theme').'</a></p>'; 1195 } 1196 977 1197 # --BEHAVIOR-- adminCurrentThemeDetails 978 1198 $line .= … … 983 1203 if (!empty($actions)) { 984 1204 $line .= 985 '<form action="'.$this->get PageURL().'" method="post">'.1205 '<form action="'.$this->getURL().'" method="post">'. 986 1206 '<div>'. 987 1207 $this->core->formNonce(). 988 1208 form::hidden(array('module'), html::escapeHTML($id)). 989 form::hidden(array('tab'), $this->page_tab).990 1209 991 1210 implode(' ', $this->getActions($id, $module, $actions)). … … 1009 1228 '</div>'; 1010 1229 1011 if(!$count && $this->getSearch Query() === null) {1230 if(!$count && $this->getSearch() === null) { 1012 1231 echo 1013 1232 '<p class="message">'.__('No module matches your search.').'</p>'; … … 1024 1243 # Select theme to use on curent blog 1025 1244 if (in_array('select', $actions) && $this->path_writable) { 1026 $submits[] = '<input type="submit" name="select" value="'.__('Choose').'" />'; 1245 $submits[] = 1246 '<input type="submit" name="select" value="'.__('Use this one').'" />'; 1027 1247 } 1028 1248 } … … 1036 1256 public function doActions($prefix) 1037 1257 { 1038 if (!empty($_POST) && empty($_REQUEST['conf']) && $this->is PathWritable()) {1258 if (!empty($_POST) && empty($_REQUEST['conf']) && $this->isWritablePath()) { 1039 1259 1040 1260 # Select theme to use on curent blog … … 1051 1271 1052 1272 dcPage::addSuccessNotice(__('Module has been successfully selected.')); 1053 http::redirect($this->get PageURL().'#themes');1273 http::redirect($this->getURL().'#themes'); 1054 1274 } 1055 1275 } -
plugins/maintenance/_config.php
r2215 r2227 52 52 ); 53 53 } 54 55 http::redirect($list->getPageURL('module=maintenance&conf=1&done=1')); 54 55 dcPage::addSuccessNotice(__('Maintenance plugin has been successfully configured.')); 56 http::redirect($list->getURL('module=maintenance&conf=1')); 56 57 } 57 58 catch(Exception $e) { … … 60 61 } 61 62 62 63 '<p>'.__('Setup alert for maintenance task.').'</p>'.63 echo 64 '<p>'.__('Set up reminders for maintenance tasks.').'</p>'. 64 65 65 66 67 68 66 '<h4 class="pretty-title">'.__('Activation').'</h4>'. 67 '<p><label for="settings_plugin_message" class="classic">'. 68 form::checkbox('settings_plugin_message', 1, $core->blog->settings->maintenance->plugin_message). 69 __('Display alert messages on late tasks').'</label></p>'. 69 70 70 71 72 73 71 '<p class="info">'.sprintf( 72 __('You can place list of late tasks on your %s.'), 73 '<a href="preferences.php#user-favorites">'.__('Dashboard').'</a>' 74 ).'</p>'. 74 75 75 76 '<h4 class="pretty-title vertical-separator">'.__('Frequency').'</h4>'. 76 77 77 78 79 78 '<p class="vertical-separator">'.form::radio(array('settings_recall_type', 'settings_recall_all'), 'all').' '. 79 '<label class="classic" for="settings_recall_all">'. 80 '<strong>'.__('Use one recall time for all tasks').'</strong></label>'. 80 81 81 '<p class="field wide vertical-separator"><label for="settings_recall_time">'.__('Recall time for all tasks:').'</label>'. 82 form::combo('settings_recall_time', $combo_ts, 'seperate', 'recall-for-all'). 82 '<p class="field wide vertical-separator"><label for="settings_recall_time">'.__('Recall time for all tasks:').'</label>'. 83 form::combo('settings_recall_time', $combo_ts, 'seperate', 'recall-for-all'). 84 '</p>'. 85 86 '<p class="vertical-separator">'.form::radio(array('settings_recall_type', 'settings_recall_separate'), 'separate', 1).' '. 87 '<label class="classic" for="settings_recall_separate">'. 88 '<strong>'.__('Use one recall time per task').'</strong></label>'; 89 90 foreach($tasks as $t) 91 { 92 echo 93 '<div class="two-boxes">'. 94 95 '<p class="field wide"><label for="settings_ts_'.$t->id().'">'.$t->task().'</label>'. 96 form::combo('settings_ts_'.$t->id(), $combo_ts, $t->ts(), 'recall-per-task'). 83 97 '</p>'. 84 98 85 '<p class="vertical-separator">'.form::radio(array('settings_recall_type', 'settings_recall_separate'), 'separate', 1).' '. 86 '<label class="classic" for="settings_recall_separate">'. 87 '<strong>'.__('Use one recall time per task').'</strong></label>'; 88 89 foreach($tasks as $t) 90 { 91 echo 92 '<div class="two-boxes">'. 93 94 '<p class="field wide"><label for="settings_ts_'.$t->id().'">'.$t->task().'</label>'. 95 form::combo('settings_ts_'.$t->id(), $combo_ts, $t->ts(), 'recall-per-task'). 96 '</p>'. 97 98 '</div>'; 99 } 99 '</div>'; 100 }
Note: See TracChangeset
for help on using the changeset viewer.