Ejemplo n.º 1
0
 function loadTasks()
 {
     Configure::write('debug', 0);
     //設置されているプラグインを取得
     $this->installed_plugins = getPlugins();
     foreach ($this->installed_plugins as $plugin) {
         $taskPath = APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . 'shells' . DS;
         $installerPath = APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . 'shells' . DS . 'tasks' . DS . "install_{$plugin}.php";
         if (file_exists($installerPath)) {
             $this->Dispatch->shellPaths[] = $taskPath;
             $this->tasks[] = $this->getPluginInstallerTaskName($plugin);
         }
     }
     parent::loadTasks();
 }
Ejemplo n.º 2
0
 function pluginCss()
 {
     $view =& ClassRegistry::getObject('view');
     $htmlHelper = $view->loaded['html'];
     $return = '';
     $plugins = getPlugins();
     foreach ($plugins as $plugin) {
         $pluginDir = APP . 'plugins' . DS . $plugin;
         $cssPath = APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . 'css' . DS . 'style.css';
         if (is_dir($pluginDir) && file_exists($cssPath)) {
             $url = $htmlHelper->base . '/cssLoader/' . $plugin;
             $return .= '<link rel="stylesheet" type="text/css" href="' . $url . '" />' . "\n";
         }
     }
     return $return;
 }
Ejemplo n.º 3
0
 function _loadCommonValues()
 {
     //設定の読み込み
     $this->settings = $this->Setting->getValues();
     if ($this->settings['site_name']) {
         $this->pageTitle = $this->settings['site_name'];
     }
     //ページの取得(メニュー用)
     $this->set('menu', $this->Page->generateMenu());
     //全ビューで使用するView変数
     $this->set('Settings', $this->settings);
     //表示するメッセージがあった場合
     if ($this->Session->check('message')) {
         $this->set('message', $this->Session->read('message'));
         $this->Session->delete('message');
     }
     //管理画面関連
     $this->admin_num_rows = Configure::read('admin_num_rows');
     //共通にセットする変数
     $this->set('plugin_name', $this->plugin_name);
     //プラグインの読み込み
     if (preg_match("/^" . Configure::read('Routing.admin') . '/', $this->action)) {
         $admin_additional_menu = array();
         $plugins = getPlugins();
         foreach ($plugins as $plugin) {
             $pluginDir = APP . 'plugins' . DS . $plugin;
             $load_string = Inflector::classify($plugin) . '.' . Inflector::classify($plugin . '_app_controller');
             if (is_dir($pluginDir) && App::import($load_string)) {
                 $class_name = Inflector::classify($plugin . '_app_controller');
                 $tmp_instance = new $class_name();
                 if (isset($tmp_instance->admin_menu)) {
                     foreach ($tmp_instance->admin_menu as $name => $value) {
                         $admin_additional_menu[$name] = $value;
                     }
                 }
             }
         }
         $this->set('additional_menu', $admin_additional_menu);
     }
 }
Ejemplo n.º 4
0
/**
 * Reads (includes) the plugin files
 */
