Esempio n. 1
0
/**
 * Includes scripts in HTML header
 *
 * @return void
 */
function publisherCpHeader()
{
    xoops_cp_header();
    //cannot use xoTheme, some conflit with admin gui
    echo '<link type="text/css" href="' . XOOPS_URL . '/modules/system/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css" rel="stylesheet" />
    <link type="text/css" href="' . PUBLISHER_URL . '/assets/css/publisher.css" rel="stylesheet" />
    <script type="text/javascript" src="' . PUBLISHER_URL . '/assets/js/funcs.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/assets/js/cookies.js"></script>
    <script type="text/javascript" src="' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js"></script>
    <!-- <script type="text/javascript" src="' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery-migrate-1.2.1.js"></script> -->
    <script type="text/javascript" src="' . XOOPS_URL . '/browse.php?Frameworks/jquery/plugins/jquery.ui.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/assets/js/ajaxupload.3.9.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/assets/js/publisher.js"></script>
    ';
}
/**
 * xoAdminNav Smarty compiler plug-in
 *
 * @copyright    (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license          GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author           Andricq Nicolas (AKA MusS)
 * @since            2.5
 * @param $argStr
 * @param $smarty
 * @return string
 */
function smarty_compiler_xoAdminNav($argStr, &$smarty)
{
    global $xoops, $xoTheme;
    $icons = xoops_getModuleOption('typebreadcrumb', 'system');
    if ($icons == '') {
        $icons = 'default';
    }
    if (file_exists($xoops->path('modules/system/images/breadcrumb/' . $icons . '/index.html'))) {
        $url = $xoops->url('modules/system/images/breadcrumb/' . $icons . '/' . $argStr);
    } else {
        if (file_exists($xoops->path('modules/system/images/breadcrumb/default/' . $argStr))) {
            $url = $xoops->url('modules/system/images/icons/default/' . $argStr);
        }
    }
    return "\necho '" . addslashes($url) . "';";
}
Esempio n. 3
0
 /**
  * Render System BreadCrumb
  *
  */
 function render()
 {
     if (isset($GLOBALS['xoopsTpl'])) {
         $GLOBALS['xoopsTpl']->assign('xo_sys_breadcrumb', $this->_bread);
         $GLOBALS['xoopsTpl']->assign('xo_sys_help', $this->_help);
         if ($this->_tips) {
             if (xoops_getModuleOption('usetips', 'system')) {
                 $GLOBALS['xoopsTpl']->assign('xo_sys_tips', $this->_tips);
             }
         }
         // Call template
         if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $GLOBALS['xoopsConfig']['language'] . '/help/' . $this->_directory . '.html')) {
             $GLOBALS['xoopsTpl']->assign('help_content', XOOPS_ROOT_PATH . '/modules/system/language/' . $GLOBALS['xoopsConfig']['language'] . '/help/' . $this->_directory . '.html');
         } else {
             if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/english/help/' . $this->_directory . '.html')) {
                 $GLOBALS['xoopsTpl']->assign('help_content', XOOPS_ROOT_PATH . '/modules/system/language/english/help/' . $this->_directory . '.html');
             } else {
                 $GLOBALS['xoopsTpl']->assign('load_error', 1);
             }
         }
     } else {
         $out = $menu = '<style type="text/css" media="screen">@import ' . XOOPS_URL . '/modules/system/css/menu.css;</style>';
         $out .= '<ul id="xo-breadcrumb">';
         foreach ($this->_bread as $menu) {
             if ($menu['home']) {
                 $out .= '<li><a href="' . $menu['link'] . '" title="' . $menu['title'] . '"><img src="images/home.png" alt="' . $menu['title'] . '" class="home" /></a></li>';
             } else {
                 if ($menu['link'] != '') {
                     $out .= '<li><a href="' . $menu['link'] . '" title="' . $menu['title'] . '">' . $menu['title'] . '</a></li>';
                 } else {
                     $out .= '<li>' . $menu['title'] . '</li>';
                 }
             }
         }
         $out .= '</ul>';
         if ($this->_tips) {
             $out .= '<div class="tips">' . $this->_tips . '</div>';
         }
         echo $out;
     }
 }
Esempio n. 4
0
     $i = 0;
     foreach (array_keys($avatars) as $i) {
         $avatar_list[$i] = $avatars[$i]->toArray();
         $avatar_list[$i]['type'] = $type;
         $avatar_list[$i]['count'] = count($avt_handler->getUser($avatars[$i]));
         if ($type == 'c') {
             $user = $avt_handler->getUser($avatars[$i]);
             if (is_array($user) && isset($user[0])) {
                 $avatar_list[$i]['user'] = $user[0];
             }
         }
     }
     $xoopsTpl->assign('avatars_list', $avatar_list);
     // Display Page Navigation
     if ($avtcount > xoops_getModuleOption('avatars_pager')) {
         $nav = new XoopsPageNav($avtcount, xoops_getModuleOption('avatars_pager', 'system'), $start, 'start', 'fct=avatars&amp;type=' . $type . '&amp;op=listavt');
         $xoopsTpl->assign('nav_menu', $nav->renderImageNav());
     }
     // Call Footer
     xoops_cp_footer();
     break;
 case 'edit':
     // Define main template
     $xoopsOption['template_main'] = 'system_avatars.html';
     // Call Header
     xoops_cp_header();
     // Define Stylesheet
     $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
     // Define Breadcrumb and tips
     $xoBreadCrumb->addLink(_AM_SYSTEM_AVATAR_MANAGER, system_adminVersion('avatars', 'adminpath'));
     $xoBreadCrumb->addLink(_AM_SYSTEM_AVATAR_EDIT);
