Example #1
0
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();
}
Example #2
0
/**
* @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> &raquo; " . ($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();
}
Example #3
0
/**
* @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();
}
Example #4
0
/**
 * @brief display error message & exit (Tentative)
 */
function system_images_error($message)
{
    xoops_cp_header();
    xoops_error($message);
    xoops_cp_footer();
    exit;
}
Example #5
0
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> &raquo; <a href='./cats.php'>" . __('Administración de Categorías', 'admin_team') . "</a> &raquo; " . ($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();
}
Example #6
0
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();
}
Example #7
0
function smartpartner_xoops_cp_header()
{
    xoops_cp_header();
    ?>
    <script type='text/javascript' src='funcs.js'></script>
    <script type='text/javascript' src='cookies.js'></script>
    <?php 
}
Example #8
0
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();
}
Example #9
0
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();
}
Example #10
0
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> &raquo; <a href='./coachs.php'>" . __('Entrenadores', 'admin_team') . "</a> &raquo; " . ($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 &start()
 {
     global $xoopsConfig, $xoopsModule;
     NBFrame::using('AdminTpl');
     $this->mXoopsTpl =& new NBFrameAdminTpl($this);
     $this->_addSmartyPugin();
     xoops_cp_header();
     $this->renderMyMenu();
     return $this->mXoopsTpl;
 }
