예제 #1
0
파일: Form.php 프로젝트: HaldunA/phpwebsite
 public static function setTabs(PHPWS_Panel $panel)
 {
     $link = 'index.php?module=boost&action=admin';
     $core_links['title'] = dgettext('boost', 'Core Modules');
     $other_links['title'] = dgettext('boost', 'Other Modules');
     $other_links['link'] = $core_links['link'] = $link;
     $tabs['core_mods'] = $core_links;
     $tabs['other_mods'] = $other_links;
     $panel->quickSetTabs($tabs);
 }
예제 #2
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $linkBase = 'index.php?module=block';
     $tabs['list'] = array('title' => dgettext('block', 'List'), 'link' => $linkBase);
     $tabs['settings'] = array('title' => dgettext('block', 'Settings'), 'link' => $linkBase);
     $panel = new PHPWS_Panel('block');
     $panel->enableSecure();
     $panel->quickSetTabs($tabs);
     $panel->setModule('block');
     return $panel;
 }
예제 #3
0
 public function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link = 'index.php?module=users&action=user';
     foreach ($this->modules as $module) {
         $link = 'index.php?module=users&action=user';
         $tabs[$module->title] = array('title' => $module->getProperName(), 'link' => $link);
     }
     $panel = new PHPWS_Panel('users');
     $panel->quickSetTabs($tabs);
     $panel->setModule('users');
     $panel->setPanel('panel.tpl');
     return $panel;
 }
예제 #4
0
 public static function adminPanel()
 {
     $opt['link'] = 'index.php?module=rss';
     $opt['title'] = dgettext('rss', 'Channels');
     $tab['channels'] = $opt;
     $opt['title'] = dgettext('rss', 'Import');
     $tab['import'] = $opt;
     $opt['title'] = dgettext('rss', 'Settings');
     $tab['settings'] = $opt;
     $panel = new PHPWS_Panel('rss_admin');
     $panel->quickSetTabs($tab);
     return $panel;
 }
예제 #5
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link = PHPWS_Text::linkAddress('analytics', null, false, false, true, false);
     $tabs['list'] = array('title' => dgettext('analytics', 'List Trackers'), 'link' => $link);
     $tabs['new'] = array('title' => dgettext('analytics', 'New Tracker'), 'link' => $link);
     $panel = new PHPWS_Panel('analyticsPanel');
     $panel->enableSecure();
     $panel->quickSetTabs($tabs);
     $panel->setModule('analytics');
     $panel->setPanel('panel.tpl');
     return $panel;
 }
예제 #6
0
 public static function adminPanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link = 'index.php?module=layout&action=admin';
     $tabs['arrange'] = array('title' => dgettext('layout', 'Arrange'), 'link' => $link);
     $tabs['meta'] = array('title' => dgettext('layout', 'Meta Tags'), 'link' => $link);
     $tabs['theme'] = array('title' => dgettext('layout', 'Themes'), 'link' => $link);
     $panel = new PHPWS_Panel('layout');
     $panel->quickSetTabs($tabs);
     return $panel;
 }
예제 #7
0
 public function getPanel()
 {
     $panel = new PHPWS_Panel('calendar');
     $vars['aop'] = 'schedules';
     $tabs['schedules'] = array('title' => dgettext('calendar', 'Schedules'), 'link' => PHPWS_Text::linkAddress('calendar', $vars));
     if (Current_User::allow('calendar', 'settings')) {
         $vars['aop'] = 'settings';
         $tabs['settings'] = array('title' => dgettext('calendar', 'Settings'), 'link' => PHPWS_Text::linkAddress('calendar', $vars));
     }
     if (Current_User::isUnrestricted('calendar') && Current_User::allow('calendar', 'edit_public')) {
         $vars['aop'] = 'approval';
         $db = new PHPWS_DB('calendar_suggestions');
         $count = $db->count();
         if (PHPWS_Error::isError($count)) {
             PHPWS_Error::log($count);
             $count = 0;
         }
         $tabs['approval'] = array('title' => sprintf(dgettext('calendar', 'Approval (%s)'), $count), 'link' => PHPWS_Text::linkAddress('calendar', $vars));
     }
     $panel->quickSetTabs($tabs);
     return $panel;
 }