function includePlugins()
{
    $plugins = getPlugins();
    foreach ($plugins as $plugin) {
        include_once $plugin;
    }
    return $plugins;
}
Ejemplo n.º 5
0
/**
* Display the global menu on the right pan, it' dependant of context
*/
function displayMenuTitle()
{
    global $SQLiteManagerAuth, $workDb;
    $linkBase = 'main.php?dbsel=' . $GLOBALS['dbsel'];
    foreach ($GLOBALS['dbItems'] as $Items) {
        if (isset($GLOBALS[strtolower($Items)])) {
            $linkBase .= '&' . strtolower($Items) . '=' . $GLOBALS[strtolower($Items)];
        }
    }
    $out = '';
    $menuItems[] = array('txt' => $GLOBALS['traduct']->get(72), 'url' => $linkBase . '&action=properties');
    if (isset($GLOBALS['table']) && $GLOBALS['table'] != '') {
        if (isset($_REQUEST['currentPage'])) {
            $valCurrent = $_REQUEST['currentPage'];
        } else {
            $valCurrent = $GLOBALS['action'];
        }
        $Context = 'Table';
        //Items : txt:Text, url:Link, enabled, type, hint, confirm, ...
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(73), 'url' => $linkBase . '&action=browseItem');
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(74), 'url' => $linkBase . '&action=sql', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(206), 'url' => $linkBase . '&action=select');
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(75), 'url' => $linkBase . '&action=insertElement&currentPage=' . $valCurrent, 'enabled' => displayCondition('data') && !$workDb->isReadOnly());
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(222), 'url' => $linkBase . '&action=operation', 'enabled' => displayCondition('properties'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(76), 'url' => $linkBase . '&action=export', 'enabled' => displayCondition('export'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(77), 'url' => $linkBase . '&action=empty', 'confirm' => $GLOBALS['traduct']->get(79), 'enabled' => displayCondition('empty') && !$workDb->isReadOnly());
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(15), 'url' => $linkBase . '&action=delete', 'confirm' => $GLOBALS['traduct']->get(80), 'enabled' => displayCondition('del') && !$workDb->isReadOnly());
    } elseif (isset($GLOBALS['view']) && $GLOBALS['view'] != '') {
        $Context = 'View';
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(73), 'url' => $linkBase . '&action=browseItem');
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(74), 'url' => $linkBase . '&action=sql', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(206, 'Select'), 'url' => $linkBase . '&action=select', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(76), 'url' => $linkBase . '&action=export', 'enabled' => displayCondition('export'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(81), 'url' => $linkBase . '&action=add', 'enabled' => displayCondition('properties'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(15), 'url' => $linkBase . '&action=delete', 'confirm' => $GLOBALS['traduct']->get(82), 'enabled' => displayCondition('del') && !$workDb->isReadOnly());
    } elseif (isset($GLOBALS['function']) && $GLOBALS['function'] != '') {
        $Context = 'Function';
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(74), 'url' => $linkBase . '&action=sql', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(76), 'url' => $linkBase . '&action=export', 'enabled' => displayCondition('export'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(81), 'url' => $linkBase . '&action=add', 'enabled' => displayCondition('properties'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(15), 'url' => $linkBase . '&action=delete', 'confirm' => $GLOBALS['traduct']->get(78), 'enabled' => displayCondition('del') && !$workDb->isReadOnly());
    } elseif (isset($GLOBALS['trigger']) && $GLOBALS['trigger'] != '') {
        $Context = 'Trigger';
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(74), 'url' => $linkBase . '&action=sql', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(81), 'url' => $linkBase . '&action=add', 'enabled' => displayCondition('properties'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(15), 'url' => $linkBase . '&action=delete', 'confirm' => $GLOBALS['traduct']->get(83), 'enabled' => displayCondition('del') && !$workDb->isReadOnly());
    } else {
        $Context = 'Database';
        $hintContext = html_entity_decode($GLOBALS['traduct']->get(131), ENT_NOQUOTES, $GLOBALS['charset']);
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(84), 'url' => $linkBase . '&action=options');
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(74), 'url' => $linkBase . '&action=sql', 'enabled' => displayCondition('execSQL'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(76), 'url' => $linkBase . '&action=export', 'enabled' => displayCondition('export'));
        $menuItems[] = array('txt' => $GLOBALS['traduct']->get(15), 'url' => $linkBase . '&action=del', 'confirm' => $GLOBALS['traduct']->get(85), 'enabled' => displayCondition('del'));
    }
    if (!isset($hintContext)) {
        $hintContext = $GLOBALS['itemTranslated'][$Context];
    }
    if (ALLOW_EXEC_PLUGIN) {
        $plugins = getPlugins();
        foreach ($plugins as $plugin_path) {
            $plugin_menu = array();
            include_once $plugin_path . 'plugin.php';
            if (@$plugin_menu[$Context]) {
                $menu = 'plugin_' . $Context . 'Menu';
                $pluginItems = @${$menu};
                if (isset($pluginsItems) && @count($pluginsItems)) {
                    foreach ($pluginsItems as $key => $item) {
                        if (array_key_exists('hint', $item)) {
                            $pluginItems[$key]['hint'] = $hintContext . ' : ' . $plugin_name . ' : ' . $item['hint'];
                        } elseif (isset($item['txt'])) {
                            $pluginItems[$key]['hint'] = $hintContext . ' : ' . $plugin_name . ' : ' . $item['txt'];
                        }
                    }
                }
                if (isset($pluginItems)) {
                    foreach ($pluginItems as $item) {
                        $pluginsItems[] = $item;
                    }
                }
            }
        }
        if (isset($pluginsItems)) {
            $menuItems[] = array('type' => '_cmSplit');
            $menuItems[] = array('type' => 'folder', 'txt' => $GLOBALS['traduct']->get(211, 'Plugins'), 'url' => '#');
            foreach ($pluginsItems as $item) {
                $menuItems[] = $item;
            }
            $menuItems[] = array('type' => 'endfolder');
        }
        $menuItems[] = array('type' => '_cmSplit');
    }
    /* Javascript Menu */
    $out .= "\n\t\t\t" . '<script type="text/javascript">' . "\n\t\t\t\t" . 'var jsMenu = [';
    $icon = '';
    $inFolder = '';
    $target = 'main';
    foreach ($menuItems as $item) {
        $confirm = '';
        $title = isset($item['txt']) ? $item['txt'] : '';
        $icon = array_key_exists('icon', $item) ? '<img class="seq1" src="' . $item['icon'] . '"><img class="seq2" src="' . $item['icon'] . '">' : '&nbsp;';
        $description = array_key_exists('hint', $item) ? $item['hint'] : $hintContext . ' : ' . $title;
        $description = addslashes(html_entity_decode($description, ENT_NOQUOTES, $GLOBALS['charset']));
        if (!array_key_exists('enabled', $item) || @$item['enabled']) {
            $url = isset($item['url']) ? $item['url'] : '';
            if (isset($item['confirm'])) {
                $confirm = addslashes(html_entity_decode($item['confirm'], ENT_NOQUOTES, $GLOBALS['charset']));
            }
        } else {
            $url = '';
            $title = '<i>' . $title . '</i>';
            $description = '[DISABLED] ' . $description;
        }
        if ($url == '') {
            $url = '#';
        }
        $line = "\n\t\t\t\t" . $inFolder . "['{$icon}', '{$title}', '{$url}', '{$target}', '{$description}', '{$confirm}'";
        if (!isset($item['type'])) {
            $line .= '],';
        } else {
            if ($item['type'] == 'endfolder') {
                $out = substr($out, 0, strlen($out) - 1);
                $line = "\n\t\t\t\t" . '],';
                $inFolder = '';
            } elseif ($item['type'] == 'folder') {
                $line .= ',';
                $inFolder .= "\t";
            } else {
                $line = "\n\t\t\t\t" . $item['type'] . ',';
            }
        }
        $out .= $line;
    }
    $out = substr($out, 0, strlen($out) - 1);
    global $jsmenu_style;
    if (!isset($jsmenu_style)) {
        $jsmenu_style = 'hbr';
    }
    $out .= "\n\t\t\t\t" . "];" . "\n\t\t\t\t" . "cmDraw ('CommandMenu', jsMenu, '{$jsmenu_style}', cmThemeOffice, 'ThemeOffice');" . "\n\t\t\t" . "</script>" . "\n\t\t";
    /* */
    echo '<!-- common.lib.php : displayMenuTitle() -->' . "\n";
    echo '	<div align="center">
		<table class="menu" cellspacing="0" cellpadding="0">
		<tr><td>
		<div id="CommandMenu">' . $out . '</div>
		</td></tr>
		</table>
	</div>';
}
Ejemplo n.º 6
0
     if ($plugin instanceof OrongoPluggableObject == false) {
         continue;
     }
     $manager->addItem("Installed Plugins", array($plugin->getName(), $plugin->getDescription(), $plugin->getAuthorInfo('name'), '<a href="' . $plugin->getAuthorInfo('website') . '">' . $plugin->getAuthorInfo('website') . '</a>', $plugin->getVersionString(), "override_actions" => array("<a href='" . orongoURL("orongo-admin/plugin-uninstall.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $plugin->getInfoPath()))) . "'>" . l("Uninstall") . "</a>", "<a href='" . orongoURL("orongo-admin/plugin-settings.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $plugin->getInfoPath()))) . "'>" . l("Settings") . "</a>")), "", "");
 }
 $manager->createTab("Not installed plugins", array("Plugin Name", "Plugin Description", "Author", "Author Website"));
 $files = @scandir(ADMIN . '/plugins');
 if (is_array($files)) {
     foreach ($files as $file) {
         if (is_dir(ADMIN . '/plugins/' . $file)) {
             $xmlFile = ADMIN . '/plugins/' . $file . '/info.xml';
             if (!file_exists($xmlFile)) {
                 continue;
             }
             $exists = false;
             foreach (getPlugins() as $plugin) {
                 if ($plugin->getInfoPath() == $xmlFile) {
                     $exists = true;
                 }
             }
             if ($exists) {
                 continue;
             }
             if (file_exists($xmlFile)) {
                 $ainfo = Plugin::getAuthorInfo($xmlFile);
                 $manager->addItem("Not installed plugins", array(Plugin::getName($xmlFile), Plugin::getDescription($xmlFile), $ainfo['name'], '<a href="' . $ainfo['website'] . '">' . $ainfo['website'] . '</a>', "override_actions" => array("<a href='" . orongoURL("orongo-admin/plugin-install.php?xml_path=" . urlencode(str_replace(ADMIN . '/plugins', "", $xmlFile))) . "'>" . l("Install") . "</a>")), "", "");
             }
         } else {
             continue;
         }
     }
             // do_sqlquery("INSERT INTO plugins (filename, action) VALUES ('".$_GET ['filename']."',1)",true);
             $db->query("INSERT INTO plugins (filename, action) VALUES ('" . $_GET['filename'] . "',1)");
         } else {
             // do_sqlquery("UPDATE plugins SET action='1' WHERE filename= '".$_GET ['filename']."'",true);
             $db->query("UPDATE plugins SET action='1' WHERE filename= '" . $_GET['filename'] . "'");
         }
         $startUp->redirect('/admincp/plugins/?tokenAdmin=' . $_COOKIE['tokenAdmin']);
         break;
 }
 $plugin_list = new phphooks();
 $plugin_headers = $plugin_list->get_plugins_header();
 $api = array();
 $i = 0;
 foreach ($plugin_headers as $tid => $plugin_header) {
     $action = false;
     foreach (getPlugins() as $result_row) {
         if ($plugin_header['filename'] == $result_row['filename'] && $result_row['action'] == 1) {
             $action = true;
         }
     }
     if ($action) {
         $api[$i]["active"] = "class='active'";
     } else {
         $api[$i]["active"] = "";
     }
     // Name
     $api[$i]["Name"] = $plugin_header['Name'];
     $api[$i]["Version"] = $plugin_header['Version'];
     $api[$i]["Description"] = $plugin_header['Description'];
     $api[$i]["AuthorURI"] = $plugin_header['AuthorURI'];
     $api[$i]["Author"] = $plugin_header['Author'];
Ejemplo n.º 8
0
    die('Insufficient Permissions');
}
if (ROLE != 'admin') {
    msg('权限不足!');
}
if (defined('SYSTEM_NO_PLUGIN') && SYSTEM_NO_PLUGIN) {
    die('<div class="alert alert-danger">您设置了"SYSTEM_NO_PLUGIN",所以无法使用任何与插件相关的功能</div>');
}
global $i;
if (isset($_GET['ok'])) {
    echo '<div class="alert alert-success">插件操作成功</div>';
}
if (isset($_GET['error_msg'])) {
    echo '<div class="alert alert-danger">' . (empty($_GET['error_msg']) ? '未知的异常' : $_GET['error_msg']) . '</div>';
}
$x = getPlugins();
$plugins = '';
foreach ($x as $key => $val) {
    $pluginfo = '';
    $action = '';
    if (!empty($val['plugin']['url'])) {
        $pluginfo .= '<b><a href="' . htmlspecialchars($val['plugin']['url']) . '" target="_blank">' . $val['plugin']['name'] . '</a></b>';
    } else {
        $pluginfo .= '<b>' . $val['plugin']['name'] . '</b>';
    }
    if (!empty($val['plugin']['description'])) {
        $pluginfo .= '<br/>' . $val['plugin']['description'];
    } else {
        $pluginfo .= '<br/>';
    }
    if (!empty($val['plugin']['version'])) {
Ejemplo n.º 9
0
     $content = daddslashes($_POST['content']);
     $content = nl2br(htmlspecialchars($content));
     $content .= "<p style=\"padding: 1.5em 1em 0; color: #999; font-size: 12px;\">—— 本邮件由 贴吧签到助手 (<a href=\"{$siteurl}\">{$siteurl}</a>) 管理员发送</p>";
     $query = DB::query("SELECT email FROM member");
     while ($result = DB::fetch($query)) {
         DB::insert('mail_queue', array('to' => $result['email'], 'subject' => $title, 'content' => $content));
     }
     saveSetting('mail_queue', 1);
     showmessage('已经添加至邮件队列,稍后将由系统自动发送', 'admin.php#mail');
     break;
 case 'cloud_sync':
     $ret = cloud::sync();
     showmessage($ret ? '站点信息同步成功!' : '同步信息失败,请稍后再试', 'admin.php#setting');
     break;
 case 'load_plugin':
     exit(json_encode(getPlugins()));
     break;
 case 'load_template':
     exit(json_encode(getTemplates()));
     break;
 case 'load_cron':
     exit(json_encode(getCron()));
     break;
 case 'skip_cron':
     if (!defined('AFENABLED')) {
         exit;
     }
     if ($formhash != $_GET['formhash']) {
         showmessage('来源不可信,请重试', 'admin.php#cron');
     }
     $cron_id = daddslashes($_GET['cid']);
Ejemplo n.º 10
0
 * You can also use this to include or require any files in your application.
 *
 */
/**
 * The settings below can be used to set additional paths to models, views and controllers.
 * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
 *
 * $modelPaths = array('full path to models', 'second full path to models', 'etc...');
 * $viewPaths = array('this path to views', 'second full path to views', 'etc...');
 * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
 *
 */
//EOF
$vendorPaths = array(ROOT . DS . APP_DIR . DS . "vendors" . DS, ROOT . DS . "vendors" . DS);
//プラグインのベンダーディレクトリを検索対象に追加する
$plugins = getPlugins();
foreach ($plugins as $plugin) {
    $vendor_path = ROOT . DS . APP_DIR . DS . "plugins" . DS . $plugin . DS . 'vendors';
    if (is_dir($vendor_path)) {
        $vendorPaths[] = $vendor_path;
    }
}
//ベンダーの読み込み対象情報を変更
Configure::write('vendorPaths', $vendorPaths);
//インストールされているプラグイン一覧を取得する
function getPlugins()
{
    $pluginFolder = new Folder(APP . 'plugins');
    $plugins = $pluginFolder->ls();
    $result = array();
    if (count($plugins) > 0) {
Ejemplo n.º 11
0
function pluginExists($name)
{
    return array_search($name, getPlugins()) !== false;
}
Ejemplo n.º 12
0
 public function startup(&$controller)
 {
     //全てのページで読み込む情報をここに記述する
     $plugins = getPlugins();
 }
Ejemplo n.º 13
0
function plugins()
{
    // Submit changes
    if (isset($_POST['admin_plugin_submit_changes'])) {
        $old_active_plugins = getConfig('rss.config.plugins');
        $active_plugins = array();
        foreach ($_REQUEST as $rkey => $rentry) {
            if (preg_match('/_gregarius_plugin.([a-zA-Z0-9_\\/\\-]+).php/', $rkey, $matches)) {
                $active_plugins[] = $matches[1] . ".php";
            }
        }
        $value = serialize($active_plugins);
        $sql = "update " . getTable('config') . " set value_='{$value}' where key_='rss.config.plugins'";
        rss_query($sql);
        rss_invalidate_cache();
        // deactivate
        $to_deactivate = array_diff($old_active_plugins, $active_plugins);
        foreach ($to_deactivate as $deactivatethis) {
            rss_load_plugin($deactivatethis);
            rss_plugin_hook("rss.plugins.admin.deactivate", "", $deactivatethis);
        }
        //activate
        $to_activate = array_diff($active_plugins, $old_active_plugins);
        foreach ($to_activate as $activatethis) {
            rss_load_plugin($activatethis);
            rss_plugin_hook("rss.plugins.admin.activate", "", $activatethis);
        }
    } else {
        $active_plugins = getConfig('rss.config.plugins');
    }
    // Check for updates
    $doUpdates = false;
    $updates = array();
    if (isset($_POST['admin_plugin_check_for_updates'])) {
        $updates = plugins_check_for_updates();
        $doUpdates = true;
    }
    // Rendering
    echo "<h2 class=\"trigger\">" . __('Plugins') . "</h2>\n" . "<div id=\"admin_plugins\">\n";
    echo __('<p style="font-size:small">Plugins are third-party scripts that offer extended functionalities. More plugins can be downloaded at the <a style="text-decoration:underline"  href="http://plugins.gregarius.net/">Plugin Repository</a>.</p>');
    echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n";
    echo "<p><input type=\"hidden\" name=\"" . CST_ADMIN_DOMAIN . "\" value=\"" . CST_ADMIN_DOMAIN_PLUGINS . "\" /></p>\n";
    echo "\n<table id=\"plugintable\">\n<tr>\n" . "<th>" . __('Active') . "</th>\n" . "<th>" . __('Name') . "</th>\n" . "<th>" . __('Version') . "</th>\n" . "<th>" . __('Author') . "</th>\n" . "<th>" . __('Description') . "</th>\n" . "<th>" . __('Options') . "</th>\n";
    if ($doUpdates) {
        echo "<th>" . __('Update Available') . "</th>\n";
    }
    echo "</tr>\n";
    $rss_plugins = getPlugins();
    $cntr = 0;
    if ($rss_plugins) {
        foreach ($rss_plugins as $entry => $info) {
            $active = in_array($entry, $active_plugins);
            if (count($info)) {
                $updateDl = null;
                if (is_array($updates) && array_key_exists($info['file'], $updates)) {
                    $lastV = $updates[$info['file']][0];
                    $thisV = $info['version'];
                    if ($lastV > $thisV) {
                        $updateDl = str_replace("&", "&amp;", $updates[$info['file']][1]);
                    }
                }
                $class = ($cntr++ % 2 == 0 ? "even" : "odd") . ($updateDl ? " hilite" : ($active ? " active" : ""));
                echo "<tr class=\"{$class}\">\n";
                echo "<td class=\"cntr\">" . "<input type=\"checkbox\" name=\"_gregarius_plugin_{$entry}\" " . " id=\"_gregarius_plugin_{$entry}\" value=\"1\" " . ($active ? "checked=\"checked\"" : "") . " />\n" . "</td>\n";
                echo "<td><label\n                for=\"_gregarius_plugin_{$entry}\">" . (array_key_exists('name', $info) ? $info['name'] : "&nbsp;") . "</label></td>\n";
                echo "<td class=\"cntr\">" . (array_key_exists('version', $info) ? $info['version'] : "&nbsp;") . "</td>\n";
                echo "<td>" . (array_key_exists('author', $info) ? $info['author'] : "&nbsp;") . "</td>\n";
                echo "<td>" . (array_key_exists('description', $info) ? $info['description'] : "&nbsp;") . "</td>\n";
                // output the column to call a plugin's config page.
                echo "<td  class=\"cntr\">";
                if (array_key_exists('configuration', $info)) {
                    $escaped_plugin_name = str_replace("/", "%2F", $entry);
                    echo "<a href=\"" . $_SERVER['PHP_SELF'] . "?" . CST_ADMIN_DOMAIN . "=" . CST_ADMIN_DOMAIN_PLUGIN_OPTIONS . "&amp;action=" . CST_ADMIN_EDIT_ACTION . "&amp;plugin_name=" . $escaped_plugin_name . "&amp;" . CST_ADMIN_VIEW . "=" . CST_ADMIN_DOMAIN_PLUGIN_OPTIONS . "\">" . __('edit') . "</a>";
                } else {
                    echo "&nbsp;";
                }
                echo "</td>\n";
                if ($doUpdates && $updateDl) {
                    echo "<td class=\"cntr\">";
                    echo "<a href=\"{$updateDl}\">{$lastV}</a>";
                    echo "</td>";
                } elseif ($doUpdates) {
                    echo "<td>&nbsp;</td>";
                }
                echo "</tr>\n";
            }
        }
    }
    echo "</table>\n";
    echo "<p><input type=\"hidden\" name=\"" . CST_ADMIN_METAACTION . "\" value=\"ACT_ADMIN_SUBMIT_CHANGES\"/>\n";
    echo "<input type=\"submit\" name=\"admin_plugin_submit_changes\" value=\"" . __('Submit Changes') . "\" />\n";
    echo "<input type=\"submit\" name=\"admin_plugin_check_for_updates\" value=\"" . __('Check for Updates') . "\" /></p></form>\n";
    echo "</div>";
}
Ejemplo n.º 14
0
<?php

require_once "../include/core.php";
if (isset($_GET['name'])) {
    $name = $_GET['name'];
}
$type = $_GET['type'];
$target = $_GET['target'];
if ($target == 'plugin' && preg_match("%^js|css\$%", $type)) {
    if ($type == 'js') {
        header("Content-type: application/javascript");
    } else {
        header("Content-type: text/css");
    }
    foreach (getPlugins() as $name) {
        $path = "../plugins/{$name}/acp/{$name}.{$type}";
        if (file_exists($path)) {
            readfile($path);
        }
    }
} else {
    if ($target == 'locale' && preg_match("%^[a-z]{2}_[A-Z]{2}\$%", $name) && preg_match("%^mo|po\$%", $type)) {
        $path = "../locale/{$name}/LC_MESSAGES/acp.{$type}";
        if (file_exists($path)) {
            header("Content-type: text/plain");
            readfile($path);
        } else {
            http_response_code(404);
        }
    } else {
        http_response_code(404);