Example #12
0
/**
* Formulario para crear publicaciones
**/
function rd_show_form($edit = 0)
{
    global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
    RDFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . ($edit ? __('Editing Document', 'docs') : __('Create Document', 'docs')));
    xoops_cp_header();
    $id = rmc_server_var($_GET, 'id', 0);
    $page = rmc_server_var($_GET, 'page', 1);
    if ($edit) {
        //Comprueba si la publicación es válida
        if ($id <= 0) {
            redirectMsg('./resources.php?page=' . $page, __('You must provide an ID from some Document to edit!', 'docs'), 1);
            die;
        }
        //Comprueba si la publicación existe
        $res = new RDResource($id);
        if ($res->isNew()) {
            redirectMsg('./resources.php?page=' . $page, __('Specified Document does not exists!', 'docs'), 1);
            die;
        }
    }
    $form = new RMForm($edit ? sprintf(__('Edit Document: %s', 'docs'), $res->getVar('title')) : __('New Document', 'docs'), 'frmres', 'resources.php');
    $form->addElement(new RMFormText(__('Document title', 'docs'), 'title', 50, 150, $edit ? $res->getVar('title') : ''), true);
    if ($edit) {
        $form->addElement(new RMFormText(__('Document slug', 'docs'), 'nameid', 50, 150, $res->getVar('nameid')));
    }
    $form->addElement(new RMFormTextArea(__('Description', 'docs'), 'desc', 5, 50, $edit ? $res->getVar('description', 'e') : ''), true);
    $form->addElement(new RMFormUser(__('Editors', 'docs'), 'editors', 1, $edit ? $res->getVar('editors') : '', 30));
    //Propietario de la publicacion
    if ($edit) {
        $form->addElement(new RMFormUser(__('Document owner', 'docs'), 'owner', 0, $edit ? array($res->getVar('owner')) : '', 30));
    }
    $form->addElement(new RMFormYesno(__('Approve content and changes by editors', 'docs'), 'approvededit', $edit ? $res->getVar('editor_approve') : 0));
    $form->addElement(new RMFormGroups(__('Groups that can see this Document', 'docs'), 'groups', 1, 1, 5, $edit ? $res->getVar('groups') : array(1, 2)), true);
    $form->addElement(new RMFormYesno(__('Set as public', 'docs', 'docs'), 'public', $edit ? $res->getVar('public') : 0));
    $form->addElement(new RMFormYesNo(__('Quick index', 'docs'), 'quick', $edit ? $res->getVar('quick') : 0));
    //Mostrar índice a usuarios sin permiso de publicación
    $form->addElement(new RMFormYesno(__('Show index to restricted users', 'docs'), 'showindex', $edit ? $res->getVar('show_index') : 0));
    $form->addElement(new RMFormYesno(__('Featured', 'docs'), 'featured', $edit ? $res->getVar('featured') : 0));
    $form->addElement(new RMFormYesno(__('Approve inmediatly', 'docs'), 'approvedres', $edit ? $res->getVar('approved') : 1));
    $form->addElement(new RMFormYesno(__('Show content in a single page', 'docs'), 'single', $edit ? $res->getVar('single') : 0));
    $form->element('single')->setDescription(__('When you enable this option the Document content will show in a single page.', 'docs'));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', $edit ? __('Update Document', 'docs') : __('Create Document', 'docs'), 'submit');
    $buttons->addButton('cancel', __('Cancel', 'docs'), 'button', 'onclick="window.location=\'resources.php\';"');
    $form->addElement($buttons);
    $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save'));
    if ($edit) {
        $form->addElement(new RMFormHidden('id', $id));
    }
    $form->addElement(new RMFormHidden('page', $page));
    $form->addElement(new RMFormHidden('app', $edit ? $res->getVar('approved') : 0));
    $form->display();
    xoops_cp_footer();
}
Example #13
0
function m_teams_form($edit = 0)
{
    global $mc, $xoopsModule, $db;
    MCHFunctions::toolbar();
    RMTemplate::get()->assign('xoops_pagetitle', $edit ? __('Edit Team', 'match') : __('Add Team', 'match'));
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> &raquo; \n        <a href='teams.php'>" . __('Teams', 'match') . '</a> &raquo; ' . ($edit ? __('Edit Team', 'match') : __('Add Team', '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('./teams.php', __('Provide a team ID!', 'match'), 1);
            die;
        }
        //Verificamos si la categoría existe
        $team = new MCHTeam($id);
        if ($team->isNew()) {
            redirectMsg('./teams.php', __('Specified team was not found!', 'match'), 1);
            die;
        }
    }
    $form = new RMForm($edit ? __('Edit Team', 'match') : __('Add Team', 'match'), 'frmNew', 'teams.php');
    $form->setExtra('enctype="multipart/form-data"');
    $form->addElement(new RMFormText(__('Name', 'match'), 'name', 50, 150, $edit ? $team->getVar('name') : ''), true);
    if ($edit) {
        $form->addElement(new RMFormText(__('Short name', 'match'), 'nameid', 50, 150, $team->getVar('nameid')), true);
    }
    $form->addElement(new RMFormEditor(__('Team Information', 'match'), 'info', '100%', '250px', $edit ? $team->getVar('info', 'e') : ''));
    $sel_cats = new RMFormSelect(__('Category:', 'match'), 'category', 0, $edit ? array($team->getVar('category')) : 0);
    $categories = array();
    MCHFunctions::categories_tree($categories, 0, 0, true, 0, '`name` ASC');
    $sel_cats->addOption(0, __('Select category...', 'match'), $edit ? $team->getVar('category') == 0 ? 1 : 0 : 1);
    foreach ($categories as $catego) {
        $sel_cats->addOption($catego['id'], str_repeat('&#151;', $catego['indent']) . ' ' . $catego['name']);
    }
    $form->addElement($sel_cats, true);
    $form->addElement(new RMFormYesNo(__('Active', 'match'), 'active', $edit ? $team->getVar('active') : 1));
    $form->addElement(new RMFormDate(__('Registered on', 'match'), 'created', $edit ? $team->getVar('created') : time(), false));
    $form->addElement(new RMFormFile(__('Team logo', 'match'), 'logo', 45));
    if ($edit) {
        $form->addElement(new RMFormLabel(__('Current logo', 'match'), '<img src="' . MCH_UP_URL . '/' . $team->getVar('logo') . '" alt="' . $team->getVar('name') . '" />'));
    }
    $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save'));
    if ($edit) {
        $form->addElement(new RMFormHidden('id', $team->id()));
    }
    $ele = new RMFormButtonGroup();
    $ele->addButton('sbt', $edit ? __('Save Changes!', 'match') : __('Add Now!', 'match'), 'submit');
    $ele->addButton('cancel', _CANCEL, 'button', 'onclick="window.location=\'teams.php\';"');
    $form->addElement($ele);
    $form = RMEvents::get()->run_event('match.form.teams', $form);
    $form->display();
    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();
}
Example #15
0
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();
}
Example #16
0
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&amp;lib=altsys&amp;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;
}
Example #17
0
function show_rm_blocks()
{
    global $xoopsModule, $xoopsConfig, $wid_globals, $xoopsSecurity;
    $db = Database::getInstance();
    $modules = RMFunctions::get_modules_list(1);
    // ** API Event **
    // Allows other methods to add o modify the list of available widgets
    $modules = RMEvents::get()->run_event('rmcommon.blocks.modules', $modules);
    // Cargamos los grupos
    $sql = "SELECT groupid, name FROM " . $db->prefix("groups") . " ORDER BY name";
    $result = $db->query($sql);
    $groups = array();
    while ($row = $db->fetchArray($result)) {
        $groups[] = array('id' => $row['groupid'], 'name' => $row['name']);
    }
    // Cargamos las posiciones de bloques
    $bpos = RMBlocksFunctions::block_positions();
    $sql = createSQL();
    $result = $db->query($sql);
    $blocks = array();
    $used_blocks = array();
    while ($row = $db->fetchArray($result)) {
        $mod = RMFunctions::load_module($row['element']);
        if (!$mod) {
            continue;
        }
        $used_blocks[] = array('id' => $row['bid'], 'title' => $row['name'], 'module' => array('id' => $mod->mid(), 'dir' => $mod->dirname(), 'name' => $mod->name()), 'canvas' => $bpos[$row['canvas']], 'weight' => $row['weight'], 'visible' => $row['visible'], 'type' => $row['type'], 'options' => $row['edit_func'] != '' ? 1 : 0, 'description' => $row['description']);
    }
    // ** API **
    // Event for manege the used widgets list
    $used_blocks = RMEvents::get()->run_event('rmcommon.used.blocks.list', $used_blocks);
    $positions = array();
    foreach ($bpos as $row) {
        $positions[] = array('id' => $row['id_position'], 'name' => $row['name']);
    }
    $positions = RMEvents::get()->run_event('rmcommon.block.positions.list', $positions);
    xoops_cp_location('<a href="./">' . $xoopsModule->getVar('name') . '</a> &raquo; ' . __('Blocks', 'rmcommon'));
    RMTemplate::get()->add_style('blocks.css', 'rmcommon');
    RMTemplate::get()->add_local_script('blocks.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('jkmenu.js', 'rmcommon', 'include');
    RMTemplate::get()->add_style('forms.css', 'rmcommon');
    RMTemplate::get()->add_local_script('jquery-ui.min.js', 'rmcommon', 'include');
    xoops_cp_header();
    // Available Widgets
    $blocks = RMBlocksFunctions::get_available_list($modules);
    // Position
    $the_position = isset($_GET['pos']) ? intval($_GET['pos']) : '';
    include RMTemplate::get()->get_template("rmc_blocks.php", 'module', 'rmcommon');
    xoops_cp_footer();
}
Example #18
0
/**
* @desc Formulario de creación/edición de clientes
**/
function formClients($edit = 0)
{
    global $xoopsModule, $db;
    $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
    $page = isset($_REQUEST['pag']) ? $_REQUEST['pag'] : '';
    $limit = isset($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 15;
    $ruta = "pag={$page}&limit={$limit}";
    if ($edit) {
        //Verificamos si el cliente es válido
        if ($id <= 0) {
            redirectMsg('./clients.php?' . $ruta, __('You must provide a customer ID', 'works'), 1);
            die;
        }
        //Verificamos si el cliente existe
        $client = new PWClient($id);
        if ($client->isNew()) {
            redirectMsg('./clients.php?' . $ruta, __('Specified customer does not exists!', 'works'), 1);
            die;
        }
    }
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . "</a> &raquo; <a href='./clients.php'>" . __('Customers', 'works') . "</a> &raquo;" . ($edit ? __('Edit Customer', 'works') : __('New Customer', 'works')));
    RMTemplate::get()->assign('xoops_pagetitle', __('Customers', 'works'));
    PWFunctions::toolbar();
    xoops_cp_header();
    $form = new RMForm($edit ? __('Edit Customer', 'works') : __('New Customer', 'works'), 'frmClient', 'clients.php');
    $form->addElement(new RMFormText(__('Name', 'works'), 'name', 50, 200, $edit ? $client->name() : ''), true);
    $form->addElement(new RMFormText(__('Company', 'works'), 'business', 50, 200, $edit ? $client->businessName() : ''));
    $form->addElement(new RMFormText(__('Email address', 'works'), 'mail', 50, 100, $edit ? $client->email() : ''));
    $form->addElement(new RMFormTextArea(__('Description', 'works'), 'desc', 4, 50, $edit ? $client->desc() : ''), true);
    //Tipos de Cliente
    $ele = new RMFormSelect(__('Type', 'works'), 'type');
    $ele->addOption(0, _SELECT);
    $result = $db->query("SELECT * FROM " . $db->prefix('pw_types'));
    while ($row = $db->fetchArray($result)) {
        $ele->addOption($row['id_type'], $row['type'], $edit ? $row['id_type'] == $client->type() ? 1 : 0 : 0);
    }
    $form->addElement($ele, true, 'noselect:0');
    $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save'));
    $form->addElement(new RMFormHidden('id', $id));
    $form->addElement(new RMFormHidden('page', $page));
    $form->addElement(new RMFormHidden('limit', $limit));
    $ele = new RMFormButtonGroup();
    $ele->addButton('sbt', $edit ? __('Save Changes', 'works') : __('Create Customer', 'works'), 'submit');
    $ele->addButton('cancel', __('Cancel', 'works'), 'button', 'onclick="window.location=\'clients.php?' . $ruta . '\';"');
    $form->addElement($ele);
    //Event
    $form = RMEvents::get()->run_event('works.form.customers', $form);
    $form->display();
    xoops_cp_footer();
}
Example #19
0
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&amp;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&amp;action=del'>" . _AM_DELETE . "</a></td>\n\t\t\t  </tr>";
    }
    echo "</table>";
    xoops_cp_footer();
}
Example #20
0
function privmanager()
{
    $member_handler =& xoops_gethandler('group');
    $groups =& $member_handler->getObjects();
    $group_ids = array();
    foreach ($groups as $group) {
        $group_ids[$group->getVar('groupid')] = $group->getVar('name');
    }
    $group_handler =& xoops_getmodulehandler('priv');
    $priv_groups =& $group_handler->getObjects();
    $priv_group_ids = array();
    foreach ($priv_groups as $priv_group) {
        $priv_group_ids[$priv_group->getVar('priv_gid')] = $priv_group->getVar('name');
    }
    $non_groups =& array_diff($group_ids, $priv_group_ids);
    xoops_cp_header();
    echo sprintf('<h4>%s&nbsp;&raquo;&raquo;&nbsp;%s</h4>', indexLink(), _AM_WEBLOG_PRIVMANAGER_WEBLOG);
    echo _AM_WEBLOG_PRIVMANAGER_WEBLOG_CAUTION . "<br /><br />";
    echo "<table width='100%' class='outer' cellspacing='1'>\r\n";
    echo sprintf("<tr><th colspan='3'>%s</th></tr>", _AM_WEBLOG_PRIVMANAGER_WEBLOG);
    echo "<tr valign='top' align='center'><td width='40%' class='head'>" . _AM_WEBLOG_NONPRIV . "</td>";
    echo "<td class='head'><br /></td>";
    echo "<td width='40%' class='head'>" . _AM_WEBLOG_PRIV . "</td></tr>";
    echo "<form action='privmanager.php' method='post'>";
    echo "<tr valign='top' align='center'>";
    echo "<td class='even'><select name='gid[]' size='10' multiple>";
    foreach ($non_groups as $g_id => $g_name) {
        if ($g_id != XOOPS_GROUP_ANONYMOUS) {
            echo sprintf("<option value='%d'>%s</option>", $g_id, $g_name);
        }
    }
    echo "</select></td>";
    echo "<td class='odd' valign='middle'>";
    echo sprintf("<input type='submit' class='formButton' name='add' value='%s'/>", _AM_WEBLOG_ADDPRIV . ' -->');
    echo "<input type='hidden' name='action' value='add' />";
    echo "</form>";
    echo "<form action='privmanager.php' method='post'>";
    echo sprintf("<input type='submit' class='formButton' name='delete' value='%s'/>", '<-- ' . _AM_WEBLOG_DELETEPRIV);
    echo "<input type='hidden' name='action' value='delete' />";
    echo "</td>";
    echo "<td class='even'>";
    echo "<select name='gid[]' size='10' multiple>";
    foreach ($priv_group_ids as $g_id => $g_name) {
        echo sprintf("<option value='%d'>%s</option>", $g_id, $g_name);
    }
    echo "</select></td></tr>";
    echo "</form>";
    echo "</table>\r\n";
    xoops_cp_footer();
}
Example #21
0
function listBrokenDownloads()
{
    global $xoopsDB, $eh;
    $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("wfs_broken") . " ORDER BY reportid");
    $totalbrokendownloads = $xoopsDB->getRowsNum($result);
    xoops_cp_header();
    echo "<h4>" . _AM_DLCONF . "</h4>";
    echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr class='odd'><td>";
    echo "<h4>" . _AM_BROKENREPORTS . " ({$totalbrokendownloads})</h4><br />";
    if ($totalbrokendownloads == 0) {
        echo _AM_NOBROKEN;
    } else {
        echo "<center>" . _AM_IGNOREDESC . "<br />" . _AM_DELETEDESC . "</center><br /><br /><br />";
        $colorswitch = "#dddddd";
        echo "<table align='center' width='90%'>";
        echo "\r\n\t\t<tr>\r\n\t\t\t<td><b>" . _AM_FILETITLE . "</b></td>\r\n\t\t\t<td><b>" . _AM_REPORTER . "</b></td>\r\n\t\t\t<td><b>" . _AM_IGNORE . "</b></td>\r\n\t\t\t<td><b>" . _AM_EDIT . "</b></td>\r\n\t\t\t<td><b>" . _AM_DELETE . "</b></td>\r\n\t\t</tr>";
        while (list($reportid, $lid, $sender, $ip) = $xoopsDB->fetchRow($result)) {
            $result2 = $xoopsDB->query("SELECT fileshowname FROM " . $xoopsDB->prefix("wfs_files") . " WHERE fileid={$lid}");
            if ($sender != 0) {
                $result3 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . $sender . "");
                list($sendername, $email) = $xoopsDB->fetchRow($result3);
            }
            list($fileshowname) = $xoopsDB->fetchRow($result2);
            $result4 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . $owner . "");
            list($ownername, $owneremail) = $xoopsDB->fetchRow($result4);
            echo "<tr><td bgcolor={$colorswitch}><a href=index.php?op=fileedit&fileid={$lid} target='_blank'>" . $fileshowname . "</a></td>";
            if ($email == "") {
                echo "<td bgcolor={$colorswitch}>{$sendername} ({$ip})";
            } else {
                echo "<td bgcolor={$colorswitch}><a href=mailto:{$email}>{$sendername}</a> ({$ip})";
            }
            echo "</td>";
            echo "</td><td bgcolor='{$colorswitch}' align='center'>";
            echo myTextForm("brokendown.php?op=ignoreBrokenDownloads&lid={$lid}", "X");
            echo "</td><td bgcolor='{$colorswitch}' align='center'>";
            echo myTextForm("index.php?op=fileedit&fileid={$lid}", "X");
            echo "</td><td bgcolor='{$colorswitch}' align='center'>";
            echo myTextForm("brokendown.php?op=delBrokenDownloads&lid={$lid}", "X");
            echo "</td></tr>";
            if ($colorswitch == "#dddddd") {
                $colorswitch = "#ffffff";
            } else {
                $colorswitch = "#dddddd";
            }
        }
        echo "</table>";
    }
    echo "</td></tr></table>";
}
Example #22
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>
    ';
}
Example #23
0
/**
 * Includes scripts in HTML header
 *
 * @return void
 */
