Beispiel #1
0
 $user_group = $member_handler->getGroupsByUser($users_arr[$i]->getVar("uid"));
 if (in_array("1", $user_group)) {
     $users['group'] = system_AdminIcons('xoops/group_1.png');
     //$users['icon'] = '<img src="'.XOOPS_URL.'/modules/system/images/icons/admin.png" alt="'._AM_SYSTEM_USERS_ADMIN.'" title="'._AM_SYSTEM_USERS_ADMIN.'" />';
     $users['checkbox_user'] = false;
 } else {
     $users['group'] = system_AdminIcons('xoops/group_2.png');
     //$users['icon'] = '<img src="'.XOOPS_URL.'/modules/system/images/icons/user.png" alt="'._AM_SYSTEM_USERS_USER.'" title="'._AM_SYSTEM_USERS_USER.'" />';
     $users['checkbox_user'] = true;
 }
 $users['name'] = $users_arr[$i]->getVar("uid");
 $users['name'] = $users_arr[$i]->getVar("name");
 $users['uname'] = $users_arr[$i]->getVar("uname");
 $users['email'] = $users_arr[$i]->getVar("email");
 $users['url'] = $users_arr[$i]->getVar("url");
 $users['user_avatar'] = $users_arr[$i]->getVar("user_avatar") == 'blank.gif' ? system_AdminIcons('anonymous.png') : XOOPS_URL . '/uploads/' . $users_arr[$i]->getVar("user_avatar");
 $users['reg_date'] = formatTimestamp($users_arr[$i]->getVar("user_regdate"), "m");
 if ($users_arr[$i]->getVar("last_login") > 0) {
     $users['last_login'] = formatTimestamp($users_arr[$i]->getVar("last_login"), "m");
 } else {
     $users['last_login'] = _AM_SYSTEM_USERS_NOT_CONNECT;
 }
 $users['user_level'] = $users_arr[$i]->getVar("level");
 $users['user_icq'] = $users_arr[$i]->getVar("user_icq");
 $users['user_aim'] = $users_arr[$i]->getVar("user_aim");
 $users['user_yim'] = $users_arr[$i]->getVar("user_yim");
 $users['user_msnm'] = $users_arr[$i]->getVar("user_msnm");
 $users['posts'] = $users_arr[$i]->getVar("posts");
 $xoopsTpl->append_by_ref('users', $users);
 $xoopsTpl->append_by_ref('users_popup', $users);
 unset($users);
 /**
  * Preferences menu for System module
  * @return array
  */
 public function systemPreferences()
 {
     include_once XOOPS_ROOT_PATH . '/modules/system/include/functions.php';
     $confcat_handler = xoops_gethandler('configcategory');
     $confcats = $confcat_handler->getObjects();
     $image = system_adminVersion('preferences', 'configcat');
     $options = array();
     foreach (array_keys($confcats) as $i) {
         $options[] = array('title' => self::getPreferenceData(system_AdminIcons('xoops/' . $image[$i]), 'title'), 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=show&confcat_id=' . $confcats[$i]->getVar('confcat_id'), 'icon' => self::getPreferenceData(system_AdminIcons('xoops/' . $image[$i]), 'icon'));
     }
     return $options;
 }
Beispiel #3
0
 case 'list':
     // Define main template
     $xoopsOption['template_main'] = 'system_blocks.html';
     // 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('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
     $xoTheme->addScript('modules/system/js/admin.js');
     $xoTheme->addScript('modules/system/js/blocks.js');
     // Define Breadcrumb and tips
     $xoBreadCrumb->addLink(_AM_SYSTEM_BLOCKS_ADMIN, system_adminVersion('blocksadmin', 'adminpath'));
     $xoBreadCrumb->addHelp(system_adminVersion('blocksadmin', 'help'));
     $xoBreadCrumb->addTips(sprintf(_AM_SYSTEM_BLOCKS_TIPS, system_AdminIcons('block.png'), system_AdminIcons('success.png'), system_AdminIcons('cancel.png')));
     $xoBreadCrumb->render();
     // Initialize module handler
     $module_handler =& xoops_gethandler('module');
     $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->getList($criteria);
     unset($criteria);
     // Initialize blocks handler
     $block_handler =& xoops_getmodulehandler('block');
     // Initialize module handler
     $module_handler =& xoops_gethandler('module');
     $modules =& $module_handler->getObjects(null, true);
     $filterform = new XoopsThemeForm('', 'filterform', 'admin.php', 'get');
Beispiel #4
0
             $btemplates = $tpltpl_handler->find($tplsetname, 'block', null, $moddir);
             for ($k = 0; $k < count($btemplates); ++$k) {
                 $filename = $btemplates[$k]->getVar('tpl_file');
                 if ($tplsetname == $tplset) {
                     $physical_file = \XoopsBaseConfig::get('themes-path') . '/' . $_REQUEST['select_theme'] . '/modules/' . $moddir . '/blocks/' . $filename;
                     $btplfile = $tpltpl_handler->get($btemplates[$k]->getVar('tpl_id'), true);
                     if (is_object($btplfile)) {
                         if (!XoopsLoad::fileExists($physical_file) || $_REQUEST['force_generated'] == 1) {
                             if ($select_templates_modules[$l] == $filename) {
                                 $open = fopen("" . $physical_file . "", "w+");
                                 if (fwrite($open, "" . utf8_encode(html_entity_decode($btplfile->getVar('tpl_source', 'E'))) . "")) {
                                     $text .= '<tr class="' . $class . '"><td align="center">' . XoopsLocale::BLOCKS . '</td><td>' . $physical_file . '</td><td align="center">';
                                     if (XoopsLoad::fileExists($physical_file)) {
                                         $text .= '<img width="16" src="' . system_AdminIcons('success.png') . '" /></td></tr>';
                                     } else {
                                         $text .= '<img width="16" src="' . system_AdminIcons('cancel.png') . '" /></td></tr>';
                                     }
                                     $verif_write = true;
                                 }
                                 fclose($open);
                             }
                             $class = $class == "even" ? "odd" : "even";
                         }
                     }
                 }
             }
         }
         $text .= '</table>';
     }
     unset($module);
 }