Esempio n. 5
0
 /**
  * @param string $mode
  *
  * @return XoopsThemeForm
  */
 function getForm($mode = 'edit')
 {
     if ($this->isNew()) {
         $title = _AM_SYSTEM_BLOCKS_ADDBLOCK;
         $modules = array(-1);
         $groups = array(XOOPS_GROUP_USERS, XOOPS_GROUP_ANONYMOUS, XOOPS_GROUP_ADMIN);
         $this->setVar('block_type', 'C');
         $this->setVar('visible', 1);
         $op = 'save';
     } else {
         // Search modules
         $blocklinkmodule_handler =& xoops_getmodulehandler('blocklinkmodule');
         $criteria = new CriteriaCompo(new Criteria('block_id', $this->getVar('bid')));
         $blocklinkmodule = $blocklinkmodule_handler->getObjects($criteria);
         foreach ($blocklinkmodule as $link) {
             $modules[] = $link->getVar('module_id');
         }
         // Saerch perms
         $groupperm_handler =& xoops_gethandler('groupperm');
         $groups =& $groupperm_handler->getGroupIds('block_read', $this->getVar('bid'));
         switch ($mode) {
             case 'edit':
                 $title = _AM_SYSTEM_BLOCKS_EDITBLOCK;
                 break;
             case 'clone':
                 $title = _AM_SYSTEM_BLOCKS_CLONEBLOCK;
                 $this->setVar('bid', 0);
                 if ($this->isCustom()) {
                     $this->setVar('block_type', 'C');
                 } else {
                     $this->setVar('block_type', 'D');
                 }
                 break;
         }
         $op = 'save';
     }
     $form = new XoopsThemeForm($title, 'blockform', 'admin.php', 'post', true);
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $this->getVar('name')));
     }
     // Side position
     $side_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'side', $this->getVar('side'));
     $side_select->addOptionArray(array(0 => _AM_SYSTEM_BLOCKS_SBLEFT, 1 => _AM_SYSTEM_BLOCKS_SBRIGHT, 3 => _AM_SYSTEM_BLOCKS_CBLEFT, 4 => _AM_SYSTEM_BLOCKS_CBRIGHT, 5 => _AM_SYSTEM_BLOCKS_CBCENTER, 7 => _AM_SYSTEM_BLOCKS_CBBOTTOMLEFT, 8 => _AM_SYSTEM_BLOCKS_CBBOTTOMRIGHT, 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM));
     $form->addElement($side_select);
     // Order
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_WEIGHT, 'weight', 2, 5, $this->getVar('weight')));
     // Display
     $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_BLOCKS_VISIBLE, 'visible', $this->getVar('visible')));
     // Visible In
     $mod_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_VISIBLEIN, 'modules', $modules, 5, true);
     $module_handler =& xoops_gethandler('module');
     $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
     $criteria->add(new Criteria('isactive', 1));
     $module_list = $module_handler->getList($criteria);
     $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE;
     $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES;
     ksort($module_list);
     $mod_select->addOptionArray($module_list);
     $form->addElement($mod_select);
     // Title
     $form->addElement(new XoopsFormText(_AM_SYSTEM_BLOCKS_TITLE, 'title', 50, 255, $this->getVar('title')), false);
     if ($this->isNew() || $this->isCustom()) {
         $editor_configs = array();
         $editor_configs["name"] = "content_block";
         $editor_configs["value"] = $this->getVar('content', 'e');
         $editor_configs["rows"] = 20;
         $editor_configs["cols"] = 100;
         $editor_configs["width"] = "100%";
         $editor_configs["height"] = "400px";
         $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system');
         $form->addElement(new XoopsFormEditor(_AM_SYSTEM_BLOCKS_CONTENT, "content_block", $editor_configs), true);
         if (in_array($editor_configs["editor"], array('dhtmltextarea', 'textarea'))) {
             $ctype_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'c_type', $this->getVar('c_type'));
             $ctype_select->addOptionArray(array('H' => _AM_SYSTEM_BLOCKS_HTML, 'P' => _AM_SYSTEM_BLOCKS_PHP, 'S' => _AM_SYSTEM_BLOCKS_AFWSMILE, 'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE));
             $form->addElement($ctype_select);
         } else {
             $form->addElement(new XoopsFormHidden('c_type', 'H'));
         }
     } else {
         if ($this->getVar('template') != '') {
             $tplfile_handler =& xoops_gethandler('tplfile');
             $btemplate = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $this->getVar('bid'));
             if (count($btemplate) > 0) {
                 $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
             } else {
                 $btemplate2 = $tplfile_handler->find('default', 'block', $this->getVar('bid'));
                 if (count($btemplate2) > 0) {
                     $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $btemplate2[0]->getVar('tpl_id') . '" rel="external">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>'));
                 }
             }
         }
         if ($this->getOptions() != false) {
             $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $this->getOptions()));
         } else {
             $form->addElement(new XoopsFormHidden('options', $this->getVar('options')));
         }
         $form->addElement(new XoopsFormHidden('c_type', 'H'));
     }
     $cache_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $this->getVar('bcachetime'));
     $cache_select->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK, '2592000' => _MONTH));
     $form->addElement($cache_select);
     // Groups
     $form->addElement(new XoopsFormSelectGroup(_AM_SYSTEM_BLOCKS_GROUP, 'groups', true, $groups, 5, true));
     $form->addElement(new XoopsFormHidden('block_type', $this->getVar('block_type')));
     $form->addElement(new XoopsFormHidden('mid', $this->getVar('mid')));
     $form->addElement(new XoopsFormHidden('func_num', $this->getVar('func_num')));
     $form->addElement(new XoopsFormHidden('func_file', $this->getVar('func_file')));
     $form->addElement(new XoopsFormHidden('show_func', $this->getVar('show_func')));
     $form->addElement(new XoopsFormHidden('edit_func', $this->getVar('edit_func')));
     $form->addElement(new XoopsFormHidden('template', $this->getVar('template')));
     $form->addElement(new XoopsFormHidden('dirname', $this->getVar('dirname')));
     $form->addElement(new XoopsFormHidden('name', $this->getVar('name')));
     $form->addElement(new XoopsFormHidden('bid', $this->getVar('bid')));
     $form->addElement(new XoopsFormHidden('op', $op));
     $form->addElement(new XoopsFormHidden('fct', 'blocksadmin'));
     $button_tray = new XoopsFormElementTray('', '&nbsp;');
     if ($this->isNew() || $this->isCustom()) {
         $preview = new XoopsFormButton('', 'previewblock', _PREVIEW, 'preview');
         $preview->setExtra("onclick=\"blocks_preview();\"");
         $button_tray->addElement($preview);
     }
     $button_tray->addElement(new XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'));
     $form->addElement($button_tray);
     return $form;
 }
