Ejemplo n.º 1
0
$xoops->header('admin:system/system_groups.tpl');
//$system_breadcrumb->addLink(_AM_SYSTEM_GROUPS_NAV_MANAGER, system_adminVersion('groups', 'adminpath'));
switch ($op) {
    case 'list':
    default:
        // Define Stylesheet
        $xoops->theme()->addStylesheet('modules/system/css/admin.css');
        // Define Scripts
        $xoops->theme()->addScript('media/jquery/plugins/jquery.tablesorter.js');
        $xoops->theme()->addScript('modules/system/js/admin.js');
        // Define Breadcrumb and tips
        $admin_page = new \Xoops\Module\Admin();
        $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
        $admin_page->addBreadcrumbLink(SystemLocale::GROUPS_MANAGER, $system->adminVersion('groups', 'adminpath'));
        $admin_page->addBreadcrumbLink(XoopsLocale::MAIN);
        $admin_page->addItemButton(SystemLocale::ADD_NEW_GROUP, 'admin.php?fct=groups&op=groups_add', 'add');
        $admin_page->addTips(SystemLocale::GROUPS_TIPS_1);
        $admin_page->renderBreadcrumb();
        $admin_page->renderTips();
        $admin_page->renderButton();
        // Get start pager
        $start = $system->cleanVars($_REQUEST, 'start', 0, 'int');
        // Criteria
        $criteria = new CriteriaCompo();
        $criteria->setSort("groupid");
        $criteria->setOrder("ASC");
        $criteria->setStart($start);
        $criteria->setLimit($nb_group);
        $groups_arr = $groups_handler->getAll($criteria);
        // Count group
        $groups_count = count($groups_arr);
Ejemplo n.º 2
0
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         page
 * @since           2.6.0
 * @author          Mage Grégory (AKA Mage)
 * @version         $Id$
 */
include __DIR__ . '/header.php';
// Call header
$xoops->header('admin:page/page_admin_content.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('content.php');
switch ($op) {
    case 'list':
    default:
        $admin_page->addTips(PageLocale::CONTENT_TIPS);
        $admin_page->addItemButton(PageLocale::A_ADD_CONTENT, 'content.php?op=new', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        // Content
        $content_count = $content_Handler->countPage();
        $content_arr = $content_Handler->getPage($start, $nb_limit);
        // Assign Template variables
        $xoops->tpl()->assign('content_count', $content_count);
        if ($content_count > 0) {
            foreach (array_keys($content_arr) as $i) {
                $content = $content_arr[$i]->getValues();
                $xoops->tpl()->appendByRef('content', $content);
                unset($content);
            }
            // Display Page Navigation
            if ($content_count > $nb_limit) {
Ejemplo n.º 3
0
$xoops->header('admin:banners/banners_admin_banners.tpl');
// Get start pager
$start = Request::getInt('start', 0);
$startF = Request::getInt('startF', 0);
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('banners.php');
$info_msg = array(sprintf(_AM_BANNERS_ALERT_INFO_MIMETYPES, implode(", ", $mimetypes)), sprintf(_AM_BANNERS_ALERT_INFO_MAXFILE, $upload_size / 1000));
switch ($op) {
    case 'list':
    default:
        // Define Stylesheet
        $xoops->theme()->addBaseStylesheetAssets('@jqueryuicss');
        // Define scripts
        $xoops->theme()->addBaseScriptAssets(array('@jqueryui', 'modules/system/js/admin.js'));
        $admin_page->addTips(_AM_BANNERS_TIPS_BANNERS);
        $admin_page->addItemButton(_AM_BANNERS_BANNERS_ADD, 'banners.php?op=new', 'add');
        $admin_page->renderTips();
        if ($client_Handler->getCount() == 0) {
            echo $xoops->alert('error', _AM_BANNERS_BANNERS_ERROR_NOCLIENT);
        } else {
            $admin_page->renderButton();
        }
        // Display banner
        $criteria = new CriteriaCompo();
        $criteria->add(new Criteria('banner_status', 0, '!='));
        $criteria->setSort("banner_datestart");
        $criteria->setOrder("DESC");
        $criteria->setStart($start);
        $criteria->setLimit($nb_banners);
        $banner_count = $banner_Handler->getCount($criteria);
        $banner_arr = $banner_Handler->getAll($criteria);
Ejemplo n.º 4
0
switch ($op) {
    case 'list':
    default:
        // Define tips
        $admin_page->addTips(_AM_MAINTENANCE_CENTER_TIPS);
        $admin_page->renderTips();
        $form = $xoops->getModuleForm(null, 'maintenance');
        $form->getMaintenance();
        $form->display();
        break;
    case 'maintenance_save':
        // Check security
        if (!$xoops->security()->check()) {
            $xoops->redirect('center.php', 3, implode('<br />', $xoops->security()->getErrors()));
        }
        $admin_page->addItemButton(_AM_MAINTENANCE_CENTER_RETURN, 'center.php', 'application-view-detail');
        $admin_page->renderButton();
        $session = $system->cleanVars($_REQUEST, 'session', 1, 'int');
        $cache = $system->cleanVars($_REQUEST, 'cache', array(), 'array');
        $tables = $system->cleanVars($_REQUEST, 'tables', array(), 'array');
        $tables_op = $system->cleanVars($_REQUEST, 'maintenance', array(), 'array');
        $xoops->db();
        global $xoopsDB;
        $db = $xoopsDB;
        //Cache
        $res_cache = $system->cleanCache($cache);
        if (!empty($cache)) {
            for ($i = 0; $i < count($cache); ++$i) {
                switch ($cache[$i]) {
                    case 1:
                        $xoops->tpl()->assign('smarty_cache', true);
Ejemplo n.º 5
0
     $image_id = Request::getInt('image_id', 0);
     if ($image_id > 0) {
         $obj = $helper->getHandlerImages()->get($image_id);
         $old = $obj->getVar('image_display');
         $obj->setVar('image_display', !$old);
         if (!$helper->getHandlerImages()->insert($obj)) {
             $error = true;
         }
     }
     break;
 case 'list':
 default:
     // Get rights
     $imgcat_write = $gperm_handler->checkRight('imgcat_write', $imgcat_id, $groups, $xoops->module->mid());
     if ($imgcat_write) {
         $admin_page->addItemButton(_AM_IMAGES_IMG_ADD, 'images.php?op=add&imgcat_id=' . $imgcat_id, 'add');
         $admin_page->renderButton();
     }
     // Get category store type
     $category = $helper->getHandlerCategories()->get($imgcat_id);
     if (is_object($category)) {
         if ($category->getVar('imgcat_storetype') == 'db') {
             $xoops->tpl()->assign('db_store', 1);
         }
     }
     // Category Select form
     $form_category = $helper->getForm($imgcat_id, 'categoryselect');
     $xoops->tpl()->assign('form_category', $form_category->render());
     $imgcount = $helper->getHandlerImages()->countByCategory($imgcat_id);
     $images = $helper->getHandlerImages()->getByCategory($imgcat_id, $start, $helper->getConfig('images_pager'), false);
     $xoops->tpl()->assign('images', $images);
Ejemplo n.º 6
0
$upload_size = 500000;
// Get Action type
$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string');
// Get userrank handler
$userrank_Handler = $xoops->getHandler("ranks");
// Call Header
$xoops->header('admin:userrank/userrank.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('userrank.php');
switch ($op) {
    case 'list':
    default:
        // Add Scripts
        $xoops->theme()->addScript('media/xoops/xoops.js');
        $admin_page->addTips(_AM_USERRANK_TIPS);
        $admin_page->addItemButton(_AM_USERRANK_ADD, './userrank.php?op=userrank_new', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        // Get start pager
        $start = $system->cleanVars($_REQUEST, 'start', 0, 'int');
        // Criteria
        $criteria = new CriteriaCompo();
        $criteria->setSort("rank_id");
        $criteria->setOrder("ASC");
        $criteria->setStart($start);
        $criteria->setLimit($nb_rank);
        // Count rank
        $userrank_count = $userrank_Handler->getCount($criteria);
        $userrank_arr = $userrank_Handler->getAll($criteria);
        // Assign Template variables
        $xoops->tpl()->assign('userrank_count', $userrank_count);
Ejemplo n.º 7
0
// Get avatar handler
$avatar_Handler = $helper->getHandlerAvatar();
// Call Header
$xoops->header('admin:avatars/avatars_admin_system.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('avatar_system.php');
$info_msg = array(sprintf(AvatarsLocale::ALERT_INFO_MIMETYPES, implode(", ", $mimetypes)), sprintf(AvatarsLocale::ALERT_INFO_MAXFILE, $upload_size / 1000), sprintf(AvatarsLocale::ALERT_INFO_PIXELS, $width, $height));
switch ($op) {
    case 'list':
    default:
        // Add Scripts
        $xoops->theme()->addScript('media/xoops/xoops.js');
        // Define Stylesheet
        $xoops->theme()->addStylesheet('modules/avatars/css/admin.css');
        $admin_page->addTips(AvatarsLocale::SYSTEM_TIPS);
        $admin_page->addItemButton(XoopsLocale::A_ADD, 'avatar_system.php?op=new', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        // Get start pager
        $start = Request::getInt('start', 0);
        // Filter avatars
        $criteria = new Criteria('avatar_type', 'S');
        $avatar_count = $avatar_Handler->getCount($criteria);
        $xoops->tpl()->assign('avatar_count', $avatar_count);
        // Get avatar list
        $criteria->setStart($start);
        $criteria->setLimit($nb_avatars);
        $criteria->setSort("avatar_weight");
        $criteria->setOrder("ASC");
        $avatars_arr = $avatar_Handler->getObjects($criteria, true);
        // Construct avatars array
Ejemplo n.º 8
0
         }
     }
     if ($categoriesHandler->insert($obj)) {
         $xoops->redirect('category.php', 3, AlumniLocale::FORMOK);
     }
     echo $obj->getHtmlErrors();
     $form = $xoops->getModuleForm($obj, 'category');
     $form->display();
     break;
 case 'edit_category':
     $cid = Request::getInt('cid', 0);
     $xoops = Xoops::getInstance();
     $xoops->header();
     $indexAdmin = new \Xoops\Module\Admin();
     $indexAdmin->displayNavigation('category.php');
     $indexAdmin->addItemButton(AlumniLocale::LIST_CATS, 'alumni.php', 'list');
     $indexAdmin->renderButton('left', '');
     $obj = $categoriesHandler->get($cid);
     $form = $xoops->getModuleForm($obj, 'category');
     $form->display();
     break;
 case 'delete_category':
     $xoops = Xoops::getInstance();
     $xoops->header();
     $cid = Request::getInt('cid', 0);
     $ok = Request::getInt('ok', 0);
     $obj = $categoriesHandler->get($cid);
     if (isset($ok) && $ok == 1) {
         if (!$xoops->security()->check()) {
             $xoops->redirect('category.php', 3, implode(',', $xoops->security()->getErrors()));
         }
Ejemplo n.º 9
0
include_once __DIR__ . '/header.php';
$xoops = Xoops::getInstance();
$helper = Menus::getInstance();
// Call Header & ...
$xoops->header('admin:menus/menus_admin_menus.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('admin_menus.php');
$xoops->theme()->addStylesheet('modules/system/css/admin.css');
// Get $_GET, $_POST, ...
$op = Request::getCmd('op', 'list');
$id = Request::getInt('id', 0);
$limit = Request::getInt('limit', 15);
$start = Request::getInt('start', 0);
switch ($op) {
    case 'add':
        $admin_page->addItemButton(_AM_MENUS_LIST_MENUS, 'admin_menus.php', 'application-view-detail');
        $admin_page->renderButton();
        // Create form
        $obj = $helper->getHandlerMenus()->create();
        $form = $helper->getForm($obj, 'menus_menus');
        $xoops->tpl()->assign('form', $form->render());
        break;
    case 'edit':
        $admin_page->addItemButton(_AM_MENUS_LIST_MENUS, 'admin_menus.php', 'application-view-detail');
        $admin_page->renderButton();
        // Create form
        $id = Request::getInt('id', 0);
        $obj = $helper->getHandlerMenus()->get($id);
        $form = $helper->getForm($obj, 'menus_menus');
        $xoops->tpl()->assign('form', $form->render());
        break;
Ejemplo n.º 10
0
    $xoops->redirect('admin_menus.php', 1, _AM_MENUS_MSG_NOMENUS);
}
if (isset($_REQUEST['menu_id']) && in_array($_REQUEST['menu_id'], array_keys($menus_list))) {
    $menu_id = $_REQUEST['menu_id'];
    $menu_title = $menus_list[$menu_id];
} else {
    $keys = array_keys($menus_list);
    $menu_id = $keys[0];
    $menu_title = $menus_list[$menu_id];
}
$xoops->tpl()->assign('menu_id', $menu_id);
$xoops->tpl()->assign('menu_title', $menu_title);
$xoops->tpl()->assign('menus_list', $menus_list);
switch ($op) {
    case 'add':
        $admin_page->addItemButton(_AM_MENUS_LIST_MENUS, 'admin_menu.php', 'application-view-detail');
        $admin_page->renderButton();
        // Create form
        $obj = $helper->getHandlerMenu()->create();
        $obj->setVar('pid', $pid);
        $obj->setVar('mid', $menu_id);
        $form = $helper->getForm($obj, 'menus_menu');
        $xoops->tpl()->assign('form', $form->render());
        break;
    case 'edit':
        $admin_page->addItemButton(_AM_MENUS_LIST_MENUS, 'admin_menu.php', 'application-view-detail');
        $admin_page->renderButton();
        // Create form
        $id = Request::getInt('id', 0);
        $obj = $helper->getHandlerMenu()->get($id);
        $form = $helper->getForm($obj, 'menus_menu');
Ejemplo n.º 11
0
$admin_page->renderNavigation('smilies.php');
$xoops->theme()->addScript('media/xoops/xoops.js');
$xoops->theme()->addStylesheet('modules/system/css/admin.css');
// Parameters
$nb_smilies = $helper->getConfig('smilies_pager');
$mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
$upload_size = 50000;
$info_msg = array(sprintf(_AM_SMILIES_ALERT_INFO_MIMETYPES, implode(", ", $mimetypes)), sprintf(_AM_SMILIES_ALERT_INFO_MAXFILE, $upload_size));
// Get $_GET, $_POST, ...
$op = Request::getCmd('op', 'list');
$start = Request::getInt('start', 0);
switch ($op) {
    case 'list':
    default:
        $admin_page->addTips(_AM_SMILIES_TIPS);
        $admin_page->addItemButton(_AM_SMILIES_ADD, 'smilies.php?op=add', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        $smilies_count = $helper->getHandlerSmilies()->getCount();
        $smilies = $helper->getHandlerSmilies()->getSmilies($start, $nb_smilies, false);
        $xoops->tpl()->assign('smilies', $smilies);
        $xoops->tpl()->assign('smilies_count', $smilies_count);
        // Display Page Navigation
        if ($smilies_count > $nb_smilies) {
            $nav = new XoopsPageNav($smilies_count, $nb_smilies, $start, 'start', 'op=list');
            $xoops->tpl()->assign('nav_menu', $nav->renderNav(2));
        }
        break;
        // New smilie
    // New smilie
    case 'add':
Ejemplo n.º 12
0
$system = System::getInstance();
$xoops = Xoops::getInstance();
// Get Action type
$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string');
// Call header
$xoops->header('admin:profile/steplist.tpl');
// Get handler
$regstep_Handler = $xoops->getModuleHandler("regstep");
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('step.php');
switch ($op) {
    case "list":
    default:
        // Add Scripts
        $xoops->theme()->addScript('media/xoops/xoops.js');
        $admin_page->addItemButton(XoopsLocale::A_ADD . ' ' . _PROFILE_AM_STEP, 'step.php?op=new', 'add');
        $admin_page->renderButton();
        $xoops->tpl()->assign('steps', $regstep_Handler->getObjects(null, true, false));
        $xoops->tpl()->assign('step', true);
        break;
    case "new":
        $admin_page->addItemButton(_PROFILE_AM_STEP_LIST, 'step.php', 'application-view-detail');
        $admin_page->renderButton();
        $obj = $regstep_Handler->create();
        $form = $xoops->getModuleForm($obj, 'regstep');
        $xoops->tpl()->assign('form', $form->render());
        break;
    case "edit":
        $admin_page->addItemButton(XoopsLocale::A_ADD . ' ' . _PROFILE_AM_STEP, 'step.php?op=new', 'add');
        $admin_page->addItemButton(_PROFILE_AM_STEP_LIST, 'step.php', 'application-view-detail');
        $admin_page->renderButton();
Ejemplo n.º 13
0
$client_Handler = $helper->getHandlerBannerclient();
// Get member handler
$member_handler = $xoops->getHandlerMember();
// Call header
$xoops->header('admin:banners/banners_admin_clients.tpl');
// Get Action type
$op = Request::getCmd('op', 'list');
// Get start pager
$start = Request::getInt('start', 0);
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('clients.php');
switch ($op) {
    case 'list':
    default:
        $admin_page->addTips(_AM_BANNERS_TIPS_CLIENTS);
        $admin_page->addItemButton(_AM_BANNERS_CLIENTS_ADD, 'clients.php?op=new', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        // Display client
        $criteria = new CriteriaCompo();
        $criteria->setSort("bannerclient_name");
        $criteria->setOrder("ASC");
        $criteria->setStart($start);
        $criteria->setLimit($nb_clients);
        $client_count = $client_Handler->getCount($criteria);
        $client_arr = $client_Handler->getAll($criteria);
        $xoops->tpl()->assign('client_count', $client_count);
        if ($client_count > 0) {
            foreach (array_keys($client_arr) as $i) {
                $criteria = new CriteriaCompo();
                $criteria->add(new Criteria('banner_cid', $client_arr[$i]->getVar("bannerclient_cid"), '='));
Ejemplo n.º 14
0
include __DIR__ . '/header.php';
// Get main instance
$system = System::getInstance();
$xoops = Xoops::getInstance();
// Get Action type
$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string');
// Call header
$xoops->header('admin:profile/categorylist.tpl');
// Get category handler
$category_Handler = $xoops->getModuleHandler("category");
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('category.php');
switch ($op) {
    case "list":
    default:
        $admin_page->addItemButton(XoopsLocale::A_ADD . ' ' . _PROFILE_AM_CATEGORY, 'category.php?op=new', 'add');
        $admin_page->renderButton();
        $criteria = new CriteriaCompo();
        $criteria->setSort('cat_weight');
        $criteria->setOrder('ASC');
        $xoops->tpl()->assign('categories', $category_Handler->getObjects($criteria, true, false));
        $xoops->tpl()->assign('category', true);
        break;
    case "new":
        $admin_page->addItemButton(_PROFILE_AM_CATEGORY_LIST, 'category.php', 'application-view-detail');
        $admin_page->renderButton();
        $obj = $category_Handler->create();
        $form = $xoops->getModuleForm($obj, 'category');
        $xoops->tpl()->assign('form', $form->render());
        break;
    case "edit":
Ejemplo n.º 15
0
switch ($op) {
    case 'list':
        // Call Header
        $xoops->header('admin:system/system_blocks.tpl');
        // Define Stylesheet
        $xoops->theme()->addStylesheet('modules/system/css/admin.css');
        // Define scripts
        $xoops->theme()->addScript('modules/system/js/admin.js');
        $xoops->theme()->addScript('modules/system/js/blocks.js');
        // Define Breadcrumb and tips
        $admin_page = new \Xoops\Module\Admin();
        $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
        $admin_page->addBreadcrumbLink(SystemLocale::BLOCKS_ADMINISTRATION, $system->adminVersion('blocksadmin', 'adminpath'));
        $admin_page->addBreadcrumbLink(SystemLocale::MANAGE_BLOCKS);
        $admin_page->renderBreadcrumb();
        $admin_page->addItemButton(SystemLocale::ADD_BLOCK, 'admin.php?fct=blocksadmin&amp;op=add', 'add');
        $admin_page->renderButton();
        $admin_page->addTips(sprintf(SystemLocale::BLOCKS_TIPS, system_AdminIcons('block.png'), system_AdminIcons('success.png'), system_AdminIcons('cancel.png'), SystemLocale::DRAG_OR_SORT_BLOCK, SystemLocale::DISPLAY_BLOCK, SystemLocale::HIDE_BLOCK));
        $admin_page->renderTips();
        // Initialize module handler
        $module_handler = $xoops->getHandlerModule();
        $modules = $module_handler->getObjects(null, true);
        $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
        $criteria->add(new Criteria('isactive', 1));
        // Modules for blocks to be visible in
        $display_list = $module_handler->getNameList($criteria);
        unset($criteria);
        // Initialize blocks handler
        $block_handler = $xoops->getHandlerBlock();
        $modules = $xoops->getHandlerModule()->getObjects(null, true);
        $filterform = new Xoops\Form\ThemeForm('', 'filterform', 'admin.php', 'get');
Ejemplo n.º 16
0
             $file_arr[$count]['name'] = $filename;
             $stat = stat($filename_path);
             $file_arr[$count]['size'] = number_format($stat['size'] / 1024);
             ++$count;
             unset($filename);
         }
     }
     if (isset($file_arr)) {
         $xoops->tpl()->assign('file_arr', array_reverse($file_arr));
     }
     if ($count == 0 && $op === 'list') {
         $form = $xoops->getModuleForm(null, 'maintenance');
         $form->getDump();
         $form->display();
     } else {
         $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_FORM, 'dump.php?op=dump', 'cd');
         $admin_page->renderButton();
         $xoops->tpl()->assign('files', true);
     }
     break;
 case 'dump_save':
     // Check security
     if (!$xoops->security()->check()) {
         $xoops->redirect('dump.php', 3, implode('<br />', $xoops->security()->getErrors()));
     }
     $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_LIST, 'dump.php', 'application-view-detail');
     $admin_page->addItemButton(_AM_MAINTENANCE_DUMP_FORM, 'dump.php?op=dump', 'cd');
     $admin_page->renderButton();
     $dump_modules = isset($_REQUEST['dump_modules']) ? $_REQUEST['dump_modules'] : false;
     $dump_tables = isset($_REQUEST['dump_tables']) ? $_REQUEST['dump_tables'] : false;
     $drop = $system->cleanVars($_REQUEST, 'drop', 1, 'int');
Ejemplo n.º 17
0
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         page
 * @since           2.6.0
 * @author          Mage Grégory (AKA Mage)
 * @version         $Id$
 */
include __DIR__ . '/header.php';
// Call header
$xoops->header('admin:page/page_admin_related.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('related.php');
switch ($op) {
    case 'list':
    default:
        $admin_page->addTips(PageLocale::RELATED_TIPS);
        $admin_page->addItemButton(PageLocale::A_ADD_RELATED, 'related.php?op=new', 'add');
        $admin_page->renderTips();
        $admin_page->renderButton();
        $related_count = $related_Handler->countRelated($start, $nb_limit);
        $related_arr = $related_Handler->getRelated($start, $nb_limit);
        $xoops->tpl()->assign('related_count', $related_count);
        $xoops->tpl()->assign('related', $related_arr);
        if ($related_count > 0) {
            // Display Page Navigation
            if ($related_count > $nb_limit) {
                $nav = new XoopsPageNav($related_count, $nb_limit, $start, 'start');
                $xoops->tpl()->assign('nav_menu', $nav->renderNav(4));
            }
        } else {
            $xoops->tpl()->assign('error_message', PageLocale::E_NO_RELATED);
        }
Ejemplo n.º 18
0
        }
        break;
    case 'display':
        $imgcat_id = Request::getInt('imgcat_id', 0);
        if ($imgcat_id > 0) {
            $imgcat = $helper->getHandlerCategories()->get($imgcat_id);
            $old = $imgcat->getVar('imgcat_display');
            $imgcat->setVar('imgcat_display', !$old);
            if (!$helper->getHandlerCategories()->insert($imgcat)) {
                $error = true;
            }
        }
        break;
    case 'list':
    default:
        $admin_page->addItemButton(_AM_IMAGES_CAT_ADD, 'categories.php?op=add', 'add');
        $admin_page->renderButton();
        $categories = $helper->getHandlerCategories()->getPermittedObjects();
        foreach (array_keys($categories) as $i) {
            $imgcat_read = $gperm_handler->checkRight('imgcat_read', $categories[$i]->getVar('imgcat_id'), $groups, $xoops->module->mid());
            $imgcat_write = $gperm_handler->checkRight('imgcat_write', $categories[$i]->getVar('imgcat_id'), $groups, $xoops->module->mid());
            if ($imgcat_read || $imgcat_write) {
                $count = $helper->getHandlerImages()->countByCategory($categories[$i]->getVar('imgcat_id'));
                $cat_images = $categories[$i]->getValues();
                $cat_images['imgcat_count'] = $count;
                $xoops->tpl()->appendByRef('categories', $cat_images);
                unset($cat_images);
            }
        }
        break;
}
Ejemplo n.º 19
0
         $group_hidden = new Xoops\Form\Hidden("group", (int) $_GET['group']);
         $form->addElement($group_hidden);
     }
     $form->addElement($submit_button);
     $form->display();
 } else {
     //Display data
     // Assign Breadcrumb menu
     $admin_page = new \Xoops\Module\Admin();
     $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
     $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath'));
     $admin_page->addBreadcrumbLink(XoopsLocale::LIST_);
     $admin_page->renderBreadcrumb();
     $admin_page->addTips(SystemLocale::USERS_TIPS);
     $admin_page->renderTips();
     $admin_page->addItemButton(XoopsLocale::A_SYNCHRONIZE, 'admin.php?fct=users&amp;op=users_synchronize&amp;status=2', 'arrow-rotate-anticlockwise');
     $admin_page->addItemButton(SystemLocale::ADD_USER, 'admin.php?fct=users&amp;op=users_add', 'add');
     $admin_page->renderButton();
     $requete_search = '<br /><br /><strong>' . SystemLocale::C_SEE_SEARCH_REQUEST . '</strong><br /><br />';
     $requete_pagenav = '';
     $criteria = new CriteriaCompo();
     $value = Request::getString('user_uname', '');
     if (!empty($value)) {
         $match = Request::getInt('user_uname_match', XOOPS_MATCH_START);
         addCriteria($criteria, 'uname', $value, $match);
         $requete_pagenav .= '&amp;user_uname=' . htmlspecialchars($value) . '&amp;user_uname_match=' . $match;
         $requete_search .= 'uname : ' . $value . ' and user_uname_match=' . $match . '<br />';
     }
     $value = Request::getString('user_name', '');
     if (!empty($value)) {
         $match = Request::getInt('user_name_match', XOOPS_MATCH_START);
Ejemplo n.º 20
0
$xoops = Xoops::getInstance();
// Get Action type
$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string');
// Call header
$xoops->header('admin:profile/fieldlist.tpl');
// Get handler
/* @var $field_handler ProfileFieldHandler */
$field_handler = \Xoops::getModuleHelper('profile')->getHandler('field');
/* @var $cat_handler ProfileCategoryHandler */
$cat_handler = \Xoops::getModuleHelper('profile')->getHandler('category');
$admin_page = new \Xoops\Module\Admin();
$admin_page->renderNavigation('field.php');
switch ($op) {
    default:
    case "list":
        $admin_page->addItemButton(XoopsLocale::A_ADD . ' ' . _PROFILE_AM_FIELD, 'field.php?op=new', 'add');
        $admin_page->renderButton();
        $fields = $field_handler->getObjects(null, true, false);
        $modules = $xoops->getHandlerModule()->getObjectsArray(null, true);
        $criteria = new CriteriaCompo();
        $criteria->setSort('cat_weight');
        $cats = $cat_handler->getObjects($criteria, true);
        unset($criteria);
        $categories[0] = _PROFILE_AM_DEFAULT;
        if (count($cats) > 0) {
            foreach (array_keys($cats) as $i) {
                $categories[$cats[$i]->getVar('cat_id')] = $cats[$i]->getVar('cat_title');
            }
        }
        $xoops->tpl()->assign('categories', $categories);
        unset($categories);
Ejemplo n.º 21
0
         $user = $avatar_Handler->getUser($avatars_arr[$i]);
         if (is_array($user) && isset($user[0])) {
             $avatar_list[$i]['user'] = $user[0];
         }
     }
     $xoops->tpl()->assign('avatars_list', $avatar_list);
     // Display Page Navigation
     if ($avatar_count > $nb_avatars) {
         $nav = new XoopsPageNav($avatar_count, $nb_avatars, $start, 'start', 'op=list');
         $xoops->tpl()->assign('nav_menu', $nav->renderNav(4));
     }
     break;
     // Edit
 // Edit
 case "edit":
     $admin_page->addItemButton(AvatarsLocale::LIST_OF_AVATARS, 'avatar_custom.php', 'application-view-detail');
     $admin_page->renderButton();
     $xoops->tpl()->assign('info_msg', $xoops->alert('info', $info_msg, XoopsLocale::INFORMATION_FOR_UPLOADS));
     // Create form
     $obj = $avatar_Handler->get(Request::getInt('avatar_id', 0));
     $form = $xoops->getModuleForm($obj, 'avatar');
     // Assign form
     $xoops->tpl()->assign('form', $form->render());
     break;
     // Save
 // Save
 case "save":
     // Check security
     if (!$xoops->security()->check()) {
         $xoops->redirect('avatar_custom.php', 3, implode('<br />', $xoops->security()->getErrors()));
     }
Ejemplo n.º 22
0
             $tags['MODULE_NAME'] = 'alumni';
             $tags['ITEM_NAME'] = Request::getString('lname', '');
             $tags['ITEM_URL'] = XOOPS_URL . "/modules/{$moduleDirName}/listing.php?lid=" . $new_id;
             $notification_handler->triggerEvent('global', 0, 'newlisting', $tags);
             $notification_handler->triggerEvent('item', $new_id, 'newlisting', $tags);
         }
     }
     echo $obj->getHtmlErrors();
     $form = $xoops->getModuleForm($obj, 'listing');
     $form->display();
     break;
 case 'edit_listing':
     $xoops->header();
     $lid = Request::getInt('lid', 0);
     $indexAdmin = new Xoops\Module\Admin();
     $indexAdmin->addItemButton(AlumniLocale::ADD_LISTING, 'alumni.php?op=new_listing', 'add');
     $indexAdmin->addItemButton(AlumniLocale::LISTINGLIST, 'alumni.php', 'list');
     echo $indexAdmin->renderButton('left', '');
     $obj = $listingHandler->get($lid);
     $form = $xoops->getModuleForm($obj, 'listing');
     $form->display();
     break;
 case 'delete_listing':
     $xoops->header();
     $lid = Request::getInt('lid', 0);
     $ok = Request::getInt('ok', 0);
     $obj = $listingHandler->get($lid);
     if (isset($ok) && 1 == $ok) {
         if (!$xoops->security()->check()) {
             $xoops->redirect('alumni.php', 3, implode(',', $xoops->security()->getErrors()));
         }