Beispiel #5
0
            redirect_header($redirect, 2, _AM_SYSTEM_DBUPDATED);
        } else {
            redirect_header("admin.php?fct=preferences", 2, _AM_SYSTEM_DBUPDATED);
        }
        break;
    default:
        // Display setting cats
        $xoBreadCrumb->addTips(_AM_SYSTEM_PREFERENCES_NAV_TIPS);
        $xoBreadCrumb->addHelp(system_adminVersion('preferences', 'help'));
        $xoBreadCrumb->render();
        $confcat_handler = xoops_gethandler('configcategory');
        $confcats = $confcat_handler->getObjects();
        $image = system_adminVersion('preferences', 'configcat');
        $count_prefs = 1;
        $nbcolonnes_pref = 5;
        foreach (array_keys($confcats) as $i) {
            $preferences['id'] = $confcats[$i]->getVar('confcat_id');
            $preferences['image'] = system_AdminIcons('xoops/' . $image[$i]);
            $preferences['name'] = constant($confcats[$i]->getVar('confcat_name'));
            $count_prefs++;
            $preferences['newline'] = $count_prefs % $nbcolonnes_pref == 1 ? true : false;
            $xoopsTpl->assign('newline', $preferences['newline']);
            $xoopsTpl->append_by_ref('preferences', $preferences);
            unset($preferences);
        }
        $xoopsTpl->assign('menu', 1);
        $xoopsTpl->assign('breadcrumb', 1);
        break;
}
// Call Footer
xoops_cp_footer();
Beispiel #6
0
 if (in_array($users['uid'], $ListOfAdmins)) {
     $users['group'] = system_AdminIcons('xoops/group_1.png');
     //$users['icon'] = '<img src="'.\XoopsBaseConfig::get('url').'/modules/system/images/icons/admin.png" alt="'._AM_SYSTEM_USERS_ADMIN.'" title="'._AM_SYSTEM_USERS_ADMIN.'" />';
     $users['checkbox_user'] = false;
 } else {
     $users['group'] = system_AdminIcons('xoops/group_2.png');
     //$users['icon'] = '<img src="'.\XoopsBaseConfig::get('url').'/modules/system/images/icons/user.png" alt="'._AM_SYSTEM_USERS_USER.'" title="'._AM_SYSTEM_USERS_USER.'" />';
     $users['checkbox_user'] = true;
 }
 $users['name'] = $user->getVar("uid");
 $users['name'] = $user->getVar("name");
 $users['uname'] = $user->getVar("uname");
 $users['email'] = $user->getVar("email");
 $users['url'] = $user->getVar("url");
 $avatar = $xoops->service('avatar')->getAvatarUrl($user)->getValue();
 $users['user_avatar'] = empty($avatar) ? system_AdminIcons('anonymous.png') : $avatar;
 $users['reg_date'] = XoopsLocale::formatTimestamp($user->getVar("user_regdate"), "m");
 if ($user->getVar("last_login") > 0) {
     $users['last_login'] = XoopsLocale::formatTimestamp($user->getVar("last_login"), "m");
 } else {
     $users['last_login'] = SystemLocale::NEVER_CONNECTED;
 }
 $users['user_level'] = $user->getVar("level");
 $users['user_icq'] = $user->getVar("user_icq");
 $users['user_aim'] = $user->getVar("user_aim");
 $users['user_yim'] = $user->getVar("user_yim");
 $users['user_msnm'] = $user->getVar("user_msnm");
 $users['posts'] = $user->getVar("posts");
 $xoops->tpl()->appendByRef('users', $users);
 $xoops->tpl()->appendByRef('users_popup', $users);
 unset($users, $user);