Esempio n. 6
0
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author              Cointin Maxime (AKA Kraven30)
 * @package             system
 */
require_once XOOPS_ROOT_PATH . '/modules/system/class/maintenance.php';
// Check users rights
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
    exit(_NOPERM);
}
//  Check is active
if (!xoops_getModuleOption('active_maintenance', 'system')) {
    redirect_header('admin.php', 2, _AM_SYSTEM_NOTACTIVE);
}
// Get Action type
$op = system_CleanVars($_REQUEST, 'op', 'list', 'string');
// Define main template
$GLOBALS['xoopsOption']['template_main'] = 'system_maintenance.tpl';
// Call Header
xoops_cp_header();
// Define Stylesheet
$xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
// Define scripts
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$xoTheme->addScript('modules/system/js/admin.js');
switch ($op) {
    case 'list':
Esempio n. 7
0
 /**
  * @param string $title
  * @param string $name
  * @param string $action
  * @param string $method
  * @param bool   $addtoken
  * @param string $summary
  */
 public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '')
 {
     //        global $xoTheme;
     //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.core.js');
     //        $GLOBALS['xoTheme']->addScript(PUBLISHER_URL . '/assets/js/ui.tabs.js');
     //        $GLOBALS['xoTheme']->addStylesheet(PUBLISHER_URL . '/assets/css/jquery-ui-1.7.1.custom.css');
     $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
     $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . '/modules/system/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css');
     $this->title = $title;
     $this->name = $name;
     $this->action = $action;
     $this->method = $method;
     $this->summary = $summary;
     if ($addtoken !== false) {
         $this->addElement(new XoopsFormHiddenToken());
     }
 }