예제 #8
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link['link'] = 'index.php?module=access';
     if (MOD_REWRITE_ENABLED) {
         $link['title'] = dgettext('access', 'Shortcuts');
         $tabs['shortcuts'] = $link;
     }
     if (Current_User::allow('access', 'admin_options')) {
         $link['title'] = dgettext('access', 'Allow/Deny');
         $tabs['deny_allow'] = $link;
     }
     if (Current_User::isDeity()) {
         $link['title'] = dgettext('access', '.htaccess');
         $tabs['htaccess'] = $link;
     }
     $panel = new PHPWS_Panel('access_panel');
     $panel->enableSecure();
     if (!empty($tabs)) {
         $panel->quickSetTabs($tabs);
     }
     $panel->setModule('access');
     return $panel;
 }
예제 #9
0
 public static function display($content = null, $current_tab = null)
 {
     self::deleteLinksAdmin();
     Layout::addStyle('controlpanel');
     $panel = new PHPWS_Panel('controlpanel');
     $panel->disableSecure();
     $current_mod = PHPWS_Core::getCurrentModule();
     $checkTabs = PHPWS_ControlPanel::loadTabs();
     $panel->setTabs($checkTabs);
     $allLinks = PHPWS_ControlPanel::getAllLinks();
     if (empty($checkTabs)) {
         PHPWS_Error::log(CP_NO_TABS, 'controlpanel', 'display');
         PHPWS_ControlPanel::makeDefaultTabs();
         PHPWS_ControlPanel::reset();
         PHPWS_Core::errorPage();
         exit;
     }
     $defaultTabs = PHPWS_ControlPanel::getDefaultTabs();
     foreach ($defaultTabs as $tempTab) {
         $tabList[] = $tempTab['id'];
     }
     if (!empty($allLinks)) {
         $links = array_keys($allLinks);
         if ($current_mod != 'controlpanel' && !$current_tab) {
             foreach ($allLinks as $key => $tablinks) {
                 foreach ($tablinks as $link) {
                     if ($link->itemname == $current_mod) {
                         $current_tab = $key;
                         break 2;
                     }
                 }
             }
         }
     }
     foreach ($checkTabs as $tab) {
         if ($tab->getItemname() == 'controlpanel' && in_array($tab->id, $tabList) && (!isset($links) || !in_array($tab->id, $links))) {
             $panel->dropTab($tab->id);
         }
     }
     if (empty($panel->tabs)) {
         return dgettext('controlpanel', 'No tabs available in the Control Panel.');
     }
     if (!isset($content) && $current_mod == 'controlpanel') {
         if (isset($allLinks[$panel->getCurrentTab()])) {
             foreach ($allLinks[$panel->getCurrentTab()] as $id => $link) {
                 $link_content[] = $link->view();
             }
             $link_content = PHPWS_Template::process(array('LINKS' => implode('', $link_content)), 'controlpanel', 'links.tpl');
             $panel->setContent($link_content);
         }
     } else {
         $panel->setContent($content);
     }
     if (isset($current_tab)) {
         $panel->setCurrentTab($current_tab);
     }
     if (!isset($panel->tabs[$panel->getCurrentTab()])) {
         return dgettext('controlpanel', 'An error occurred while accessing the Control Panel.');
     }
     $tab = $panel->tabs[$panel->getCurrentTab()];
     $link = str_replace('&', '&', $tab->getLink(false)) . '&tab=' . $tab->id;
     $current_link = str_replace($_SERVER['PHP_SELF'] . '\\?', '', $_SERVER['REQUEST_URI']);
     // Headers to the tab's link if it is not a control panel
     // link tab.
     if (isset($_REQUEST['command']) && $_REQUEST['command'] == 'panel_view' && !preg_match('/controlpanel/', $link) && $link != $current_link) {
         PHPWS_Core::reroute($link);
     }
     return $panel->display();
 }