function publisher_cpHeader()
{
    xoops_cp_header();
    //cannot use xoTheme, some conflit with admin gui
    echo '<link type="text/css" href="' . PUBLISHER_URL . '/css/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
    <link type="text/css" href="' . PUBLISHER_URL . '/css/publisher.css" rel="stylesheet" />
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/funcs.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/cookies.js"></script>
    <script type="text/javascript" src="' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/ui.core.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/ui.tabs.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/ajaxupload.3.9.js"></script>
    <script type="text/javascript" src="' . PUBLISHER_URL . '/js/publisher.js"></script>
    ';
}
Example #24
0
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();
}
Example #25
0
/**
* 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> &raquo; \n        <a href='categories.php'>" . __('Categories', 'match') . '</a> &raquo; ' . ($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('&#151;', $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();
}
Example #26
0
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();
}
Example #27
0
/**
* @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> &raquo; <a href='./types.php'>" . __('Customer types', 'works') . "</a> &raquo; " . ($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();
}
Example #28
0
function RankForumEdit($rank_id)
{
    $db =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    xoops_cp_header();
    echo '<a href="admin.php?fct=userrank">' . _AM_RANKSSETTINGS . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . _AM_EDITRANK . '<br /><br />';
    $result = $db->query("SELECT * FROM " . $db->prefix("ranks") . " WHERE rank_id=" . $rank_id);
    $rank = $db->fetchArray($result);
    $rank['rank_title'] = $myts->htmlSpecialChars($rank['rank_title']);
    $rank['rank_image'] = $myts->htmlSpecialChars($rank['rank_image']);
    $rank['form_title'] = _AM_EDITRANK;
    $rank['op'] = 'RankForumSave';
    include_once XOOPS_ROOT_PATH . '/modules/system/admin/userrank/rankform.php';
    $rank_form->addElement(new XoopsFormHidden('old_rank', $rank['rank_image']));
    $rank_form->display();
    xoops_cp_footer();
}
Example #29
0
/**
* @desc Formulario de Logs
**/
function dt_form_logs($edit = 0)
{
    global $xoopsModule, $xoopsConfig;
    define('RMCSUBLOCATION', 'newlog');
    $id = rmc_server_var($_GET, 'id', 0);
    $item = rmc_server_var($_GET, 'item', 0);
    //Verificamos si el software es válido
    if ($item <= 0) {
        redirectMsg('items.php', __('Download item ID has not been provided!', 'dtransport'), RMMSG_WARN);
    }
    //Verificamos si existe el software
    $sw = new DTSoftware($item);
    if ($sw->isNew()) {
        redirectMsg('items.php', __('Specified download item does not exists!', 'dtransport'), 1);
    }
    if ($edit) {
        //Verificamos si log es válido
        if ($id <= 0) {
            redirectMsg('logs.php?item=' . $item, __('Log item ID has not been provided!', 'dtransport'), RMMSG_WARN);
        }
        //Verificamos si log existe
        $log = new DTLog($id);
        if ($log->isNew()) {
            redirectMsg('logs.php?item=' . $item, __('Specified item log does not exists!', 'dtranport'), 1);
        }
    }
    $dtf = new DTFunctions();
    $dtf->toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; <a href='./items.php'>" . sprintf(__('"%s" Logs', 'dtransport'), $sw->getVar('name')) . "</a> &raquo; " . ($edit ? __('Edit Log', 'dtransport') : __('New Log', 'dtransport')));
    xoops_cp_header();
    $form = new RMForm($edit ? sprintf(__('Edit Change Log of "%s"', 'dtransport'), $sw->getVar('name')) : sprintf(__('New Log for "%s"', 'dtransport'), $sw->getVar('name')), 'frmlog', 'logs.php');
    $form->addElement(new RMFormLabel(__('Download Item', 'dtransport'), $sw->getVar('name')));
    $form->addElement(new RMFormText(__('Log title', 'dtransport'), 'title', 50, 100, $edit ? $log->title() : ''), true);
    $form->addElement(new RMFormEditor(__('Log content', 'dtransport'), 'log', '90%', '350px', $edit ? $log->getVar('log', 'e') : ''), true);
    $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save'));
    $form->addElement(new RMFormHidden('item', $item));
    $form->addElement(new RMFormHidden('id', $id));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', _SUBMIT, 'submit');
    $buttons->addButton('cancel', _CANCEL, 'button', 'onclick="window.location=\'logs.php?item=' . $item . '\';"');
    $form->addElement($buttons);
    $form->display();
    xoops_cp_footer();
}
Example #30
0
/**
* @desc Formulario de creación/edición de usuarios
**/
function formUsers($edit = 0)
{
    global $xoopsModule, $xoopsModuleConfig;
    $mc =& $xoopsModuleConfig;
    $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
    $page = isset($_REQUEST['pag']) ? $_REQUEST['pag'] : '';
    $limit = isset($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 15;
    $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : '';
    $ruta = "pag={$page}&search={$search}";
    if ($edit) {
        //Verificamos que el usuario sea válido
        if ($id <= 0) {
            redirectMsg('./users.php?' . $ruta, __('User id is not valid!', 'galleries'), 1);
            die;
        }
        //Verificamos que el usuario exista
        $user = new GSUser($id);
        if ($user->isNew()) {
            redirectMsg('./users.php?' . $ruta, __('Specified user does not exists!', 'galleries'), 1);
            die;
        }
    }
    GSFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; <a href='./users.php'>" . __('Users management', 'galleries') . "</a> &raquo; " . ($edit ? __('Edit User', 'galleries') : __('New User', 'galleries')));
    RMTemplate::get()->assign('xoops_pagetitle', $edit ? __('Edit User', 'galleries') : __('New User', 'galleries'));
    xoops_cp_header();
    $form = new RMForm($edit ? __('Edit User', 'galleries') : __('New User', 'galleries'), 'frmuser', 'users.php');
    $form->addElement(new RMFormUser(__('Xoops User', 'galleries'), 'uid', 0, $edit ? array($user->uid()) : '', 30));
    $ele = new RMFormText(__('Max Quota', 'galleries'), 'quota', 10, 10, $edit ? $user->quota() / 1024 / 1024 : $mc['quota']);
    $ele->setDescription(__('This value determines the total disc quota to be used for user and must be specified in megabytes.', 'galleries'));
    $form->addElement($ele, true);
    $form->addElement(new RMFormYesno(__('Blocked', 'galleries'), 'block', $edit ? $user->blocked() : 0));
    $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save'));
    $form->addElement(new RMFormHidden('id', $id));
    $form->addElement(new RMFormHidden('page', $page));
    $form->addElement(new RMFormHidden('search', $search));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', $edit ? __('Save Changes', 'galleries') : __('Create User', 'galleries'), 'submit');
    $buttons->addButton('cancel', __('Cancel', 'galleries'), 'button', 'onclick="window.location=\'users.php?' . $ruta . '\'"');
    $form->addElement($buttons);
    $form->display();
    xoops_cp_footer();
}