Esempio n. 8
0
 $order = "DESC";
 if (isset($_REQUEST['user_order']) && $_REQUEST['user_order'] == "ASC") {
     $requete_pagenav .= '&amp;user_order=ASC';
     $requete_search .= 'tris : ' . $order . '<br />';
 } else {
     //$order = "ASC";
     $requete_pagenav .= '&amp;user_order=DESC';
     $requete_search .= 'tris : ' . $order . '<br />';
 }
 $user_limit = xoops_getModuleOption('users_pager', 'system');
 if (isset($_REQUEST['user_limit'])) {
     $user_limit = $_REQUEST['user_limit'];
     $requete_pagenav .= '&amp;user_limit=' . htmlspecialchars($_REQUEST['user_limit']);
     $requete_search .= 'limit : ' . $user_limit . '<br />';
 } else {
     $requete_pagenav .= '&amp;user_limit=' . xoops_getModuleOption('users_pager', 'system');
     $requete_search .= 'limit : ' . $user_limit . '<br />';
 }
 $start = !empty($_REQUEST['start']) ? intval($_REQUEST['start']) : 0;
 if (isset($_REQUEST['selgroups'])) {
     if ($_REQUEST['selgroups'] != 0) {
         if (count($_REQUEST['selgroups']) == 1) {
             $groups = array(0 => $_REQUEST['selgroups']);
         } else {
             $groups = array_map("intval", $_REQUEST['selgroups']);
         }
     } else {
         $groups = array();
     }
     $requete_pagenav .= '&amp;selgroups=' . htmlspecialchars($_REQUEST['selgroups']);
 } else {
Esempio n. 9
0
}
// Parameters
$nb_aff = xoops_getModuleOption('banners_pager', 'system');
// Classes
$banner_Handler = xoops_getModuleHandler('banner', 'system');
$banner_finish_Handler = xoops_getModuleHandler('bannerfinish', 'system');
$banner_client_Handler = xoops_getModuleHandler('bannerclient', 'system');
// Get Action type
$op = system_CleanVars($_REQUEST, 'op', 'default', 'string');
// Define template
$GLOBALS['xoopsOption']['template_main'] = 'system_banners.tpl';
// Call header
xoops_cp_header();
// Define Stylesheet
$xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
$xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css');
// Define scripts
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
$xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.tablesorter.js');
$xoTheme->addScript('modules/system/js/admin.js');
// Define Breadcrumb and tips
$xoBreadCrumb->addLink(_AM_SYSTEM_BANNERS_NAV_MANAGER, system_adminVersion('banners', 'adminpath'));
switch ($op) {
    // Banners
    case 'banner_save':
        // Save banner
        if (!$GLOBALS['xoopsSecurity']->check()) {
            redirect_header('admin.php?fct=banners', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
        }
        $bid = system_CleanVars($_POST, 'bid', 0, 'int');
Esempio n. 10
0
 /**
  * @param bool $action
  *
  * @return XoopsThemeForm
  */
 public function getForm($action = false)
 {
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     if ($this->isNew()) {
         $s_cat_value = '';
         $a_mod_value = array();
         $r_mod_value = array();
         $r_block_value = array();
     } else {
         $sysperm_handler = xoops_getHandler('groupperm');
         $s_cat_value = $sysperm_handler->getItemIds('system_admin', $this->getVar('groupid'));
         $member_handler = xoops_getHandler('member');
         $thisgroup = $member_handler->getGroup($this->getVar('groupid'));
         $moduleperm_handler = xoops_getHandler('groupperm');
         $a_mod_value = $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid'));
         $r_mod_value = $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid'));
         $gperm_handler = xoops_getHandler('groupperm');
         $r_block_value = $gperm_handler->getItemIds('block_read', $this->getVar('groupid'));
     }
     xoops_load('XoopsFormLoader');
     xoops_load('XoopsLists');
     include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
     $title = $this->isNew() ? sprintf(_AM_SYSTEM_GROUPS_ADD) : sprintf(_AM_SYSTEM_GROUPS_EDIT);
     $form = new XoopsThemeForm($title, 'groupform', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $name_text = new XoopsFormText(_AM_SYSTEM_GROUPS_NAME, 'name', 30, 50, $this->getVar('name'));
     $desc_text = new XoopsFormTextArea(_AM_SYSTEM_GROUPS_DESCRIPTION, 'desc', $this->getVar('description'));
     $system_catids = new XoopsFormElementTray(_AM_SYSTEM_GROUPS_SYSTEMRIGHTS, '');
     $s_cat_checkbox_all = new XoopsFormCheckBox('', 'catbox', 1);
     $s_cat_checkbox_all->addOption('allbox', _AM_SYSTEM_ALL);
     $s_cat_checkbox_all->setExtra(" onclick='xoopsCheckGroup(\"groupform\", \"catbox\" , \"system_catids[]\");' ");
     $s_cat_checkbox_all->setClass('xo-checkall');
     $system_catids->addElement($s_cat_checkbox_all);
     $s_cat_checkbox = new XoopsFormCheckBox('', 'system_catids', $s_cat_value);
     $s_cat_checkbox->columns = 6;
     $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin/';
     $dirlist = XoopsLists::getDirListAsArray($admin_dir);
     foreach ($dirlist as $file) {
         include XOOPS_ROOT_PATH . '/modules/system/admin/' . $file . '/xoops_version.php';
         if (!empty($modversion['category'])) {
             if (xoops_getModuleOption('active_' . $file, 'system') == 1) {
                 $s_cat_checkbox->addOption($modversion['category'], $modversion['name']);
             }
         }
         unset($modversion);
     }
     unset($dirlist);
     $system_catids->addElement($s_cat_checkbox);
     $admin_mids = new XoopsFormElementTray(_AM_SYSTEM_GROUPS_ACTIVERIGHTS, '');
     $s_admin_checkbox_all = new XoopsFormCheckBox('', 'adminbox', 1);
     $s_admin_checkbox_all->addOption('allbox', _AM_SYSTEM_ALL);
     $s_admin_checkbox_all->setExtra(" onclick='xoopsCheckGroup(\"groupform\", \"adminbox\" , \"admin_mids[]\");' ");
     $s_admin_checkbox_all->setClass('xo-checkall');
     $admin_mids->addElement($s_admin_checkbox_all);
     $a_mod_checkbox = new XoopsFormCheckBox('', 'admin_mids[]', $a_mod_value);
     $a_mod_checkbox->columns = 5;
     $module_handler = xoops_getHandler('module');
     $criteria = new CriteriaCompo(new Criteria('hasadmin', 1));
     $criteria->add(new Criteria('isactive', 1));
     $criteria->add(new Criteria('dirname', 'system', '<>'));
     $a_mod_checkbox->addOptionArray($module_handler->getList($criteria));
     $admin_mids->addElement($a_mod_checkbox);
     $read_mids = new XoopsFormElementTray(_AM_SYSTEM_GROUPS_ACCESSRIGHTS, '');
     $s_mod_checkbox_all = new XoopsFormCheckBox('', 'readbox', 1);
     $s_mod_checkbox_all->addOption('allbox', _AM_SYSTEM_ALL);
     $s_mod_checkbox_all->setExtra(" onclick='xoopsCheckGroup(\"groupform\", \"readbox\" , \"read_mids[]\");' ");
     $s_mod_checkbox_all->setClass('xo-checkall');
     $read_mids->addElement($s_mod_checkbox_all);
     $r_mod_checkbox = new XoopsFormCheckBox('', 'read_mids[]', $r_mod_value);
     $r_mod_checkbox->columns = 5;
     $criteria = new CriteriaCompo(new Criteria('hasmain', 1));
     $criteria->add(new Criteria('isactive', 1));
     $r_mod_checkbox->addOptionArray($module_handler->getList($criteria));
     $read_mids->addElement($r_mod_checkbox);
     $criteria = new CriteriaCompo(new Criteria('isactive', 1));
     $criteria->setSort('mid');
     $criteria->setOrder('ASC');
     $module_list = $module_handler->getList($criteria);
     $module_list[0] = _AM_SYSTEM_GROUPS_CUSTOMBLOCK;
     $block_handler = xoops_getHandler('block');
     $blocks_obj = $block_handler->getObjects(new Criteria('mid', "('" . implode("', '", array_keys($module_list)) . "')", 'IN'), true);
     $blocks_module = array();
     foreach (array_keys($blocks_obj) as $bid) {
         $title = $blocks_obj[$bid]->getVar('title');
         $blocks_module[$blocks_obj[$bid]->getVar('mid')][$blocks_obj[$bid]->getVar('bid')] = empty($title) ? $blocks_obj[$bid]->getVar('name') : $title;
     }
     ksort($blocks_module);
     $r_block_tray = new XoopsFormElementTray(_AM_SYSTEM_GROUPS_BLOCKRIGHTS, '<br><br>');
     $s_checkbox_all = new XoopsFormCheckBox('', 'blocksbox', 1);
     $s_checkbox_all->addOption('allbox', _AM_SYSTEM_ALL);
     $s_checkbox_all->setExtra(" onclick='xoopsCheckGroup(\"groupform\", \"blocksbox\" , \"read_bids[]\");' ");
     $s_checkbox_all->setClass('xo-checkall');
     $r_block_tray->addElement($s_checkbox_all);
     foreach (array_keys($blocks_module) as $mid) {
         $new_blocks_array = array();
         foreach ($blocks_module[$mid] as $key => $value) {
             $new_blocks_array[$key] = "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=blocksadmin&amp;op=edit&amp;bid={$key}' title='ID: {$key}' rel='external'>{$value}</a>";
         }
         $r_block_checkbox = new XoopsFormCheckBox('<strong>' . $module_list[$mid] . '</strong><br>', 'read_bids[]', $r_block_value);
         $r_block_checkbox->columns = 5;
         $r_block_checkbox->addOptionArray($new_blocks_array);
         $r_block_tray->addElement($r_block_checkbox);
         unset($r_block_checkbox);
     }
     if (!$this->isNew()) {
         $form->addElement(new XoopsFormHidden('g_id', $this->getVar('groupid')));
         $form->addElement(new XoopsFormHidden('op', 'groups_save_update'));
     } else {
         $form->addElement(new XoopsFormHidden('op', 'groups_save_add'));
     }
     $form->addElement($name_text, true);
     $form->addElement($desc_text);
     $form->addElement($system_catids);
     $form->addElement($admin_mids);
     $form->addElement($read_mids);
     $form->addElement($r_block_tray);
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     return $form;
 }
Esempio n. 11
0
$cform->addElement(new XoopsFormText(_CM_TITLE, 'com_title', 50, 255, $com_title), true);
// Start add by voltan
if (!($com_user == '' && $com_email == '') || !$xoopsUser) {
    $cform->addElement(new XoopsFormText(_CM_USER, 'com_user', 50, 60, $com_user), true);
    $cform->addElement(new XoopsFormText(_CM_EMAIL, 'com_email', 50, 60, $com_email), true);
    $cform->addElement(new XoopsFormText(_CM_URL, 'com_url', 50, 60, $com_url), false);
}
// End add by voltan
$icons_radio = new XoopsFormRadio(_MESSAGEICON, 'com_icon', $com_icon);
$subject_icons = XoopsLists::getSubjectsList();
foreach ($subject_icons as $iconfile) {
    $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
// editor
$editor = xoops_getModuleOption('comments_editor', 'system');
if (class_exists('XoopsFormEditor')) {
    $configs = array('name' => 'com_text', 'value' => $com_text, 'rows' => 25, 'cols' => 90, 'width' => '100%', 'height' => '400px', 'editor' => $editor);
    $cform->addElement(new XoopsFormEditor(_CM_MESSAGE, 'com_text', $configs, false, $onfailure = 'textarea'));
} else {
    $cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'com_text', $com_text, 10, 50), true);
}
$option_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
$button_tray = new XoopsFormElementTray('', '&nbsp;');
if (is_object($xoopsUser)) {
    if (isset($xoopsModuleConfig['com_anonpost'])) {
        if ($xoopsModuleConfig['com_anonpost'] == 1) {
            $noname = !empty($noname) ? 1 : 0;
            $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
            $noname_checkbox->addOption(1, _POSTANON);
            $option_tray->addElement($noname_checkbox);
Esempio n. 12
0
 $all_ok = false;
 if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
     $sysperm_handler =& xoops_gethandler('groupperm');
     $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
 } else {
     $all_ok = true;
 }
 xoops_load('xoopslists');
 $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin';
 $dirlist = XoopsLists::getDirListAsArray($admin_dir);
 $inactive_section = array('blocksadmin', 'groups', 'modulesadmin', 'preferences', 'tplsets');
 foreach ($dirlist as $directory) {
     if (file_exists($admin_dir . '/' . $directory . '/xoops_version.php')) {
         require $admin_dir . '/' . $directory . '/xoops_version.php';
         if ($modversion['hasAdmin']) {
             if (xoops_getModuleOption('active_' . $directory)) {
                 $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
                 if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
                     $menu['file'] = $directory;
                     $menu['title'] = trim($modversion['name']);
                     $menu['desc'] = str_replace('<br />', ' ', $modversion['description']);
                     $menu['icon'] = $modversion['image'];
                     $menu['status'] = true;
                 }
             } else {
                 $category = isset($modversion['category']) ? intval($modversion['category']) : 0;
                 if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) {
                     $menu['file'] = $directory;
                     $menu['title'] = trim($modversion['name']);
                     $menu['desc'] = str_replace('<br />', ' ', $modversion['description']);
                     $menu['icon'] = $modversion['image'];
Esempio n. 13
0
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
// Check users rights
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
    exit(_NOPERM);
}
//  Check is active
if (!xoops_getModuleOption('active_smilies', 'system')) {
    redirect_header('admin.php', 2, _AM_SYSTEM_NOTACTIVE);
}
// Parameters
$nb_smilies = xoops_getModuleOption('smilies_pager', 'system');
$mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
$upload_size = 500000;
// Get Action type
$op = system_CleanVars($_REQUEST, 'op', 'list', 'string');
// Get smilies handler
$smilies_Handler =& xoops_getModuleHandler("smilies", "system");
// Define main template
$xoopsOption['template_main'] = 'system_smilies.html';
// Call Header
xoops_cp_header();
$xoBreadCrumb->addLink(_AM_SYSTEM_SMILIES_NAV_MANAGER, system_adminVersion('smilies', 'adminpath'));
switch ($op) {
    case 'list':
    default:
        // Define Stylesheet
Esempio n. 14
0
     $comments_module = $_REQUEST['comments_module'];
 }
 $comments_status = system_CleanVars($_REQUEST, 'comments_status', 0, 'int');
 if ($comments_status > 0) {
     $criteria->add(new Criteria('com_status', $comments_status));
     $comments_status = $_REQUEST['comments_status'];
 }
 $criteria->setSort('com_created');
 $criteria->setOrder('DESC');
 $comments_count = $comments_Handler->getCount($criteria);
 $xoopsTpl->assign('comments_count', $comments_count);
 if ($comments_count > 0) {
     $comments_start = system_CleanVars($_REQUEST, 'comments_start', 0, 'int');
     $comments_limit = system_CleanVars($_REQUEST, 'comments_limit', 0, 'int');
     if (!in_array($comments_limit, $limit_array)) {
         $comments_limit = xoops_getModuleOption('comments_pager', 'system');
     }
     $criteria->setLimit($comments_limit);
     $criteria->setStart($comments_start);
     $comments_arr = $comments_Handler->getObjects($criteria, true);
 }
 $form = '<form action="admin.php?fct=comments" method="post">
         <select name="comments_module">';
 foreach ($module_array as $k => $v) {
     $sel = '';
     if ($k == $module) {
         $sel = ' selected="selected"';
     }
     $form .= '<option value="' . $k . '"' . $sel . '>' . $v . '</option>';
 }
 $form .= '</select>&nbsp;<select name="comments_status">';
 function form_edit($bid, $mode = 'edit')
 {
     $bid = intval($bid);
     //HACK by domifara
     $block = new XoopsBlock($bid);
     if (!$block->getVar('bid')) {
         // new defaults
         $bid = 0;
         $mode = 'new';
         $block->setVar('mid', 0);
         $block->setVar('block_type', 'C');
     }
     switch ($mode) {
         case 'clone':
             $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE;
             $next_op = 'clone_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM);
             break;
         case 'new':
             $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW;
             $next_op = 'new_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM);
             break;
         case 'edit':
         default:
             $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT;
             $next_op = 'edit_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM);
             break;
     }
     $is_custom = in_array($block->getVar('block_type'), array('C', 'E')) ? true : false;
     $block_template = $block->getVar('template', 'n');
     $block_template_tplset = '';
     if (!$is_custom && $block_template) {
         // find template of the block
         $tplfile_handler =& xoops_gethandler('tplfile');
         $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template);
         $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default';
     }
     //HACK by domifara
     /*
     	if ( !($block->getVar('c_type')) ){
     		$block->setVar('c_type','S');
     	}
     */
     $block_data = $this->preview_request + array('bid' => $bid, 'name' => $block->getVar('name', 'n'), 'title' => $block->getVar('title', 'n'), 'weight' => intval($block->getVar('weight')), 'bcachetime' => intval($block->getVar('bcachetime')), 'side' => intval($block->getVar('side')), 'visible' => intval($block->getVar('visible')), 'template' => $block_template, 'template_tplset' => $block_template_tplset, 'options' => $block->getVar('options'), 'content' => $block->getVar('content', 'n'), 'is_custom' => $is_custom, 'type' => $block->getVar('block_type'), 'ctype' => $block->getVar('c_type'));
     $block4assign = array('name_raw' => $block_data['name'], 'title_raw' => $block_data['title'], 'content_raw' => $block_data['content'], 'cell_position' => $this->renderCell4BlockPosition($block_data), 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), 'cell_options' => $this->renderCell4BlockOptions($block_data), 'content_preview' => $this->previewContent($block_data)) + $block_data;
     // display
     require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
     $tpl = new D3Tpl();
     //dhtml
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     if ($block_data['ctype'] == 'H' || empty($block_data['ctype'])) {
         $editor_configs = array();
         $editor_configs["name"] = "content_block";
         $editor_configs["value"] = $block_data['content'];
         $editor_configs["rows"] = 20;
         $editor_configs["cols"] = 100;
         $editor_configs["width"] = "100%";
         $editor_configs["height"] = "400px";
         $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system');
         $form = new XoopsFormEditor('', "textarea_content", $editor_configs);
         $rendered = $form->render();
         $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
     } else {
         $form = new XoopsFormDhtmlTextArea('', 'textarea_content', $block_data['content'], 80, 20);
         $rendered = $form->render();
         $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">' . str_replace(array('<textarea', '</textarea><br />'), array('</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'), $rendered) . '</div>';
         $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
     }
     $tpl->assign(array('target_dirname' => $this->target_dirname, 'target_mname' => $this->target_mname, 'language' => $this->lang, 'cachetime_options' => $this->cachetime_options, 'ctype_options' => $this->ctype_options, 'block' => $block4assign, 'op' => $next_op, 'form_title' => $form_title, 'submit_button' => $button_value, 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'), 'gticket_hidden' => $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'myblocksadmin')));
     //HACK by domifara
     $tpl->display('db:altsys_main_myblocksadmin_edit_4x25.html');
     return;
 }
Esempio n. 16
0
$all_ok = false;
if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
    $sysperm_handler = xoops_getHandler('groupperm');
    $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
} else {
    $all_ok = true;
}
require_once $GLOBALS['xoops']->path('/class/xoopslists.php');
// include system category definitions
include_once $GLOBALS['xoops']->path('/modules/system/constants.php');
$admin_dir = $GLOBALS['xoops']->path('/modules/system/admin');
$dirlist = XoopsLists::getDirListAsArray($admin_dir);
$index = 0;
foreach ($dirlist as $file) {
    if (file_exists($admin_dir . '/' . $file . '/xoops_version.php')) {
        include $admin_dir . '/' . $file . '/xoops_version.php';
        if ($modversion['hasAdmin']) {
            if (xoops_getModuleOption('active_' . $file, 'system')) {
                $category = isset($modversion['category']) ? (int) $modversion['category'] : 0;
                if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
                    $adminmenu[$index]['title'] = trim($modversion['name']);
                    $adminmenu[$index]['link'] = 'admin.php?fct=' . $file;
                    $adminmenu[$index]['image'] = $modversion['image'];
                }
            }
        }
        unset($modversion);
    }
    ++$index;
}
unset($dirlist);
Esempio n. 17
0
// GNU General Public License for more details.                             //
// //
// You should have received a copy of the GNU General Public License        //
// along with this program; if not, write to the Free Software              //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
// ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
// Check users rights
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
    exit(_NOPERM);
}
// Parameters
$nb_group = xoops_getModuleOption('groups_pager', 'system');
// Get Action type
$op = system_CleanVars($_REQUEST, 'op', 'list', 'string');
// Get groups handler
$groups_Handler =& xoops_getModuleHandler("group", "system");
$member_handler =& xoops_gethandler('member');
// Define main template
$xoopsOption['template_main'] = 'system_groups.html';
// Call Header
xoops_cp_header();
$xoBreadCrumb->addLink(_AM_SYSTEM_GROUPS_NAV_MANAGER, system_adminVersion('groups', 'adminpath'));
switch ($op) {
    case 'list':
    default:
        // Define Stylesheet
        $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
Esempio n. 18
0
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
 * wgTeams module for xoops
 *
 * @copyright       The XOOPS Project (http://xoops.org)
 * @license         GPL 2.0 or later
 * @package         wgteams
 * @since           1.0
 * @min_xoops       2.5.7
 * @author          Goffy - Wedega.com - Email:<*****@*****.**> - Website:<http://wedega.com>
 * @version         $Id: 1.0 footer.php 1 Sun 2015/12/27 23:18:01Z Goffy - Wedega $
 */
if (count($xoBreadcrumbs) > 1) {
    $GLOBALS['xoopsTpl']->assign('xoBreadcrumbs', $xoBreadcrumbs);
}
$sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16');
$sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32');
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
$GLOBALS['xoopsTpl']->assign('wgteams_url', WGTEAMS_URL);
$GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', $dirname));
//
$GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', $dirname));
$GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', $dirname));
//
$GLOBALS['xoopsTpl']->assign('admin', WGTEAMS_ADMIN);
$GLOBALS['xoopsTpl']->assign('copyright', $copyright);
// User footer
include_once XOOPS_ROOT_PATH . '/footer.php';
Esempio n. 19
0
 $all_ok = false;
 if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
     $sysperm_handler = xoops_getHandler('groupperm');
     $ok_syscats = $sysperm_handler->getItemIds('system_admin', $groups);
 } else {
     $all_ok = true;
 }
 xoops_load('xoopslists');
 $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin';
 $dirlist = XoopsLists::getDirListAsArray($admin_dir);
 $inactive_section = array('blocksadmin', 'groups', 'modulesadmin', 'preferences', 'tplsets');
 foreach ($dirlist as $directory) {
     if (file_exists($admin_dir . '/' . $directory . '/xoops_version.php')) {
         require $admin_dir . '/' . $directory . '/xoops_version.php';
         if ($modversion['hasAdmin']) {
             if (xoops_getModuleOption('active_' . $directory, 'system')) {
                 $category = isset($modversion['category']) ? (int) $modversion['category'] : 0;
                 if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
                     $menu['file'] = $directory;
                     $menu['title'] = trim($modversion['name']);
                     $menu['desc'] = str_replace('<br>', ' ', $modversion['description']);
                     $menu['icon'] = $modversion['image'];
                     $menu['status'] = true;
                 }
             } else {
                 $category = isset($modversion['category']) ? (int) $modversion['category'] : 0;
                 if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
                     $menu['file'] = $directory;
                     $menu['title'] = trim($modversion['name']);
                     $menu['desc'] = str_replace('<br>', ' ', $modversion['description']);
                     $menu['icon'] = $modversion['image'];
Esempio n. 20
0
// ------------------------------------------------------------------------- //
/**
 * Manage user rank.
 * @copyright XOOPS Project
 * @TODO Fix register_globals!
 */
// Check users rights
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
    exit(_NOPERM);
}
//  Check is active
if (!xoops_getModuleOption('active_userrank', 'system')) {
    redirect_header('admin.php', 2, _AM_SYSTEM_NOTACTIVE);
}
// Parameters
$nb_rank = xoops_getModuleOption('userranks_pager', 'system');
$mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
$upload_size = 500000;
// Get Action type
$op = system_CleanVars($_REQUEST, 'op', 'list', 'string');
// Get userrank handler
$userrank_Handler =& xoops_getModuleHandler("userrank", "system");
// Define main template
$xoopsOption['template_main'] = 'system_userrank.html';
// Call Header
xoops_cp_header();
switch ($op) {
    case 'list':
    default:
        // Define Stylesheet
        $xoTheme->addStylesheet(XOOPS_URL . '/modules/system/css/admin.css');
Esempio n. 21
0
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
// Check users rights
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
    exit(_NOPERM);
}
//  Check is active
if (!xoops_getModuleOption('active_users', 'system')) {
    redirect_header('admin.php', 2, _AM_SYSTEM_NOTACTIVE);
}
/*********************************************************/
/* Users Functions                                       */
/*********************************************************/
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
//Display form add or edit
//true = add and false = edit
/**
 * @param        $add_or_edit
 * @param string $user
 */
function form_user($add_or_edit, $user = '')
{
Esempio n. 22
0
 $criteria->setOrder('DESC');
 $imgcount = $image_handler->getCount($criteria);
 $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
 $criteria->setStart($start);
 $criteria->setLimit(xoops_getModuleOption('images_pager', 'system'));
 $images = $image_handler->getObjects($criteria, true, false);
 if ($imagecategory->getVar('imgcat_storetype') == 'db') {
     $xoopsTpl->assign('db_store', 1);
 }
 foreach (array_keys($images) as $i) {
     $xoopsTpl->append_by_ref('images', $images[$i]->toArray());
 }
 if ($imgcount > 0) {
     if ($imgcount > xoops_getModuleOption('images_pager', 'system')) {
         //include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
         $nav = new XoopsPageNav($imgcount, xoops_getModuleOption('images_pager', 'system'), $start, 'start', 'fct=images&amp;op=listimg&amp;imgcat_id=' . $imgcat_id);
         $xoopsTpl->assign('nav_menu', $nav->renderImageNav());
     }
 }
 if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $GLOBALS['xoopsConfig']['language'] . '/images/lightbox-btn-close.gif')) {
     $xoopsTpl->assign('xoops_language', $GLOBALS['xoopsConfig']['language']);
 } else {
     $xoopsTpl->assign('xoops_language', 'english');
 }
 $xoopsTpl->assign('listimg', true);
 // Image Form
 $form = new XoopsThemeForm(_ADDIMAGE, 'image_form', 'admin.php', 'post', true);
 $form->setExtra('enctype="multipart/form-data"');
 $form->addElement(new XoopsFormText(_IMAGENAME, 'image_nicename', 50, 255), true);
 $select = new XoopsFormSelect(_IMAGECAT, 'imgcat_id', $imgcat_id);
 $select->addOptionArray($imgcat_handler->getList($groups, 'imgcat_write'));