Beispiel #7
0
 // 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');
 $filterform->addElement(new Xoops\Form\Hidden('fct', 'blocksadmin'));
 $filterform->addElement(new Xoops\Form\Hidden('op', 'list'));
Beispiel #8
0
        if (empty($content)) {
            echo _AM_SYSTEM_TEMPLATES_EMPTY_FILE;
        }
        $ext = preg_replace('/^.*\\./', '', $_REQUEST['path_file']);
        echo '<form name="back" action="admin.php?fct=tplsets&op=tpls_save" method="POST">
			  <table border="0">
				<tr>
					<td>
                          <div class="xo-btn-actions">
                              <div class="xo-buttons">
                                  <button class="ui-corner-all tooltip" type="submit" value="' . _AM_SYSTEM_TEMPLATES_SAVE . '" title="' . _AM_SYSTEM_TEMPLATES_SAVE . '">
                                      <img src="' . system_AdminIcons('save.png') . '" alt="' . _AM_SYSTEM_TEMPLATES_SAVE . '" />
                                  </button>
                                  ' . $restore . '
                                  <button class="ui-corner-all tooltip" type="button" onclick="$(\'#display_contenu\').hide();$(\'#display_form\').fadeIn(\'fast\');" title="' . _AM_SYSTEM_TEMPLATES_CANCEL . '">
                                      <img src="' . system_AdminIcons('cancel.png') . '" alt="' . _AM_SYSTEM_TEMPLATES_CANCEL . '" />
                                  </button>
                                  <div class="clear"></div>
                             </div>
                         </div>
                    </td>
				</tr>
				<tr>
					<td><textarea id="code_mirror" name="templates" rows=24 cols=110>' . $content . '</textarea></td>
				</tr>
			  </table>';
        echo '<input type="hidden" name="path_file" value="' . $path_file . '"><input type="hidden" name="file" value="' . trim($_REQUEST['file']) . '"><input type="hidden" name="ext" value="' . $ext . '"></form>';
        break;
        // Restore backup file
    // Restore backup file
    case 'tpls_restore':
 /**
  * Dump Write
  *
  * @param array
  * @return array 'ret[0] = dump, ret[1] = display result
  */
 function dump_write($ret)
 {
     $file_name = "dump_" . date("Y.m.d") . "_" . date("H.i.s") . ".sql";
     $path_file = "./admin/maintenance/dump/" . $file_name;
     if (file_put_contents($path_file, $ret[0])) {
         $ret[1] .= '<table class="outer"><tr><th colspan="2" align="center">' . _AM_SYSTEM_MAINTENANCE_DUMP_FILE_CREATED . '</th><th>' . _AM_SYSTEM_MAINTENANCE_DUMP_RESULT . '</th></tr><tr><td colspan="2" align="center"><a href="' . XOOPS_URL . '/modules/system/admin/maintenance/dump/' . $file_name . '">' . $file_name . '</a></td><td  class="xo-actions txtcenter"><img src="' . system_AdminIcons('success.png') . '" /></td><tr></table>';
     } else {
         $ret[1] .= '<table class="outer"><tr><th colspan="2" align="center">' . _AM_SYSTEM_MAINTENANCE_DUMP_FILE_CREATED . '</th><th>' . _AM_SYSTEM_MAINTENANCE_DUMP_RESULT . '</th></tr><tr><td colspan="2" class="xo-actions txtcenter">' . $file_name . '</td><td  class="xo-actions txtcenter"><img src="' . system_AdminIcons('cancel.png') . '" /></td><tr></table>';
     }
     return $ret;
 }
