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


PHP RMTemplate类代码示例

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


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

示例1: __construct

 public function __construct($caption, $name, $selected = 0)
 {
     $this->setName($name);
     $this->setCaption($caption);
     $this->selected = $selected;
     RMTemplate::get()->add_local_script('teams_field.js', 'match');
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:7,代码来源:mchteamsfield.class.php

示例2: rd_block_resources

/**
* Este archivo permite controlar el bloque o los bloques
* Bloques Existentes:
* 
* 1. Publicaciones Recientes
* 2. Publicaciones Populares (Mas Leídas)
* 3. Publicaciones Mejor Votadas
*/
function rd_block_resources($options)
{
    global $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/modules/docs/class/rdresource.class.php';
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $mc = RMUtilities::module_config('docs');
    $sql = "SELECT * FROM " . $db->prefix("rd_resources") . ' WHERE public=1 AND approved=1';
    switch ($options[0]) {
        case 'recents':
            $sql .= " ORDER BY created DESC";
            break;
        case 'popular':
            $sql .= " ORDER BY `reads` DESC";
            break;
    }
    $sql .= " LIMIT 0, " . ($options[1] > 0 ? $options[1] : 5);
    $result = $db->query($sql);
    $block = array();
    while ($row = $db->fetchArray($result)) {
        $res = new RDResource();
        $res->assignVars($row);
        $ret = array();
        $ret['id'] = $res->id();
        $ret['title'] = $res->getVar('title');
        if ($options[2]) {
            $ret['desc'] = $options[3] == 0 ? $res->getVar('description') : TextCleaner::truncate($res->getVar('description'), $options[3]);
        }
        $ret['link'] = $res->permalink();
        $ret['author'] = sprintf(__('Created by %s', 'docs'), '<strong>' . $res->getVar('owname') . '</strong>');
        $ret['reads'] = sprintf(__('Viewed %s times', 'docs'), '<strong>' . $res->getVar('reads') . '</strong>');
        $block['resources'][] = $ret;
    }
    RMTemplate::get()->add_style('blocks.css', 'docs');
    return $block;
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:43,代码来源:rd_resources.php

示例3: showForm

function showForm()
{
    global $db, $xoopsOption, $xoopsUser, $mc, $tpl, $xoopsConfig, $xoopsModuleConfig, $user, $xoopsSecurity;
    $xoopsOption['template_main'] = "gs_submit.html";
    $xoopsOption['module_subpage'] = 'submit';
    include 'header.php';
    GSFunctions::makeHeader();
    $mc =& $xoopsModuleConfig;
    $tpl->assign('lang_uploadyour', __('Upload your Pictures', 'galleries'));
    $tpl->assign('lang_step1', __('Step 1:', 'galleries'));
    $tpl->assign('lang_step2', __('Step 2:', 'galleries'));
    $tpl->assign('lang_step3', __('Step 3:', 'galleries'));
    $tpl->assign('lang_step4', __('Step 4:', 'galleries'));
    $tpl->assign('lang_choose', __('Select Files', 'galleries'));
    $tpl->assign('lang_privacy', __('Set Privacy', 'galleries'));
    $tpl->assign('lang_privateme', __('Private (<em>Only you will seee these pictures</em>)', 'galleries'));
    $tpl->assign('lang_privatef', __('For Friends (<em>Only you and your friends will see these pictures</em>)', 'galleries'));
    $tpl->assign('lang_public', __('Public (<em>Pictures will visible for all</em>)'));
    $tpl->assign('lang_upload', __('Upload Files', 'galleries'));
    $tpl->assign('lang_clicktou', __('Click to Upload', 'galleries'));
    $tpl->assign('lang_tagsesp', __('Specify tags to use', 'galleries'));
    $tpl->assign('lang_tagsdesc', __('Separate each tag with a comma (,).', 'galleries'));
    $tpl->assign('lang_maxsize', sprintf(__('The maximum file size allowed is <strong>%s</strong>.', 'galleries'), RMUtilities::formatBytesSize($mc['size_image'] * 1024)));
    $tpl->assign('used_graph', GSFunctions::makeQuota($user, false));
    $tpl->assign('form_action', GSFunctions::get_url() . ($mc['urlmode'] ? 'submit/' : '?submit=submit'));
    $tpl->assign('token', $xoopsSecurity->getTokenHTML());
    $used = round($user->usedQuota() / $user->quota() * 100) . '%';
    $tpl->assign('lang_used', sprintf(__('You have used <strong>%s</strong> of <strong>%s</strong> available. You left <strong>%s</strong>', 'galleries'), $used, RMUtilities::formatBytesSize($user->quota()), RMUtilities::formatBytesSize($user->usedQuota() >= $user->quota() ? 0 : $user->quota() - $user->usedQuota())));
    RMTemplate::get()->add_xoops_style('submit.css', 'galleries');
    include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:submit.php

示例4: 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

示例5: showTeams

/**
* @desc Muestra todos los equipos registrados
*/
function showTeams()
{
    global $db, $tpl, $xoopsModule, $xoopsConfig, $adminTemplate;
    $tpl->assign('lang_existing', _AS_TC_EXISTING);
    $tpl->assign('lang_id', _AS_TC_ID);
    $tpl->assign('lang_image', _AS_TC_IMAGE);
    $tpl->assign('lang_name', _AS_TC_NAME);
    $tpl->assign('lang_catego', _AS_TC_CATEGO);
    $tpl->assign('lang_coachs', _AS_TC_COACHS);
    $tpl->assign('lang_options', _OPTIONS);
    $tpl->assign('lang_edit', _EDIT);
    $tpl->assign('lang_delete', _DELETE);
    $tpl->assign('lang_confirmm', _AS_TC_CONFM);
    $tpl->assign('lang_confirm', _AS_TC_CONFDEL);
    $tpl->assign('lang_date', _AS_TC_DATE);
    $tpl->assign('lang_players', _AS_TC_PLAYERS);
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $team = new TCTeam();
        $team->assignVars($row);
        $cat = new TCCategory($team->category());
        $coachs = '';
        foreach ($team->coachs(true) as $coach) {
            $coachs .= $coachs == '' ? $coach->name() : '<br />' . $coach->name();
        }
        $teams[] = array('id' => $team->id(), 'name' => $team->name(), 'image' => $team->image(), 'catego' => $cat->name(), 'coachs' => $coachs, 'date' => formatTimestamp($team->created(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . _AS_TC_TEAMSLOC);
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_teams.php", 'module', 'team');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:36,代码来源:teams.php

示例6: showCategos

/**
 * Muestra una lista de las categorías existentes
 */
function showCategos()
{
    global $xoopsModule, $xoopsSecurity;
    $row = array();
    qpArrayCategos($row);
    $categories = array();
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    foreach ($row as $k) {
        $catego = new QPCategory($k['id_cat']);
        $catego->update();
        list($num) = $db->fetchRow($db->query("SELECT COUNT(*) FROM " . $db->prefix("qpages_pages") . " WHERE cat='{$k['id_cat']}'"));
        $k['posts'] = $num;
        $k['nombre'] = str_repeat("&#8212;", $k['saltos']) . ' ' . $k['nombre'];
        $categories[] = $k;
    }
    // Event
    $categories = RMEvents::get()->run_event('qpages.categories.list', $categories);
    RMTemplate::get()->add_style('admin.css', 'qpages');
    RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
    RMTemplate::get()->add_script('../include/js/qpages.js');
    RMTemplate::get()->assign('xoops_pagetitle', __('Categories management', 'qpages'));
    xoops_cp_location('<a href="./">' . $xoopsModule->name() . '</a> &raquo; ' . __('Categories', 'qpages'));
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/qp_categos.php", 'module', 'qpages');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:cats.php

示例7: showLicences

/**
* @desc Visualiza todas las licencias existentes
**/
function showLicences()
{
    global $xoopsModule, $xoopsSecurity;
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "SELECT * FROM " . $db->prefix('dtrans_licences');
    $result = $db->queryF($sql);
    $licences = array();
    while ($rows = $db->fetchArray($result)) {
        $lc = new DTLicense();
        $lc->assignVars($rows);
        $licences[] = array('id' => $lc->id(), 'name' => $lc->name(), 'url' => $lc->link(), 'type' => $lc->type());
    }
    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 licenses', 'dtransport') . '";
            var dt_select_message = "' . __('Select at least one licence to delete!', 'dtransport') . '";
        </script>');
    DTFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Licences Management', 'dtransport'));
    xoops_cp_header();
    include RMTemplate::get()->get_template('admin/dtrans_licenses.php', 'module', 'dtransport');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:licenses.php

示例8: rmmfShow

/**
 * Mostramos las categor?as
 */
function rmmfShow()
{
    global $db;
    define('RMCLOCATION', 'categories');
    MFFunctions::toolbar();
    RMTemplate::get()->add_head("<script type='text/javascript'>\n\t\t\t<!--\n\t\t\t\tfunction decision(message, url){\n\t\t\t\t\tif(confirm(message)) location.href = url;\n\t\t\t\t}\n\t\t\t-->\n\t\t   </script>");
    $result = array();
    MFFunctions::get_categories($result);
    include_once '../class/table.class.php';
    $table = new MFTable(true);
    $table->setCellStyle("padding: 0px; padding-left: 10px; border-bottom: 1px solid #0066CC; border-right: 1px solid #0066CC; background: url(../images/bgth.jpg) repeat-x; height: 20px; color: #FFFFFF;");
    $table->openTbl('100%', '', 1);
    $table->openRow('left');
    $table->addCell(_MA_RMMF_CATEGOS, 1, 3);
    $table->closeRow();
    $table->setRowClass('head');
    $table->setCellStyle("padding: 0px; padding-left: 3px; padding-right: 3px; border-bottom: 1px solid #DBE691; border-right: 1px solid #DBE691; background: url(../images/bghead.jpg) repeat-x; height: 20px; color: #000000;");
    $table->openRow('center');
    $table->addCell(_MA_RMMF_NAME, 0, '', 'center');
    $table->addCell(_MA_RMMF_ORDER, 0, '', 'center');
    $table->addCell(_MA_RMMF_OPTIONS, 0, '', 'center');
    $table->closeRow();
    $table->setRowClass('odd,even', true);
    $table->setCellStyle('');
    foreach ($result as $k => $v) {
        $table->openRow();
        $table->addCell(($v['saltos'] <= 0 ? "<img src='../images/plus.gif' border='0' align='absmiddle' />" : str_repeat("&nbsp;", $v['saltos']) . "<img src='../images/root.gif' border='0' align='absmiddle' />") . " <strong>{$v['nombre']}</strong>", 0, '', 'left');
        $table->addCell($v['orden'], 0, '', 'center');
        $table->addCell("<a href='?op=edit&amp;id={$v['id_cat']}'>" . _MA_RMMF_EDIT . "</a> &nbsp;| &nbsp;\n\t\t\t\t\t<a href=\"javascript:decision('" . sprintf(_MA_RMMF_CONFIRM, $v['nombre']) . "','?op=del&id={$v['id_cat']}');\">" . _MA_RMMF_DELETE . "</a>", 0, '', 'center');
        $table->closeRow();
    }
    $table->closeTbl();
    xoops_cp_header();
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:38,代码来源:categos.php

示例9: cache_view_files

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

示例10: xt_menu_options

function xt_menu_options()
{
    RMTemplate::get()->add_tool(__('Dashboard', 'xthemes'), 'index.php', 'images/dashboard.png', 'dashboard');
    RMTemplate::get()->add_tool(__('Theme Settings', 'xthemes'), 'index.php?op=config', 'images/settings.png', 'settings');
    RMTemplate::get()->add_tool(__('Catalog', 'xthemes'), 'index.php?op=catalog', 'images/catalog.png', 'catalog');
    RMTemplate::get()->add_tool(__('About', 'xthemes'), 'index.php?op=about', 'images/about.png', 'about');
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:7,代码来源:functions.php

示例11: showPlayers

function showPlayers()
{
    global $xoopsModule, $mc, $adminTemplate, $tpl, $db;
    $gteam = TCFunctions::get('team');
    $team = new TCTeam($gteam);
    // Equipos
    $tpl->assign('team', $team->isNew() ? 0 : $team->id());
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_teams") . " ORDER BY name");
    $teams = array();
    while ($row = $db->fetchArray($result)) {
        $ct = new TCTeam();
        $ct->assignVars($row);
        $cat =& $ct->category(true);
        $teams[] = array('id' => $ct->id(), 'name' => $ct->name() . " (" . $cat->name() . ")");
    }
    // Entrenadores
    $coachs = array();
    if (!$team->isNew()) {
        foreach ($team->coachs(true) as $coach) {
            $coachs[] = array('id' => $coach->id(), 'name' => $coach->name(), 'image' => $coach->image());
        }
    }
    // Jugadores
    $result = $db->query("SELECT * FROM " . $db->prefix("coach_players") . " WHERE team='" . $team->id() . "'");
    $players = array();
    while ($row = $db->fetchArray($result)) {
        $player = new TCPlayer();
        $player->assignVars($row);
        $players[] = array('id' => $player->id(), 'name' => $player->name(), 'image' => $player->image(), 'number' => $player->number(), 'age' => $player->age(), 'date' => formatTimestamp($player->date(), 'c'));
    }
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Jugadores', 'admin_team'));
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/coach_players.php", 'module', 'team');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:players.php

示例12: rmmfShow

function rmmfShow()
{
    global $db;
    define('RMCLOCATION', 'index');
    MFFunctions::toolbar();
    xoops_cp_header();
    RMTemplate::get()->add_head("<script type='text/javascript'>\n\t\t\t<!--\n\t\t\t\tfunction decision(message, url){\n\t\t\t\t\tif(confirm(message)) location.href = url;\n\t\t\t\t}\n\t\t\t-->\n\t\t   </script>");
    /**
     * @todo Create pagination
     */
    $result = $db->query("SELECT * FROM " . $db->prefix("rmmf_works") . " ORDER BY titulo");
    include_once '../class/catego.class.php';
    $items = array();
    while ($row = $db->fetchArray($result)) {
        $catego = new MFCategory($row['catego']);
        $items[] = array('title' => $row['titulo'], 'category' => $catego->getVar('nombre'), 'featured' => $row['resaltado'], 'id' => $row['id_w']);
    }
    /*
    	$table->setRowClass('odd,even', true);
    	$table->setCellStyle('');
    	
    	
    	$table->closeTbl();
    	rmmf_make_footer();*/
    include RMTemplate::get()->get_template('admin/mf-index.php', 'module', 'myfolder');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:27,代码来源:index.php

示例13: showFriends

/**
* @desc Visualiza la lista de amigos del usuario
**/
function showFriends()
{
    global $xoopsOption, $tpl, $db, $xoopsUser, $xoopsModuleConfig, $pag, $xoopsConfig;
    $xoopsOption['template_main'] = 'gs_panel_friends.html';
    include 'header.php';
    $mc =& $xoopsModuleConfig;
    GSFunctions::makeHeader();
    //Barra de Navegación
    $sql = "SELECT COUNT(*) FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
    $page = isset($pag) ? $pag : '';
    $limit = 30;
    list($num) = $db->fetchRow($db->query($sql));
    if ($page > 0) {
        $page -= 1;
    }
    $start = $page * $limit;
    $tpages = (int) ($num / $limit);
    if ($num % $limit > 0) {
        $tpages++;
    }
    $pactual = $page + 1;
    if ($pactual > $tpages) {
        $rest = $pactual - $tpages;
        $pactual = $pactual - $rest + 1;
        $start = ($pactual - 1) * $limit;
    }
    if ($tpages > 1) {
        if ($mc['urlmode']) {
            $urlnav = 'cpanel/friends';
        } else {
            $urlnav = 'cpanel.php?by=cpanel/friends';
        }
        $nav = new GsPageNav($num, $limit, $start, 'pag', $urlnav, 0);
        $tpl->assign('friendsNavPage', $nav->renderNav(4, 1));
    }
    $showmax = $start + $limit;
    $showmax = $showmax > $num ? $num : $showmax;
    $tpl->assign('lang_showing', sprintf(__('Sowing friends %u to %u from %u.', 'galleries'), $start + 1, $showmax, $num));
    $tpl->assign('limit', $limit);
    $tpl->assign('pag', $pactual);
    //Fin de barra de navegación
    $sql = "SELECT * FROM " . $db->prefix('gs_friends') . " WHERE gsuser='" . $xoopsUser->uid() . "'";
    $sql .= " LIMIT {$start},{$limit}";
    $result = $db->query($sql);
    while ($row = $db->fetchArray($result)) {
        $xu = new XoopsUser($row['uid']);
        $tpl->append('users', array('uid' => $xu->uid(), 'uname' => $xu->uname(), 'link' => XOOPS_URL . "/modules/galleries/" . ($mc['urlmode'] ? "usr/" . $xu->uname() . "/" : "user.php?id=usr/" . $xu->uname()), 'avatar' => RMEvents::get()->run_event('rmcommon.get.avatar', $xu->email(), 0, $xu->user_avatar() != '' ? XOOPS_URL . '/uploads/avatars/' . $xu->user_avatar() : GS_URL . '/images/avatar.png')));
    }
    $tpl->assign('lang_uname', __('User name', 'galleries'));
    $tpl->assign('lang_newfriend', __('New Friend', 'galleries'));
    $tpl->assign('lang_del', __('Delete', 'galleries'));
    $tpl->assign('lang_confirm', __('Do you really wish to delete specified friend?', 'galleries'));
    $tpl->assign('lang_confirms', __('Do you really wish to delete selected friends?', 'galleries'));
    $tpl->assign('form_action_add', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/add/' : '?cp=add'));
    $tpl->assign('form_action_del', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/delete/' : '?cp=delete'));
    $tpl->assign('delete_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/deletefriend/pag/' . $pactual . '/id/' : '?cp=deletefriend&amp;page=' . $pactual . '&amp;id='));
    RMTemplate::get()->add_style('panel.css', 'galleries');
    createLinks();
    include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:63,代码来源:cp_friends.php

示例14: showCategories

/**
* @desc Visualiza todas las categorías existentes
**/
function showCategories()
{
    global $xoopsModule, $xoopsSecurity;
    $categos = array();
    DTFunctions::getCategos($categos);
    $categories = array();
    foreach ($categos as $row) {
        $cat = new DTCategory();
        $cat->assignVars($row);
        $categories[] = array('id' => $cat->id(), 'name' => $cat->name(), 'parent' => $cat->parent(), 'active' => $cat->active(), 'description' => $cat->desc(), 'indent' => $row['jumps']);
    }
    unset($categos);
    RMTemplate::get()->add_local_script('jquery.checkboxes.js', 'rmcommon', 'include');
    RMTemplate::get()->add_local_script('jquery.validate.min.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 categories', 'dtransport') . '";
            var dt_select_message = "' . __('Select at least one category to delete!', 'dtransport') . '";
        </script>');
    RMTemplate::get()->add_xoops_style('admin.css', 'dtransport');
    DTFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Categories', 'dtransport'));
    xoops_cp_header();
    include RMTemplate::get()->get_template('admin/dtrans_categos.php', 'module', 'dtransport');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:categories.php

示例15: search_resources

function search_resources()
{
    global $xoopsConfig, $xoopsUser, $page, $xoopsTpl;
    $keyword = rmc_server_var($_GET, 'keyword', '');
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1";
    list($num) = $db->fetchRow($db->query($sql));
    $page = rmc_server_var($_GET, 'page', 1);
    $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(RDFunctions::make_link('search') . '?keyword=' . $keyword . '&amp;page={PAGE_NUM}');
    $sql = "SELECT * FROM " . $db->prefix("rd_resources") . " WHERE (title LIKE '%{$keyword}%' OR description LIKE '%{$keyword}%') AND public=1 AND approved=1 LIMIT {$start}, {$limit}";
    $result = $db->query($sql);
    $resources = array();
    while ($row = $db->fetchArray($result)) {
        $res = new RDResource();
        $res->assignVars($row);
        $resources[] = array('id' => $res->id(), 'title' => $res->getVar('title'), 'desc' => TextCleaner::truncate($res->getVar('description'), 100), 'link' => $res->permalink(), 'created' => $res->getVar('created'), 'owner' => $res->getVar('owner'), 'uname' => $res->getVar('owname'), 'reads' => $res->getVar('reads'));
    }
    RDFunctions::breadcrumb();
    RMBreadCrumb::get()->add_crumb(__('Browsing recent Documents', 'docs'));
    RMTemplate::get()->add_style('docs.css', 'docs');
    include 'header.php';
    $xoopsTpl->assign('xoops_pagetitle', sprintf(__('Search results for "%s"', 'docs'), $keyword));
    include RMEvents::get()->run_event('docs.template.search', RMTemplate::get()->get_template('rd_search.php', 'module', 'docs'));
    include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:30,代码来源:search.php


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