Ejemplo n.º 1
0
<?php

# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('admin');
# -- Page helper --
$list = new adminModulesList($core->plugins, DC_PLUGINS_ROOT, $core->blog->settings->system->store_plugin_url);
adminModulesList::$allow_multi_install = (bool) DC_ALLOW_MULTI_MODULES;
adminModulesList::$distributed_modules = explode(',', DC_DISTRIB_PLUGINS);
if ($core->plugins->disableDepModules($core->adminurl->get('admin.plugins', array()))) {
    exit;
}
# -- Display module configuration page --
if ($list->setConfiguration()) {
    # Get content before page headers
    include $list->includeConfiguration();
    # Gather content
    $list->getConfiguration();
    # Display page
    dcPage::open(__('Plugins management'), $core->callBehavior('pluginsToolsHeaders', $core, true), dcPage::breadcrumb(array(html::escapeHTML($core->blog->name) => '', __('Plugins management') => $list->getURL('', false), '<span class="page-title">' . __('Plugin configuration') . '</span>' => '')));
    # Display previously gathered content
    $list->displayConfiguration();
Ejemplo n.º 2
0
 public static function getModuleById($core, $get, $post)
 {
     if (empty($get['id'])) {
         throw new Exception('No module ID');
     }
     if (empty($get['list'])) {
         throw new Exception('No list ID');
     }
     $id = $get['id'];
     $list = $get['list'];
     $module = array();
     if ($list == 'plugin-activate') {
         $modules = $core->plugins->getModules();
         if (empty($modules) || !isset($modules[$id])) {
             throw new Exception('Unknow module ID');
         }
         $module = $modules[$id];
     } elseif ($list == 'plugin-new') {
         $store = new dcStore($core->plugins, $core->blog->settings->system->store_plugin_url);
         $store->check();
         $modules = $store->get();
         if (empty($modules) || !isset($modules[$id])) {
             throw new Exception('Unknow module ID');
         }
         $module = $modules[$id];
     } else {
         // behavior not implemented yet
     }
     if (empty($module)) {
         throw new Exception('Unknow module ID');
     }
     $module = adminModulesList::sanitizeModule($id, $module);
     $rsp = new xmlTag('module');
     $rsp->id = $id;
     foreach ($module as $k => $v) {
         $rsp->{$k}((string) $v);
     }
     return $rsp;
 }
Ejemplo n.º 3
0
 protected function getActions($id, $module, $actions)
 {
     $submits = array();
     $this->core->blog->settings->addNamespace('system');
     if ($id != $this->core->blog->settings->system->theme) {
         # Select theme to use on curent blog
         if (in_array('select', $actions) && $this->path_writable) {
             $submits[] = '<input type="submit" name="select[' . html::escapeHTML($id) . ']" value="' . __('Use this one') . '" />';
         }
     }
     return array_merge($submits, parent::getActions($id, $module, $actions));
 }