Changeset 2227:bfa7b3467627 for admin/plugins.php
- Timestamp:
- 10/03/13 13:47:05 (12 years ago)
- Branch:
- dcRepo
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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>';
Note: See TracChangeset
for help on using the changeset viewer.