コード例 #1
0
ファイル: class.dc.plugins.php プロジェクト: nikrou/dotclear
 /**
 This method registers a plugin in modules list. You should use this to
 register a new plugin.
 
 <var>$priority</var> is an integer. Modules are sorted by priority and name.
 Lowest priority comes first. This property is currently ignored when dealing
 with themes.
 
 @param	name			<b>string</b>		Module name
 @param	desc			<b>string</b>		Module description
 @param	author		<b>string</b>		Module author name
 @param	version		<b>string</b>		Module version
 @param	properties	<b>array</b>		extra properties (currently available keys : permissions, priority, standalone_config, type)
 */
 public function registerModule($name, $desc, $author, $version, $properties = array())
 {
     # Fallback to legacy registerModule parameters
     if (!is_array($properties)) {
         $args = func_get_args();
         $properties = array();
         if (isset($args[4])) {
             $properties['permissions'] = $args[4];
         }
         if (isset($args[5])) {
             $properties['priority'] = (int) $args[5];
         }
     }
     parent::registerModule($name, $desc, $author, $version, $properties);
 }
コード例 #2
0
ファイル: class.dc.themes.php プロジェクト: nikrou/dotclear
 /**
 This method registers a theme in modules list. You should use this to
 register a new theme.
 
 <var>$parent</var> is a optional value to indicate them inheritance.
 If <var>$parent</var> is null / not set, we simply fall back to
 the standard behavior, by using 'default'.
 
 <var>$priority</var> is an integer. Modules are sorted by priority and name.
 Lowest priority comes first. This property is currently ignored when dealing
 with themes.
 
 @param	name			<b>string</b>		Module name
 @param	desc			<b>string</b>		Module description
 @param	author		<b>string</b>		Module author name
 @param	version		<b>string</b>		Module version
 @param	properties	<b>array</b>		extra properties
 (currently available keys : parent, priority, standalone_config, type, tplset)
 */
 public function registerModule($name, $desc, $author, $version, $properties = array())
 {
     # Fallback to legacy registerModule parameters
     if (!is_array($properties)) {
         $args = func_get_args();
         $properties = array();
         if (isset($args[4])) {
             $properties['parent'] = $args[4];
         }
         if (isset($args[5])) {
             $properties['priority'] = (int) $args[5];
         }
     }
     # Themes specifics properties
     $properties = array_merge(array('parent' => null, 'tplset' => DC_DEFAULT_TPLSET), $properties, array('permissions' => 'admin'));
     parent::registerModule($name, $desc, $author, $version, $properties);
 }
コード例 #3
0
ファイル: class.dc.modules.php プロジェクト: nikrou/dotclear
 protected function loadModuleFile($________)
 {
     if (!file_exists($________)) {
         return;
     }
     self::$_k = array_keys($GLOBALS);
     foreach (self::$_k as self::$_n) {
         if (!in_array(self::$_n, self::$superglobals)) {
             global ${self::$_n};
         }
     }
     return require $________;
 }
コード例 #4
0
ファイル: class.dc.store.php プロジェクト: nikrou/dotclear
 /**
  * Install a previously downloaded module.
  *
  * @param	string	$path	Module package URL
  * @param	string	$path	Path to module package
  * @return	integer		1 = installed, 2 = update
  */
 public function install($path)
 {
     return dcModules::installPackage($path, $this->modules);
 }
コード例 #5
0
ファイル: blog_theme.php プロジェクト: HackerMajor/root
        } else {
            $url = urldecode($_POST['pkg_url']);
            $dest = $core->blog->themes_path . '/' . basename($url);
            try {
                $client = netHttp::initClient($url, $path);
                $client->setUserAgent('Dotclear - http://www.dotclear.org/');
                $client->useGzip(false);
                $client->setPersistReferers(false);
                $client->setOutput($dest);
                $client->get($path);
            } catch (Exception $e) {
                throw new Exception(__('An error occurred while downloading the file.'));
            }
            unset($client);
        }
        $ret_code = dcModules::installPackage($dest, $core->themes);
        http::redirect('blog_theme.php?added=' . $ret_code);
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
        $default_tab = 'add-theme';
    }
}
$theme_conf_mode = false;
if (!empty($_REQUEST['conf'])) {
    $theme_conf_file = path::real($core->blog->themes_path . '/' . $core->blog->settings->theme) . '/_config.php';
    if (file_exists($theme_conf_file)) {
        $theme_conf_mode = true;
    }
}
function display_theme_details($id, $details, $current)
{