当前位置: 首页>>代码示例>>PHP>>正文


PHP xoops_cp_location函数代码示例

本文整理汇总了PHP中xoops_cp_location函数的典型用法代码示例。如果您正苦于以下问题:PHP xoops_cp_location函数的具体用法?PHP xoops_cp_location怎么用?PHP xoops_cp_location使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xoops_cp_location函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formLicences

/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:38,代码来源:licenses.php

示例2: edit_bookmark

/**
* @desc Muestra el formulario para agregar un nuevo sitio
*/
function edit_bookmark()
{
    global $xoopsModule, $xoopsConfig, $xoopsSecurity;
    $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();
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> &raquo; <a href="bookmarks.php">' . __('Social Sites', 'mywords') . '</a> &raquo; ' . __('Editing Social Site', 'mywords'));
    xoops_cp_header();
    $show_edit = true;
    include RMTemplate::get()->get_template('admin/mywords_bookmarks.php', 'module', 'mywords');
    RMTemplate::get()->assign('xoops_pagetitle', __('Bookmarks Management', 'mywords'));
    RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
    RMTemplate::get()->add_script('../include/js/scripts.php?file=bookmarks.js');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:30,代码来源:bookmarks.php

示例3: categoriesForm

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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:cats.php

示例4: formCoachs

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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:57,代码来源:coachs.php

示例5: rd_show_form

/**
* 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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:58,代码来源:resources.php

示例6: m_teams_form

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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:54,代码来源:teams.php

示例7: formClients

/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:53,代码来源:clients.php

示例8: show_rm_blocks

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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:50,代码来源:blocks.php

示例9: m_categories_form

/**
* 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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:52,代码来源:categories.php

示例10: formTypes

/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:49,代码来源:types.php

示例11: dt_form_logs

/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:47,代码来源:logs.php

示例12: formUsers

/**
* @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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:users.php

示例13: formCategos

/**
* @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> &raquo; " . ($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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:categories.php

示例14: newForm

/**
 * Presenta un formulario para la creación de una nueva
 * categoría para los artículos
 */
function newForm($edit = 0)
{
    global $xoopsModule;
    if ($edit) {
        $id = isset($_GET['id']) ? $_GET['id'] : 0;
        if ($id <= 0) {
            redirectMsg('cats.php', __('You must provide a category ID to edit!', 'qpages'), 1);
            die;
        }
        // Cargamos la categoría
        $catego = new QPCategory($id);
        // Si no existe entonces devolvemos un error
        if ($catego->isNew()) {
            redirectMsg('cats.php', __('Specified category does not exists!', 'qpages'), 1);
            die;
        }
    }
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> &raquo; ' . ($edit ? __('Edit Category', 'qpages') : __('New Category', 'qpages')));
    xoops_cp_header();
    $cats = array();
    qpArrayCategos($cats, 0, 0, $edit ? array($id) : 0);
    $form = new RMForm($edit ? __('Edit Category', 'qpages') : __('New Category', 'qpages'), 'frmNew', 'cats.php');
    $form->addElement(new RMFormText(__('Category name', 'qpages'), 'nombre', 50, 150, $edit ? $catego->getName() : ''), true);
    $form->addElement(new RMFormTextArea(__('Description', 'qpages'), 'descripcion', 5, 45, $edit ? $catego->getVar('descripcion', 'e') : ''));
    $ele = new RMFormSelect(__('Category parent', 'qpages'), 'parent');
    $ele->addOption(0, _SELECT, $edit ? $catego->getParent() == 0 ? 1 : 0 : 1);
    foreach ($cats as $k) {
        $ele->addOption($k['id_cat'], str_repeat("-", $k['saltos']) . ' ' . $k['nombre'], $edit ? $catego->getParent() == $k['id_cat'] ? 1 : 0 : 0);
    }
    $form->addElement($ele);
    $form->addElement(new RMFormHidden('op', $edit ? 'saveedit' : 'save'));
    if ($edit) {
        $form->addElement(new RMFormHidden('id', $id));
    }
    $ele = new RMFormButtonGroup('', ' ');
    $ele->addButton('sbt', $edit ? __('Update Category', 'qpages') : __('Create Category', 'qpages'), 'submit');
    $ele->addButton('cancel', __('Cancel', 'qpages'), 'button');
    $ele->setExtra('cancel', "onclick='history.go(-1);'");
    $form->addElement($ele);
    $form->display();
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:cats.php

示例15: rd_figures_form

/**
* @desc Permite la edición de figuras
**/
function rd_figures_form($edit = 0)
{
    global $xoopsModule, $xoopsConfig;
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . $edit ? __('Edit Figure', 'docs') : __('Create Figure'));
    xoops_cp_header();
    $id = rmc_server_var($_GET, 'id', 0);
    $id_res = rmc_server_var($_GET, 'res', 0);
    if ($id_res <= 0) {
        redirectMsg('resources.php', __('First select a Document to manage the figures.', 'docs'), 1);
    }
    $res = new RDResource($id_res);
    if ($res->isNew()) {
        redirectMsg('resources.php', __('Specified Document does not exists!', 'docs'), 1);
    }
    if ($edit) {
        if ($id <= 0) {
            redirectMsg('figures.php?res=' . $id_res, __('You have not specified a figure to edit!', 'docs'));
            break;
        }
        $fig = new RDFigure($id);
        if ($fig->isNew()) {
            redirectMsg('figures.php?res=' . $id_res, __('Specified figure does not exists!', 'docs'));
            break;
        }
    }
    $form = new RMForm($edit ? __('Editing Figure', 'docs') : __('Create Figure', 'docs'), 'frmfig', 'figures.php');
    $form->addElement(new RMFormText(__('Title', 'docs'), 'title', 50, 255, $edit ? $fig->getVar('title') : ''), true);
    $form->addElement(new RMFormText(__('Description', 'docs'), 'desc', 50, 255, $edit ? $fig->getVar('desc') : ''), true);
    $form->addElement(new RMFormEditor(__('Content', 'docs'), 'figure', '100%', '300px', $edit ? $fig->getVar('content', 'e') : ''), true);
    $form->addElement(new RMFormText(__('Attributes', 'docs'), 'attrs', 50, 150, $edit ? $fig->getVar('attrs') : ''));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', $edit ? __('Save Changes', 'docs') : __('Save Figure', 'docs'), 'submit');
    $buttons->addButton('cancel', __('Cancel', 'docs'), 'button', 'onclick="window.location=\'figures.php?res=' . $id_res . '\';"');
    $form->addElement($buttons);
    $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save'));
    if ($edit) {
        $form->addElement(new RMFormHidden('id', $id));
    }
    $form->addElement(new RMFormHidden('res', $id_res));
    $form->display();
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:45,代码来源:figures.php


注:本文中的xoops_cp_location函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。