function cache_view_files() { global $xoopsSecurity; RMTemplate::get()->set_help('http://redmexico.com.mx/docs/xoops-booster/archivos-del-cache'); RMTemplate::get()->assign('xoops_pagetitle', __('Booster Zone', 'booster')); RMTemplate::get()->add_style('cache.css', 'rmcommon', 'plugins/booster'); RMFunctions::create_toolbar(); xoops_cp_header(); $plugin = RMFunctions::get()->load_plugin('booster'); // Get files $items = XoopsLists::getFileListAsArray(XOOPS_CACHE_PATH . '/booster/files'); $files = array(); $count_expired = 0; foreach ($items as $file) { $tmp = explode('.', $file); if ($tmp[1] != 'meta') { continue; } $content = json_decode(file_get_contents(XOOPS_CACHE_PATH . '/booster/files/' . $file), true); $files[] = array('id' => $tmp[0], 'url' => $content['uri'], 'date' => formatTimestamp($content['created'], 'l'), 'time' => $content['created'], 'lang' => $content['language'], 'size' => filesize(XOOPS_CACHE_PATH . '/booster/files/' . $tmp[0] . '.html')); $count_expired = time() - $content['created'] >= $plugin->get_config('time') ? $count_expired + 1 : $count_expired; } include RMTemplate::get()->get_template('cache_files.php', 'plugin', 'rmcommon', 'booster'); xoops_cp_footer(); }
function categoriesForm($edit = 0) { global $db, $xoopsModule; if ($edit) { $id = TCFunctions::get('id'); if ($id <= 0) { redirectMsg('cats.php', __('¡El ID proporcionado no es válido!'), 1); die; } $cat = new TCCategory($id); if ($cat->isNew()) { redirectMsg('cats.php', __('No existe la categoría especificada'), 1); die; } } xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » <a href='./cats.php'>" . __('Administración de Categorías', 'admin_team') . "</a> » " . ($edit ? __('Editar Categoría', 'admin_team') : __('Crear Categoría', 'admin_team'))); xoops_cp_header(); $form = new RMForm($edit ? __('Editar Categoría', 'admin_team') : __('Crear Categoría', 'admin_team'), 'frmNew', 'cats.php'); $form->oddClass('oddForm'); $form->addElement(new RMFormText(__('Nombre', 'admin_team'), 'name', 50, 100, $edit ? $cat->name() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Nombre corto', 'admin_team'), 'nameid', 50, 100, $cat->nameId())); } $form->addElement(new RMFormTextArea(__('Descripción', 'admin_team'), 'desc', 5, 45, $edit ? $cat->getVar('desc') : '')); $ele = new RMFormButtonGroup(); $ele->addButton('sbt', $edit ? __('Guardar Cambios', 'admin_team') : __('Crear Categoría', 'admin_team'), 'submit'); $ele->addButton('cancel', __('Cancelar', 'admin_team'), 'button', 'onclick="window.location=\'cats.php\';"'); $form->addElement($ele); $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $id)); } $form->display(); xoops_cp_footer(); }
function show_available_updates() { global $rmTpl, $rmEvents, $updfile, $xoopsSecurity; $rmFunc = RMFunctions::get(); $rmUtil = RMUtilities::get(); $tf = new RMTimeFormatter('', '%T% %d%, %Y% at %h%:%i%'); if (is_file($updfile)) { $updates = unserialize(base64_decode(file_get_contents($updfile))); } $rmTpl->add_style('updates.css', 'rmcommon'); $rmTpl->add_script('updates.js', 'rmcommon'); $rmTpl->add_head_script('var xoToken = "' . $xoopsSecurity->createToken() . '";'); $rmTpl->add_head_script('var langUpdated = "' . __('Item updated!', 'rmcommon') . '";'); $rmTpl->add_help(__('Updates Help', 'rmcommon'), 'http://www.xoopsmexico.net/docs/common-utilities/actualizaciones-automaticas/standalone/1/'); $ftpserver = parse_url(XOOPS_URL); $ftpserver = $ftpserver['host']; $pathinfo = parse_url(XOOPS_URL); $ftpdir = str_replace($pathinfo['scheme'] . '://' . $pathinfo['host'], '', XOOPS_URL); unset($pathinfo); RMBreadCrumb::get()->add_crumb(__('Available Updates', 'rmcommon')); $rmTpl->assign('xoops_pagetitle', __('Available Updates', 'rmcommon')); xoops_cp_header(); include $rmTpl->get_template('rmc-updates.php', 'module', 'rmcommon'); xoops_cp_footer(); }
/** * @brief display error message & exit (Tentative) */ function system_images_error($message) { xoops_cp_header(); xoops_error($message); xoops_cp_footer(); exit; }
/** * @desc Muestra el formulario para agregar un nuevo sitio */ function edit_bookmark() { global $xoopsModule, $xoopsConfig, $xoopsSecurity, $rmTpl; $id = rmc_server_var($_GET, 'id', 0); if ($id <= 0) { redirectMsg('bookmarks.php', __('Site ID not provided!', 'mywords'), 1); die; } $book = new MWBookmark($id); if ($book->isNew()) { redirectMsg('bookmarks.php', __('Social site not exists!', 'mywords'), 1); die; } $temp = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/mywords/images/icons'); foreach ($temp as $icon) { $icons[] = array('url' => XOOPS_URL . "/modules/mywords/images/icons/{$icon}", 'name' => $icon); } MWFunctions::include_required_files(); RMBreadCrumb::get()->add_crumb(__('Social Sites', 'mywords'), 'bookmarks.php'); RMBreadCrumb::get()->add_crumb(__('Edit Site', 'mywords')); xoops_cp_header(); $show_edit = true; include $rmTpl->get_template('admin/mywords_bookmarks.php', 'module', 'mywords'); $rmTpl->assign('xoops_pagetitle', __('Edit Social Site', 'mywords')); $rmTpl->add_script(RMCURL . '/include/js/jquery.checkboxes.js'); $rmTpl->add_script('../include/js/scripts.php?file=bookmarks.js'); xoops_cp_footer(); }
/** * @desc Formulario de licencias **/ function formLicences($edit = 0) { global $xoopsModule; $id = rmc_server_var($_REQUEST, 'id', 0); if ($edit) { //Verificamos si la licencia es válida if ($id <= 0) { redirectMsg('licenses.php', __('You must provide a valid licencse ID!', 'dtransport'), 1); die; } //Verificamos si la licencia existe $lc = new DTLicense($id); if ($lc->isNew()) { redirectMsg('licenses.php', __('Specified licence ID does not exists!', 'dtransport'), 1); die; } } xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . ($edit ? __('Edit Licence', 'dtransport') : __('New Licence', 'dtransport'))); xoops_cp_header(); $form = new RMForm($edit ? __('Edit Licence', 'dtransport') : __('New Licence', 'dtransport'), 'frmlic', 'licenses.php'); $form->addElement(new RMFormText(__('Licence name', 'dtransport'), 'name', 50, 150, $edit ? $lc->name() : ''), true); $form->addElement(new RMFormText(__('Licence reference URL', 'dtransport'), 'url', 50, 255, $edit ? $lc->link() : '')); $ele = new RMFormSelect(__('Licence type', 'dtranport'), 'type'); $ele->addOption(0, __('Open source licence', 'dtransport'), $edit ? $lc->type() == 0 ? 1 : 0 : 0); $ele->addOption(1, __('Restrictive licence', 'dtranport'), $edit ? $lc->type() == 1 ? 1 : 0 : 0); $form->addElement($ele); $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save')); $form->addElement(new RMFormHidden('id', $id)); $buttons = new RMFormButtonGroup(); $buttons->addButton('sbt', __('Save Changes', 'dtransport'), 'submit'); $buttons->addButton('cancel', __('Cancel', 'stransport'), 'button', 'onclick="window.location=\'licenses.php\';"'); $form->addElement($buttons); $form->display(); xoops_cp_footer(); }
function module_admin_footer($main = "", $n = "") { xoops_cp_header(); admin_toolbar($n); echo "<link rel='stylesheet' type='text/css' media='screen' href='../module.css' />"; echo $main; xoops_cp_footer(); }
function end() { global $xoopsConfig, $xoopsModule; if (!empty($this->mTemplate)) { $this->mXoopsTpl->display($this->mTemplate); } xoops_cp_footer(); }
function formCoachs($edit = 0) { global $xoopsModule, $db, $mc, $xoopsConfig; if ($edit) { $id = TCFunctions::get('id'); if ($id <= 0) { redirectMsg('coachs.php', __('Id no válido', 'admin_team'), 1); die; } $coach = new TCCoach($id); if ($coach->isNew()) { redirectMsg('coachs.php', __('El entrenador especificado no existe', 'admin_team'), 1); die; } } xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » <a href='./coachs.php'>" . __('Entrenadores', 'admin_team') . "</a> » " . ($edit ? __('Editar entrenador', 'admin_team') : __('Crear entrenador', 'admin_team'))); $cHead = '<link href="' . TC_URL . '/styles/admin.css" media="all" rel="stylesheet" type="text/css" />'; xoops_cp_header($cHead); $form = new RMForm($edit ? __('Editar Entrenador', 'admin_team') : __('Crear Entrenador', 'admin_team'), 'frmNew', 'coachs.php', 'post'); $form->oddClass('oddForm'); $form->setExtra('enctype="multipart/form-data"'); $form->addElement(new RMFormText(__('Nombre', 'admin_team'), 'name', 50, 150, $edit ? $coach->name() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Nombre corto', 'admin_team'), 'nameid', 50, 150, $coach->nameId())); } $form->addElement(new RMFormText(__('Cargo', 'admin_team'), 'role', 50, 150, $edit ? $coach->role() : ''), true); $form->addElement(new RMFormFile(__('Imagen', 'admin_team'), 'image', 45, $mc['filesize'] * 1024)); if ($edit && $coach->image() != '') { $form->addElement(new RMFormLabel(__('Imagen actual', 'admin_team'), "<img src='" . XOOPS_URL . "/uploads/teams/coachs/ths/" . $coach->image() . "' alt='' />")); } $form->addElement(new RMFormEditor(__('Biografía', 'admin_team'), 'bio', '90%', '300px', $edit ? $coach->bio('e') : '')); $form->addElement(new RMFormSubTitle(__('Equipos', 'admin_team'), 1)); $ele = new RMFormCheck(__('Seleccionar equipos', 'admin_team')); $ele->asTable(3); $sql = "SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name"; $result = $db->query($sql); if ($edit) { $teams = $coach->teams(false); } while ($row = $db->fetchArray($result)) { $team = new TCTeam(); $team->assignVars($row); $cat =& $team->category(true); $ele->addOption($team->name() . " <span class='coachNameCat'>(" . $cat->name() . ")</span>", 'teams[]', $team->id(), $edit ? in_array($team->id(), $teams) ? 1 : 0 : 0); } $form->addElement($ele); $ele = new RMFormButtonGroup(); $ele->addButton('sbt', __('Enviar', 'admin_team'), 'submit'); $ele->addButton('cancel', __('Cancelar', 'admin_team'), 'button', 'onclick="window.location=\'coachs.php\';"'); $form->addElement($ele); $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $id)); } $form->display(); xoops_cp_footer(); }
function Choice() { global $xoopsModule; xoops_cp_header(); OpenTable(); echo "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "'>" . _IMP_Edit . "</a><br />"; CloseTable(); xoops_cp_footer(); }
function error_halt($msg) { global $xoopsLogger; xoops_cp_header(); include './mymenu.php'; echo $xoopsLogger->dumpQueries(); OpenTable(); echo $msg; CloseTable(); xoops_cp_footer(); }
function dispatch() { require XSNS_FRAMEWORK_DIR.'/global.php'; xoops_cp_header(); include $mytrustdirpath.'/mymenu.php'; echo "<h4><p style='text-align:center;'>"._AM_XSNS_TITLE_ACCESS_LOG."</p></h4>"; $access_log = $this->context->getAttribute('access_log'); if(count($access_log) > 0){ $pager = $this->context->getAttribute('pager'); echo "<div style='width:90%;margin-left:auto;margin-right:auto;'>"; echo "<table class='outer' style='width:100%;'>"; $header_list = array( _AM_XSNS_ACCESS_DATE, _AM_XSNS_ACCESS_COMMU, _AM_XSNS_ACCESS_USER, ); $header_count = count($header_list); $pager_html = $this->getPageSelector($pager, $header_count); echo $pager_html; echo "<tr>"; foreach($header_list as $header){ echo "<th style='text-align:center;'>".$header."</th>"; } echo "</tr>"; echo "<colgroup style='text-align:center; width:20%;'></colgroup>". "<colgroup span='2' style='text-align:left; width:35%;'></colgroup>"; foreach($access_log as $access){ echo "<tr class='even'>". "<td>".date('Y-m-d H:i:s', $access['time'])."</td>". "<td><a href='index.php?".XSNS_ACTION_ARG."=access&cid=".$access['commu_id']."'>".$access['commu_name']."</a></td>". "<td><a href='index.php?".XSNS_ACTION_ARG."=access&uid=".$access['member_id']."'>".$access['member_name']."</a></td>". "</tr>"; } echo $pager_html; echo "</table>"; echo "</div>"; } xoops_cp_footer(); }
function altsys_mylangadmin_errordie($target_mname, $message4disp) { xoops_cp_header(); altsys_include_mymenu(); $breadcrumbsObj =& AltsysBreadcrumbs::getInstance(); $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN); $breadcrumbsObj->appendPath('', $target_mname); echo '<h3>' . _MYLANGADMIN_H3_MODULE . ' : ' . $target_mname . '</h3>'; echo '<p>' . $message4disp . '</p>'; xoops_cp_footer(); exit; }
function ShowServs() { global $xoopsDB; include 'functions.php'; $result = $xoopsDB->query("SELECT * FROM {$tvensrv} ORDER BY id_srv"); xoops_cp_header(); ShowNav(); echo "<table width='100%' class='outer' cellspacing='1'>\n\t\t\t<tr><th colspan='4'>" . _AM_SERVS_LIST . "</th></tr>"; while ($row = $xoopsDB->fetchArray($result)) { echo "<tr class='even'><td align='left'>\n\t\t\t <a href='promos.php?op=view&idp={$row['id_promo']}'>" . ServiceName($row['id_srv']) . "</a></td>\n\t\t\t <td align='center'>" . date("d/m/Y h:i:s", $row['fecha']) . "</td>\n\t\t\t <td align='center'>{$row['buyermail']}</td>\n\t\t\t <td align='center'><a href='sales.php?op=promos&action=del'>" . _AM_DELETE . "</a></td>\n\t\t\t </tr>"; } echo "</table>"; xoops_cp_footer(); }
function show_dashboard() { global $xoopsModule; //RMFunctions::create_toolbar(); $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = 'SELECT * FROM ' . $db->prefix('modules'); $result = $db->query($sql); $installed_mods = array(); while ($row = $db->fetchArray($result)) { $installed_mods[] = $row['dirname']; } require_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $dirlist = XoopsLists::getModulesList(); $available_mods = array(); $module_handler =& xoops_gethandler('module'); $i = 0; foreach ($dirlist as $file) { if ($i > 5) { break; } clearstatcache(); $file = trim($file); if (!in_array($file, $installed_mods)) { $module =& $module_handler->create(); if (!$module->loadInfo($file, false)) { continue; } $available_mods[] = $module; } $i++; } $donateButton = '<form id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="*****@*****.**"> <input type="hidden" name="item_name" value="Common Utilities Support"> <input type="hidden" name="amount" value=0> <input type="hidden" name="currency_code" value="USD"> <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$(\'#paypal-form\').submit()" alt="PayPal - The safer, easier way to pay online!" /> </form>'; $installed_modules = get_modules_list(); xoops_cp_header(); RMTemplate::get()->add_style('dashboard.css', 'rmcommon'); RMTemplate::get()->add_script('dashboard.js', 'rmcommon', array('footer' => 1)); RMTemplate::get()->add_style('pagenav.css', 'rmcommon'); RMTemplate::get()->add_help(__('Dashboard Help', 'rmcommon'), 'http://www.xoopsmexico.net/docs/common-utilities/uso-de-common-utilities/standalone/1/#dashboard'); include RMTemplate::get()->get_template('rmc-dashboard.php', 'module', 'rmcommon'); xoops_cp_footer(); }
/** * Show the form to edit or create a category * @param int edit */ function m_categories_form($edit = 0) { global $mc, $xoopsModule, $db; MCHFunctions::toolbar(); RMTemplate::get()->assign('xoops_pagetitle', $edit ? __('Edit Category', 'match') : __('Add Category', 'match')); xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » \n <a href='categories.php'>" . __('Categories', 'match') . '</a> » ' . ($edit ? __('Edit Category', 'match') : __('Add Category', 'match'))); xoops_cp_header(); $id = rmc_server_var($_REQUEST, 'id', 0); if ($edit) { //Verificamos si la categoría es válida if ($id <= 0) { redirectMsg('./categories.php', __('Provide a category ID!', 'match'), 1); die; } //Verificamos si la categoría existe $cat = new MCHCategory($id); if ($cat->isNew()) { redirectMsg('./categories.php', __('Specified category was not found!', 'match'), 1); die; } } $form = new RMForm($edit ? __('Edit Category', 'match') : __('Add Category', 'match'), 'frmNew', 'categories.php'); $form->addElement(new RMFormText(__('Name', 'match'), 'name', 50, 150, $edit ? $cat->getVar('name') : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Short name', 'match'), 'nameid', 50, 150, $cat->getVar('nameid')), true); } $form->addElement(new RMFormEditor(__('Description', 'match'), 'desc', '100%', '250px', $edit ? $cat->getVar('description', 'e') : '')); $sel_cats = new RMFormSelect(__('Parent category:', 'match'), 'parent', 0, $edit ? $cat->getVar('parent') : 0); $categories = array(); MCHFunctions::categories_tree($categories, 0, 0, true, $edit ? $cat->id() : 0, '`name` ASC'); $sel_cats->addOption(0, __('Select category...', 'match'), $edit ? $cat->getVar('parent') == 0 ? 1 : 0 : 1); foreach ($categories as $catego) { $sel_cats->addOption($catego['id'], str_repeat('—', $catego['indent']) . ' ' . $catego['name']); } $form->addElement($sel_cats); $form->addElement(new RMFormYesNo(__('Enable category', 'match'), 'active', $edit ? $cat->getVar('active') : 1)); $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $cat->id())); } $ele = new RMFormButtonGroup(); $ele->addButton('sbt', $edit ? __('Save Changes!', 'match') : __('Add Now!', 'match'), 'submit'); $ele->addButton('cancel', _CANCEL, 'button', 'onclick="window.location=\'categos.php\';"'); $form->addElement($ele); $form = RMEvents::get()->run_event('match.form.categories', $form); $form->display(); xoops_cp_footer(); }
function rd_show_page() { RMTemplate::get()->assign('xoops_pagetitle', __('Home Page', 'docs')); xoops_cp_header(); include_once RMCPATH . '/class/form.class.php'; $content = @file_get_contents(XOOPS_CACHE_PATH . '/rd_homepage.html'); $content = TextCleaner::getInstance()->to_display($content); $editor = new RMFormEditor('', 'homepage', '100%', '450px', $content); $rmc_config = RMFunctions::configs(); if ($rmc_config['editor_type'] == 'tiny') { $tiny = TinyEditor::getInstance(); $tiny->add_config('theme_advanced_buttons1', 'res_index'); } include RMEvents::get()->run_event('docs.get.homepage.template', RMTemplate::get()->get_template('admin/rd_homepage.php', 'module', 'docs')); xoops_cp_footer(); }
/** * @desc Formulario de creación/edición de Tipos de cliente **/ function formTypes($edit = 0) { global $tpl, $xoopsModule; $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0; if ($edit) { //Verificamos si nos proporcionaron al menos un tipo para editar if (!is_array($ids)) { redirectMsg('./types.php', __('You must provide a type ID at least', 'works'), 1); die; } if (!is_array($ids)) { $ids = array($ids); } } PWFunctions::toolbar(); xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » <a href='./types.php'>" . __('Customer types', 'works') . "</a> » " . ($edit ? __('Edit type', 'works') : __('New type', 'works'))); RMTemplate::get()->assign('xoops_pagetitle', __('Add Customers types', 'works')); xoops_cp_header(); $form = new RMForm($edit ? __('Edit Type', 'works') : __('New Type', 'works'), 'frmtype', 'types.php'); $num = 10; if ($edit) { foreach ($ids as $k) { //Verificamos si el tipo es válido if ($k <= 0) { continue; } //Verificamos si el tipo existe $type = new PWType($k); if ($type->isNew()) { continue; } $form->addElement(new RMFormText(__('Type name', 'works'), 'type[' . $type->id() . ']', 50, 100, $edit ? $type->type() : '')); } } else { for ($i = 1; $i <= $num; $i++) { $form->addElement(new RMFormText(__('Type name', 'works'), 'type[' . $i . ']', 50, 100, $edit ? '' : '')); } } $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save')); $ele = new RMFormButtonGroup(); $ele->addButton('sbt', $edit ? __('Save Changes', 'works') : __('Save Customer Types', 'works'), 'submit'); $ele->addButton('cancel', __('Cancel', 'works'), 'button', 'onclick="window.location=\'types.php\';"'); $form->addElement($ele); $form->display(); xoops_cp_footer(); }
function xt_show_menus() { global $xtAssembler, $xtFunctions; $tc = TextCleaner::getInstance(); $menus = $xtAssembler->rootMenus(); if (!$menus) { redirectMsg('themes.php', __('This theme does not support xThemes menus!', 'xthemes'), RMMSG_WARN); } $theme_menu = $xtAssembler->menu(); $tpl = RMTemplate::get(); $tpl->add_local_script('jquery.nestedSortable.js', 'xthemes'); $tpl->add_local_script('json_encode.js', 'xthemes'); $tpl->add_head_script("var lang_delete = '" . __('Do you really want to delete selected menu?', 'xthemes') . "';"); $tpl->add_local_script('xthemes.js', 'xthemes'); $tpl->assign('xoops_pagetitle', __('Theme menus', 'xthemes')); xoops_cp_header(); include $tpl->get_template('xt_navigation.php', 'module', 'xthemes'); xoops_cp_footer(); }
function show_dashboard() { global $xoopsModuleConfig; $db = Database::getInstance(); // Sets count $sql = "SELECT COUNT(*) FROM " . $db->prefix("gs_sets"); list($set_count) = $db->fetchRow($db->query($sql)); // Pictures count $sql = "SELECT COUNT(*) FROM " . $db->prefix("gs_images"); list($pic_count) = $db->fetchRow($db->query($sql)); // Users count $sql = "SELECT COUNT(*) FROM " . $db->prefix("gs_users"); list($user_count) = $db->fetchRow($db->query($sql)); // Tags count $sql = "SELECT COUNT(*) FROM " . $db->prefix("gs_tags"); list($tag_count) = $db->fetchRow($db->query($sql)); // E-Cards count $sql = "SELECT COUNT(*) FROM " . $db->prefix("gs_postcards"); list($post_count) = $db->fetchRow($db->query($sql)); // Used space $space = RMUtilities::formatBytesSize(GSFunctions::folderSize($xoopsModuleConfig['storedir'])); // Number of files $file_count = count_files(rtrim($xoopsModuleConfig['storedir'], '/')); // First picture $sql = "SELECT * FROM " . $db->prefix("gs_images") . " ORDER BY `created` ASC LIMIT 0,1"; $result = $db->query($sql); if ($db->getRowsNum($result) > 0) { $img = new GSImage(); $img->assignVars($db->fetchArray($result)); $user = new GSUser($img->owner(), 1); $tf = new RMTimeFormatter(0, '%M% %d%, %Y%'); $first_pic['date'] = $tf->format($img->created()); $first_pic['link'] = $user->userURL() . ($xoopsModuleConfig['urlmode'] ? 'img/' . $img->id() . '/set/' : '&img=' . $img->id()); } xoops_cp_header(); GSFunctions::toolbar(); RMTemplate::get()->add_style('dashboard.css', 'galleries'); RMTemplate::get()->add_style('admin.css', 'galleries'); RMTemplate::get()->add_head('<script type="text/javascript">var xurl = "' . XOOPS_URL . '";</script>'); RMTemplate::get()->add_local_script('dashboard.js', 'galleries'); include RMTemplate::get()->get_template('admin/gs_dashboard.php', 'module', 'galleries'); xoops_cp_footer(); }
/** * @desc Formulario de creación/edición de categorías **/ function formCategos($edit = 0) { global $xoopsModule, $db; $id = rmc_server_var($_GET, 'id', 0); if ($edit) { //Verificamos si categoría es válida if ($id <= 0) { redirectMsg('categories.php', __('Specified category is not valid!', 'dtransport'), 1); } //Verificamos si la categoría existe $cat = new DTCategory($id); if ($cat->isNew()) { redirectMsg('categories.php', __('Specified category does not exists!', 'dtransport'), 1); } } DTFunctions::toolbar(); xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . ($edit ? __('Edit category', 'dtransport') : __('New category', 'dtransport'))); xoops_cp_header(); $form = new RMForm($edit ? __('Edit Category', 'dtransport') : __('New Category', 'dtransport'), 'frmcat', 'categories.php'); $form->addElement(new RMFormText(__('Category name', 'dtransport'), 'name', 50, 150, $edit ? $cat->name() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Category short name', 'dtransport'), 'nameid', 50, 150, $edit ? $cat->nameId() : '')); } $form->addElement(new RMFormTextArea(__('Description', 'dtransport'), 'desc', 5, 40, $edit ? $cat->desc('e') : '')); //Lista de categorías $ele = new RMFormSelect(__('Root category', 'dtransport'), 'parent'); $ele->addOption(0, __('Select category...', 'dtransport')); $categos = array(); DTFunctions::getCategos($categos, 0, 0, $edit ? $cat->id() : array()); foreach ($categos as $catego) { $ele->addOption($catego['id_cat'], str_repeat('--', $catego['jumps']) . ' ' . $catego['name'], $edit ? $catego['id_cat'] == $cat->parent() ? 1 : 0 : 0); } $form->addElement($ele); $form->addElement(new RMFormYesno(__('Active category', 'dtransport'), 'active', $edit ? $cat->active() : 1)); $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save')); $form->addElement(new RMFormHidden('id', $id)); $buttons = new RMFormButtonGroup(); $buttons->addButton('sbt', __('Submit', 'dtransport'), 'submit'); $buttons->addButton('cancel', __('Cancel', 'dtransport'), 'button', 'onclick="window.location=\'categories.php\';"'); $form->addElement($buttons); $form->display(); xoops_cp_footer(); }
function execute($adminmenu) { $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : $this->_defaultOp; $method = $op . 'Action'; if (in_array($op, $this->_allowed)) { xoops_cp_header(); foreach ($adminmenu as $a) { echo '| <a href="' . XOOPS_URL . '/modules/openid/' . $a['link'] . '">' . $a['title'] . '</a> '; } echo '<hr>'; $this->{$method}(); xoops_cp_footer(); } else { if (in_array($op, $this->_allowedAction)) { $this->{$method}(); } else { exit(htmlspecialchars($op, ENT_QUOTES)); } } }
function formCategory($edit = 0) { global $mc, $xoopsModule, $db; PWFunctions::toolbar(); RMTemplate::get()->assign('xoops_pagetitle', $edit ? __('Edit Category', 'works') : __('Add Category', 'works')); xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> » \n\t\t<a href='categos.php'>" . __('Categories', 'works') . '</a> » ' . ($edit ? __('Edit Category', 'works') : __('Add Category', 'works'))); xoops_cp_header(); $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; if ($edit) { //Verificamos si la categoría es válida if ($id <= 0) { redirectMsg('./categos.php?op=edit&id=' . $id, __('Provide a category ID!', 'works'), 1); die; } //Verificamos si la categoría existe $cat = new PWCategory($id); if ($cat->isNew()) { redirectMsg('./categos.php?op=edit&id=' . $id, __('Specified category was not found!', 'works'), 1); die; } } $form = new RMForm($edit ? __('Edit Category', 'works') : __('Add Category', 'works'), 'frmNew', 'categos.php'); $form->addElement(new RMFormText(__('Name', 'works'), 'name', 50, 150, $edit ? $cat->name() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Short name', 'works'), 'nameid', 50, 150, $cat->nameId()), true); } $form->addElement(new RMFormEditor(__('Description', 'works'), 'desc', '100%', '250px', $edit ? $cat->desc('e') : '')); $form->addElement(new RMFormYesNo(__('Enable category', 'works'), 'active', $edit ? $cat->active() : 1)); $form->addElement(new RMFormText(__('Display order', 'works'), 'order', 8, 3, $edit ? $cat->order() : 0), true, 'num'); $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $cat->id())); } $ele = new RMFormButtonGroup(); $ele->addButton('sbt', $edit ? __('Save Changes!', 'works') : __('Add Now!', 'works'), 'submit'); $ele->addButton('cancel', _CANCEL, 'button', 'onclick="window.location=\'categos.php\';"'); $form->addElement($ele); $form = RMEvents::get()->run_event('works.form.categories', $form); $form->display(); xoops_cp_footer(); }
function show_mw_trackbacks() { global $xoopsModule, $xoopsSecurity; $id = rmc_server_var($_GET, 'id', 0); $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = "SELECT COUNT(*) FROM " . $db->prefix("mw_trackbacks"); if ($id > 0) { $sql .= "WHERE post={$id}"; } list($num) = $db->fetchRow($db->query($sql)); $page = rmc_server_var($_GET, 'page', 1); $limit = isset($limit) && $limit > 0 ? $limit : 15; $tpages = ceil($num / $limit); $page = $page > $tpages ? $tpages : $page; $start = $num <= 0 ? 0 : ($page - 1) * $limit; $nav = new RMPageNav($num, $limit, $page, 5); $nav->target_url('trackbacks.php?page={PAGE_NUM}' . ($id > 0 ? '&id=' . $id : '')); $sql = str_replace("COUNT(*)", '*', $sql); $sql .= " ORDER BY `date` LIMIT {$start},{$limit}"; $result = $db->query($sql); $posts = array(); // posts cache $trackbacks = array(); // Get trackbacks data while ($row = $db->fetchArray($result)) { $trac = new MWTrackbackObject(); $trac->assignVars($row); $posts[$trac->getVar('post')] = isset($posts[$trac->getVar('post')]) ? $posts[$trac->getVar('post')] : new MWPost($trac->getVar('post')); $trackbacks[] = array('tb' => $trac, 'post' => array('title' => $posts[$trac->getVar('post')]->getVar('title'), 'link' => $posts[$trac->getVar('post')]->isNew() ? '' : $posts[$trac->getVar('post')]->permalink())); } // Event $trackbacks = RMEvents::get()->run_event("mywords.trackbacks.list", $trackbacks); MWFunctions::include_required_files(); RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js'); RMTemplate::get()->add_script(XOOPS_URL . '/modules/mywords/include/js/scripts.php?file=trackbacks.js'); xoops_cp_header(); xoops_cp_location('<a href="' . XOOPS_URL . '/modules/mywords/admin/">' . $xoopsModule->getVar('name') . '</a> » ' . __('Trackbacks', 'mywords')); include RMTemplate::get()->get_template('admin/mywords_trackbacks.php', 'module', 'mywords'); xoops_cp_footer(); }
/** * @desc Muestra el formulario para edición/creación de categorías */ function showForm($edit = 0) { global $xoopsModule, $xoopsConfig, $xoopsModuleConfig; define('RMSUBLOCATION', 'newcategory'); if ($edit) { $id = RMHttpRequest::get('id', 'integer', 0); if ($id <= 0) { RMUris::redirect_with_message(__('You had not provided a category ID', 'bxpress'), 'categories.php', RMMSG_WARN); die; } $catego = new bXCategory($id); if ($catego->isNew()) { RMUris::redirect_with_message(__('Specified category does not exists!', 'bxpress'), 'categories.php', RMMSG_ERROR); die; } } $bc = RMBreadCrumb::get(); $bc->add_crumb(__('Categories', 'bxpress'), 'categories.php'); $bc->add_crumb(__('Edit category', 'bxpress')); xoops_cp_header(); $form = new RMForm($edit ? __('Edit Category', 'bxpress') : __('New Category', 'bxpress'), 'frmCat', 'categories.php'); $form->addElement(new RMFormText(__('Name', 'bxpress'), 'title', 50, 100, $edit ? $catego->title() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Short name', 'bxpress'), 'friendname', 50, 100, $catego->friendName())); } $form->addElement(new RMFormEditor(__('Description', 'bxpress'), 'desc', '90%', '300px', $edit ? $catego->description() : '')); $form->addElement(new RMFormYesNo(__('Show description', 'bxpress'), 'showdesc', $edit ? $catego->showDesc() : 1)); $form->addElement(new RMFormYesNo(__('Activate', 'bxpress'), 'status', $edit ? $catego->status() : 1)); $form->addElement(new RMFormGroups(__('Groups', 'bxpress'), 'groups', 1, 1, 4, $edit ? $catego->groups() : array(0)), true, 'checked'); $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $catego->id())); } $buttons = new RMFormButtonGroup(); $buttons->addButton('sbt', __('Submit', 'bxpress'), 'submit', '', true); $buttons->addButton('cancel', __('Cancel', 'bxpress'), 'button', 'onclick="window.location=\'categories.php\';"'); $form->addElement($buttons); $form->display(); xoops_cp_footer(); }
function manage() { global $oAdminButton, $imagearray; $faqAdapters =& xhelpFaqAdapterFactory::installedAdapters(); $myAdapter =& xhelpFaqAdapterFactory::getFaqAdapter(); xoops_cp_header(); echo $oAdminButton->renderButtons('manFaqAdapters'); echo "<form method='post' action='" . XHELP_ADMIN_URL . "/faqAdapter.php?op=updateActive'>"; echo "<table width='100%' cellspacing='1' class='outer'>"; if (!empty($faqAdapters)) { echo "<tr><th colspan='5'>" . _AM_XHELP_MENU_MANAGE_FAQ . "</th></tr>"; echo "<tr class='head'>\r\n <td>" . _AM_XHELP_TEXT_NAME . "</td>\r\n <td>" . _AM_XHELP_TEXT_PLUGIN_VERSION . "</td>\r\n <td>" . _AM_XHELP_TEXT_TESTED_VERSIONS . "</td>\r\n <td>" . _AM_XHELP_TEXT_AUTHOR . "</td>\r\n <td>" . _AM_XHELP_TEXT_ACTIVE . "</td>\r\n </tr>"; $activeAdapter = xhelpGetMeta('faq_adapter'); foreach ($faqAdapters as $name => $oAdapter) { $modname = $name; $author = $oAdapter->meta['author']; $author_name = $author; if ($oAdapter->meta['url'] != '') { // If a website is specified $name = "<a href='" . $oAdapter->meta['url'] . "'>" . $oAdapter->meta['name'] . "</a>"; // Add link to module name } if ($oAdapter->meta['author_email'] != '') { $author = "<a href='mailto:" . $oAdapter->meta['author_email'] . "'>" . $author_name . "</a>"; // Add link to email author } echo "<tr class='even'>\r\n <td>" . $name . "</td>\r\n <td>" . $oAdapter->meta['version'] . "</td>\r\n <td>" . $oAdapter->meta['tested_versions'] . "</td>\r\n <td>" . $author . "</td>\r\n <td>\r\n <input type='image' src='" . ($activeAdapter == $modname ? XHELP_IMAGE_URL . '/on.png' : XHELP_IMAGE_URL . '/off.png') . "' name='modname' value='" . $modname . "' style='border:0;background:transparent' />\r\n </td>\r\n </tr>"; } } else { // Display "no adapters found" message echo "<tr><th>" . _AM_XHELP_MENU_MANAGE_FAQ . "</th></tr>"; echo "<tr><td class='even'>" . _AM_XHELP_TEXT_NO_FILES . "</td></tr>"; } echo "</table></form>"; if (is_object($myAdapter)) { $faq = $myAdapter->createFaq(); } xhelpAdminFooter(); xoops_cp_footer(); }
function xt_show_themes() { global $tpl, $xtf, $xoopsSecurity, $xtAssembler, $xtFunctions; $current = $xtAssembler->theme(); // Read all available themes $dh = opendir(XOOPS_THEME_PATH); $i = 0; while (false !== ($dir = readdir($dh))) { if ($dir == '.' || $dir == '..' || is_file(XOOPS_THEME_PATH . '/' . $dir)) { continue; } if (!is_file(XOOPS_THEME_PATH . '/' . $dir . '/theme.html')) { continue; } // Supported themes $theme_path = XOOPS_THEME_PATH . '/' . $dir; if (is_file($theme_path . '/assemble/' . strtolower($dir) . '.theme.php')) { include_once $theme_path . '/assemble/' . strtolower($dir) . '.theme.php'; $class = ucfirst(strtolower($dir)); $theme = new $class(); } else { $theme = new StandardTheme(); $theme->set_dir($dir); } $themes[$i] = $theme->getInfo(); $themes[$i]['url'] = $theme->url(); $themes[$i]['installed'] = !$theme->isNew(); $i++; } $tpl->add_style("themes.css", 'xthemes'); $tpl->add_script('masonry.pkgd.min.js', 'xthemes'); $tpl->add_script('xthemes.js', 'xthemes'); $tpl->add_head_script("var xoops_url = '" . XOOPS_URL . "';"); $tpl->assign('xoops_pagetitle', __('Themes Manager', 'xthemes')); $bc = RMBreadCrumb::get(); $bc->add_crumb(__('Themes', 'xthemes')); xoops_cp_header(); include $tpl->get_template("xt_themes.php", 'module', 'xthemes'); xoops_cp_footer(); }
/** * @desc Visualiza las plataformas existentes y muestra formulario de plataformas **/ function showPlatforms($edit = 0) { global $xoopsSecurity, $xoopsModule; $id = rmc_server_var($_REQUEST, 'id', 0); $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = "SELECT * FROM " . $db->prefix('dtrans_platforms'); $result = $db->queryF($sql); $platforms = array(); while ($rows = $db->fetchArray($result)) { $plat = new DTPlatform(); $plat->assignVars($rows); $platforms[] = array('id' => $plat->id(), 'name' => $plat->name()); } if ($edit) { //Verificamos si plataforma es válida if ($id <= 0) { redirectMsg('platforms.php', __('You must specified a valid platform ID!', 'dtransport'), 1); die; } //Verificamos si plataforma existe $plat = new DTPlatform($id); if ($plat->isNew()) { redirectMsg('platforms.php', __('Sepecified platform does not exists!', 'dtransport'), 1); die; } } RMTemplate::get()->add_xoops_style('admin.css', 'dtransport'); RMTemplate::get()->add_local_script('jquery.validate.min.js', 'rmcommon', 'include'); RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include'); RMTemplate::get()->add_local_script('admin.js', 'dtransport'); RMTemplate::get()->add_head('<script type="text/javascript"> var dt_message = "' . __('Do you really want to delete selected platforms', 'dtransport') . '"; var dt_select_message = "' . __('Select at least one platform to delete!', 'dtransport') . '"; </script>'); DTFunctions::toolbar(); xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . ($edit ? __('Edit Platform', 'dtransport') : __('New Platform', 'dtransport'))); xoops_cp_header(); include RMTemplate::get()->get_template('admin/dtrans_platforms.php', 'module', 'dtransport'); xoops_cp_footer(); }
function show_dashboard() { global $xoopsModule; RMFunctions::create_toolbar(); $db = Database::getInstance(); $sql = 'SELECT * FROM ' . $db->prefix('modules'); $result = $db->query($sql); $installed_mods = array(); while ($row = $db->fetchArray($result)) { $installed_mods[] = $row['dirname']; } require_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $dirlist = XoopsLists::getModulesList(); $available_mods = array(); $module_handler =& xoops_gethandler('module'); $i = 0; foreach ($dirlist as $file) { if ($i > 5) { break; } clearstatcache(); $file = trim($file); if (!in_array($file, $installed_mods)) { $module =& $module_handler->create(); if (!$module->loadInfo($file, false)) { continue; } $available_mods[] = $module; } $i++; } xoops_cp_header(); RMTemplate::get()->add_style('dashboard.css', 'rmcommon'); RMTemplate::get()->add_script(RMCURL . '/include/js/dashboard.js'); RMTemplate::get()->add_style('pagenav.css', 'rmcommon'); RMTemplate::get()->set_help('http://redmexico.com.mx/docs/common-utilities'); include RMTemplate::get()->get_template('rmc_dashboard.php', 'module', 'rmcommon'); xoops_cp_footer(); }
/** * @desc Muestra el formulario para edición/creación de categorías */ function showForm($edit = 0) { global $xoopsModule, $xoopsConfig, $xoopsModuleConfig; define('RMSUBLOCATION', 'newcategory'); if ($edit) { $id = rmc_server_var($_GET, 'id', 0); if ($id <= 0) { redirectMsg('categos.php', __('You had not provided a category ID', 'bxpress'), 1); die; } $catego = new bXCategory($id); if ($catego->isNew()) { redirectMsg('categos.php', __('Specified category does not exists!', 'bxpress'), 1); die; } } bXFunctions::menu_bar(); xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> » " . ($edit ? __('Edit Category', 'bxpress') : __('New Category', 'bxpress'))); xoops_cp_header(); $form = new RMForm($edit ? __('Edit Category', 'bxpress') : __('New Category', 'bxpress'), 'frmCat', 'categos.php'); $form->addElement(new RMFormText(__('Name', 'bxpress'), 'title', 50, 100, $edit ? $catego->title() : ''), true); if ($edit) { $form->addElement(new RMFormText(__('Short name', 'bxpress'), 'friendname', 50, 100, $catego->friendName())); } $form->addElement(new RMFormEditor(__('Description', 'bxpress'), 'desc', '90%', '300px', $edit ? $catego->description() : '')); $form->addElement(new RMFormYesNo(__('Show description', 'bxpress'), 'showdesc', $edit ? $catego->showDesc() : 1)); $form->addElement(new RMFormYesNo(__('Activate', 'bxpress'), 'status', $edit ? $catego->status() : 1)); $form->addElement(new RMFormGroups(__('Groups', 'bxpress'), 'groups', 1, 1, 4, $edit ? $catego->groups() : array(0)), true, 'checked'); $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save')); if ($edit) { $form->addElement(new RMFormHidden('id', $catego->id())); } $buttons = new RMFormButtonGroup(); $buttons->addButton('sbt', __('Submit', 'bxpress'), 'submit', '', true); $buttons->addButton('cancel', __('Cancel', 'bxpress'), 'button', 'onclick="window.location=\'categos.php\';"'); $form->addElement($buttons); $form->display(); xoops_cp_footer(); }