Beispiel #10
0
     if (empty($content)) {
         echo SystemLocale::EMPTY_FILE;
     }
     $ext = preg_replace('/^.*\\./', '', $_REQUEST['path_file']);
     echo '<form name="back" action="admin.php?fct=tplsets&op=tpls_save" method="POST">
           <table border="0">
               <tr>
                   <td>
                       <div class="xo-btn-actions">
                           <div class="xo-buttons">
                               <button class="ui-corner-all tooltip" type="submit" value="' . XoopsLocale::A_SAVE . '" title="' . XoopsLocale::A_SAVE . '">
                                   <img src="' . system_AdminIcons('save.png') . '" alt="' . XoopsLocale::A_SAVE . '" />
                               </button>
                               ' . $restore . '
                               <button class="ui-corner-all tooltip" type="button" onclick="$(\'#display_contenu\').hide();$(\'#display_form\').fadeIn(\'fast\');" title="' . XoopsLocale::A_CANCEL . '">
                                   <img src="' . system_AdminIcons('cancel.png') . '" alt="' . XoopsLocale::A_CANCEL . '" />
                               </button>
                               <div class="clear"></div>
                          </div>
                      </div>
                   </td>
               </tr>
               <tr>
                   <td><textarea id="code_mirror" name="templates" rows=24 cols=110>' . $content . '</textarea></td>
               </tr>
           </table>';
     echo '<input type="hidden" name="path_file" value="' . $path_file . '"><input type="hidden" name="file" value="' . trim($_REQUEST['file']) . '"><input type="hidden" name="ext" value="' . $ext . '"></form>';
     break;
     // Restore backup file
 // Restore backup file
 case 'tpls_restore':
Beispiel #11
0
     if (empty($content)) {
         echo _AM_SYSTEM_FILEMANAGER_EMPTY_FILE;
     }
     $ext = preg_replace('/^.*\\./', '', $_REQUEST['file']);
     echo '<form name="back" action="admin.php?fct=filemanager&op=filemanager_save" method="POST">
           <table border="0">
               <tr>
                   <td>
                       <div class="xo-btn-actions">
                           <div class="xo-buttons">
                               <button class="ui-corner-all tooltip" type="submit" value="' . _AM_SYSTEM_FILEMANAGER_SAVE . '" title="' . _AM_SYSTEM_FILEMANAGER_SAVE . '">
                                   <img src="' . system_AdminIcons('save.png') . '" alt="' . _AM_SYSTEM_FILEMANAGER_SAVE . '" />
                               </button>
                               ' . $restore . '
                               <button class="ui-corner-all tooltip" type="button" onclick="$(\'#edit_file\').fadeOut(\'fast\');$(\'#display_file\').fadeIn(\'fast\');" title="' . _AM_SYSTEM_FILEMANAGER_CANCEL . '">
                                   <img src="' . system_AdminIcons('cancel.png') . '" alt="' . _AM_SYSTEM_FILEMANAGER_CANCEL . '" />
                               </button>
                               <div class="clear"></div>
                          </div>
                      </div>
                 </td>
             </tr>
             <tr><td>
             <textarea id="code_mirror" name="filemanager" rows=24 cols=110>' . $content . '</textarea>
             </td></tr>
           </table>';
     echo '<input type="hidden" name="path_file" value="' . $path_file . '"><input type="hidden" name="path" value="' . $path . '"><input type="hidden" name="file" value="' . trim($_REQUEST['file']) . '"><input type="hidden" name="ext" value="' . $ext . '"></form>';
     break;
 case 'filemanager_unzip_file':
     $path_file = trim($_REQUEST['path_file']);
     if ($_REQUEST['path'] != '') {