예제 #10
0
PHPWS_Core::requireConfig('boost');
if (DEITY_ACCESS_ONLY && !Current_User::isDeity()) {
    Current_User::disallow();
}
if (!Current_User::authorized('boost')) {
    Current_User::disallow();
}
if (!isset($_REQUEST['action'])) {
    PHPWS_Core::errorPage(404);
}
$js = false;
$content = array();
PHPWS_Core::initModClass('boost', 'Form.php');
PHPWS_Core::initModClass('controlpanel', 'Panel.php');
PHPWS_Core::initModClass('boost', 'Action.php');
$boostPanel = new PHPWS_Panel('boost');
$boostPanel->enableSecure();
Boost_Form::setTabs($boostPanel);
$vars = array('action' => 'admin', 'tab' => $boostPanel->getCurrentTab());
$backToBoost = PHPWS_Text::secureLink(dgettext('boost', 'Return to Boost'), 'boost', $vars);
switch ($_REQUEST['action']) {
    case 'admin':
        $content[] = Boost_Form::listModules(Boost_Form::boostTab($boostPanel));
        break;
    case 'check':
        $content[] = $backToBoost . '<br />';
        $content[] = Boost_Action::checkupdate($_REQUEST['opmod']);
        break;
    case 'check_all':
        Boost_Action::checkAll();
        $content[] = Boost_Form::listModules(Boost_Form::boostTab($boostPanel));
예제 #11
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link = 'index.php?module=search';
     $tab['keyword'] = array('title' => dgettext('search', 'Keywords'), 'link' => $link);
     $tab['ignore'] = array('title' => dgettext('search', 'Ignore'), 'link' => $link);
     $tab['settings'] = array('title' => dgettext('search', 'Settings'), 'link' => $link);
     $panel = new PHPWS_Panel('search');
     $panel->quickSetTabs($tab);
     $panel->setModule('search');
     return $panel;
 }
예제 #12
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $link = PHPWS_Text::linkAddress('users', array('action' => 'admin'), false, false, true, false);
     /*
      if (PHPWS_Settings::get('users', 'allow_new_users') || Current_User::isDeity()) {
      $tabs['new_user'] = array('title'=>dgettext('users', 'New User'), 'link'=>$link);
      }
     */
     if (Current_User::allow('users', 'edit_users') || Current_User::allow('users', 'delete_users')) {
         $tabs['manage_users'] = array('title' => dgettext('users', 'Manage Users'), 'link' => $link);
     }
     if (Current_User::allow('users', 'add_edit_groups')) {
         //$tabs['new_group'] = array('title' => dgettext('users', 'New Group'), 'link' => $link);
         $tabs['manage_groups'] = array('title' => dgettext('users', 'Manage Groups'), 'link' => $link);
     }
     if (Current_User::isDeity()) {
         $tabs['authorization'] = array('title' => dgettext('users', 'Authorization'), 'link' => $link);
     }
     if (Current_User::allow('users', 'settings')) {
         $tabs['settings'] = array('title' => dgettext('users', 'Settings'), 'link' => $link);
     }
     $panel = new PHPWS_Panel('user_user_panel');
     $panel->quickSetTabs($tabs);
     $panel->setModule('users');
     return $panel;
 }
예제 #13
0
 public static function cpanel()
 {
     PHPWS_Core::initModClass('controlpanel', 'Panel.php');
     $listLink = 'index.php?module=blog&amp;action=admin';
     $listCommand = array('title' => dgettext('blog', 'List'), 'link' => $listLink);
     if (Current_User::allow('blog', 'edit_blog')) {
         $tabs['list'] =& $listCommand;
     }
     if (Current_User::allow('blog', 'settings')) {
         $tabs['settings'] = array('title' => dgettext('blog', 'Settings'), 'link' => 'index.php?module=blog&amp;action=admin');
     }
     $panel = new PHPWS_Panel('blog');
     $panel->quickSetTabs($tabs);
     return $panel;
 }