예제 #1
0
 public function display()
 {
     $template = new Template();
     $template->load("plugins");
     $plugins = new PluginList();
     $plugins->loadAll();
     foreach ($plugins->plugins as $plugin) {
         $index = $template->add_loop_item("PLUGINS");
         if (isset($_GET['activate']) && $_GET['activate'] == $plugin->path) {
             $plugin->activate();
         } elseif (isset($_GET['deactivate']) && $_GET['deactivate'] == $plugin->path) {
             $plugin->deactivate();
         }
         $template->assign_loop_var("PLUGINS", $index, "NAME", htmlentities($plugin->name));
         $template->assign_loop_var("PLUGINS", $index, "PATH", htmlentities($plugin->path));
         $template->assign_loop_var("PLUGINS", $index, "DESCRIPTION", htmlentities($plugin->getDescription()));
         $template->assign_loop_var("PLUGINS", $index, "VERSION", $plugin->version);
         $template->assign_loop_var("PLUGINS", $index, "AUTHORLINK", $plugin->authorLink);
         $template->assign_loop_var("PLUGINS", $index, "AUTHORNAME", htmlentities($plugin->authorName));
         $template->assign_loop_var("PLUGINS", $index, "LICENSE", htmlentities($plugin->license));
         $template->assign_loop_var("PLUGINS", $index, "LICENSEURL", htmlentities($plugin->licenseUrl));
         if ($plugin->isActivated()) {
             $myurl = UrlRewriting::GetUrlByAlias($this->page->alias, "deactivate=" . urlencode($plugin->path));
             $disable = Language::DirectTranslateHtml("DISABLE");
             $template->assign_loop_var("PLUGINS", $index, "ACTIVATIONLINK", "<a href=\"" . $myurl . "\">" . $disable . "</a>");
         } else {
             $myurl = UrlRewriting::GetUrlByAlias($this->page->alias, "activate=" . urlencode($plugin->path));
             $enable = Language::DirectTranslateHtml("ENABLE");
             $template->assign_loop_var("PLUGINS", $index, "ACTIVATIONLINK", "<a href=\"" . $myurl . "\">" . $enable . "</a>");
         }
     }
     $template->assign_var("HOST", Settings::getValue("host"));
     $template->assign_var("APIKEY", Settings::getValue("apikey"));
     $template->output();
 }
예제 #2
0
 public static function GetInfo($plugin_name)
 {
     $list = new PluginList();
     $list->AddInfo($plugin_name);
     if (isset($list->plugins[0])) {
         return $list->plugins[0];
     }
     return null;
 }
예제 #3
0
 public function display()
 {
     $plugins = new PluginList();
     $plugins->loadAll();
     foreach ($plugins->plugins as $plugin) {
         if ($plugin->path == $_GET['plugin']) {
             echo "<h2>" . $plugin->name . "</h2>";
             include Settings::getInstance()->get("root") . "system/plugins/" . $plugin->path . "/" . $plugin->configurationFile;
         }
     }
 }
예제 #4
0
    public function display()
    {
        $settings = new SettingsForm();
        $settings->role = 3;
        $settings->url = UrlRewriting::GetUrlByAlias($_GET['include']);
        if (isset($_GET['areatype'])) {
            $settings->areaType = $_GET['areatype'];
        }
        if (isset($_GET['area'])) {
            $settings->area = $_GET['area'];
        }
        if (isset($_GET['role'])) {
            $settings->role = $_GET['role'];
        }
        $settings->display();
        ?>
        <div style="margin-left:500px;">
        <h2>Skins</h2>
      <?php 
        $skins = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}skins WHERE LOWER(name) IN (SELECT DISTINCT name FROM {'dbprefix'}settings WHERE areaType = 'skins' AND area = {'dbprefix'}skins.name)");
        if ($skins) {
            foreach ($skins as $skin) {
                $url = UrlRewriting::GetUrlByAlias("admin/settings", "areatype=skins&area=" . urlencode($skin->name));
                echo "<a href=\"" . $url . "\">" . $skin->name . "</a><br />";
            }
        }
        ?>
        <h2>Plugins</h2>
      <?php 
        $plugins = new PluginList();
        $plugins->loadAll();
        foreach ($plugins->plugins as $plugin) {
            if ($plugin->configurationFile != '') {
                $url = UrlRewriting::GetUrlByAlias("admin/pluginsettings", "plugin=" . $plugin->path);
                ?>
              <a href="<?php 
                echo $url;
                ?>
"><?php 
                echo $plugin->name;
                ?>
</a><br />
            <?php 
            }
        }
        ?>
        </div>
      <?php 
    }
예제 #5
0
 /**
  * Until we have a general plugin metadata infrastructure, for now
  * we'll just list up the ones we know from the global default
  * plugins list.
  */
 protected function showDefaultPlugins()
 {
     $plugins = array_keys(common_config('plugins', 'default'));
     natsort($plugins);
     if ($plugins) {
         $list = new PluginList($plugins, $this);
         $list->show();
     } else {
         $this->element('p', null, _('All default plugins have been disabled from the ' . 'site\'s configuration file.'));
     }
 }
예제 #6
0
 /**
  * Creates an plugininfo-Object from a plugin name
  * @param string $plugin_name Name of the Plugin
  * @return PluginInfo - null if not found. 
  */
 public static function Get($plugin_name)
 {
     return PluginList::GetInfo($plugin_name);
 }