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


PHP Resources::linkFileFooter方法代码示例

本文整理汇总了PHP中Resources::linkFileFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP Resources::linkFileFooter方法的具体用法?PHP Resources::linkFileFooter怎么用?PHP Resources::linkFileFooter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Resources的用法示例。


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

示例1: form

 /**
  * Форма подписки на рассылку
  * @param $id
  * @param string $tpl
  *
  * @return string HTML code
  */
 public static function form($id, $tpl = 'subscribe.widget.form')
 {
     $subscribe = subscribe_model_Subscribe::getById($id);
     if ($subscribe) {
         Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/subscribe/js/subscriber.js');
     }
     $view = new View();
     $view->subscribe = $subscribe;
     if (empty($tpl)) {
         $tpl = array('subscribe', 'widget', 'form');
         if (!empty($subscribe) && !empty($subscribe->alias)) {
             $tpl[] = $subscribe->alias;
         }
     }
     return $view->render($tpl, 'module');
 }
开发者ID:Alex300,项目名称:subscribe,代码行数:23,代码来源:Widget.php

示例2: elseif

    $sqlfilter .= " AND pm_tostate = 0";
    $title[] = $L['pm_unread'];
} elseif ($filter == 'starred') {
    $sqlfilter .= $f == 'sentbox' ? " AND pm_fromstate = 2" : " AND pm_tostate = 2";
    $title[] = $L['pm_starred'];
}
/* === Hook === */
foreach (cot_getextplugins('pm.list.main') as $pl) {
    include $pl;
}
/* ===== */
/* === Title === */
$title_params = array('PM' => $L['Private_Messages'], 'COUNT' => $totalcount, 'BOX' => $subtitle);
$out['subtitle'] = cot_title('{BOX} ({COUNT}) - {PM}', $title_params);
$out['head'] .= $R['code_noindex'];
Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/pm/js/pm.js');
/* === Title === */
$totallines = $db->query("SELECT COUNT(*) FROM {$db_pm} WHERE {$sqlfilter}")->fetchColumn();
$elem = $f == 'sentbox' ? 'pm_touserid' : 'pm_fromuserid';
$pm_sql = $db->query("SELECT p.*, u.* FROM {$db_pm} AS p\n\t\tLEFT JOIN {$db_users} AS u\n\t\tON u.user_id = p.{$elem}\n\t\tWHERE {$sqlfilter}\n\t\tORDER BY pm_date DESC LIMIT  {$d}," . $cfg['pm']['maxpmperpage']);
$pagenav = cot_pagenav('pm', 'f=' . $f . '&filter=' . $filter, $d, $totallines, $cfg['pm']['maxpmperpage'], 'd', '', $cfg['pm']['turnajax']);
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate(cot_tplfile(array('pm', 'list', $pmalttpl)));
$jj = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('pm.list.loop');
/* ===== */
foreach ($pm_sql->fetchAll() as $row) {
    $jj++;
    $row['pm_icon_readstatus'] = $row['pm_tostate'] == '0' ? cot_rc_link(cot_url('pm', 'm=message&id=' . $row['pm_id']), $R['pm_icon_new'], array('title' => $L['pm_unread'], 'class' => $cfg['pm']['turnajax'] ? 'ajax' : '')) : cot_rc_link(cot_url('pm', 'm=message&id=' . $row['pm_id']), $R['pm_icon'], array('title' => $L['pm_read'], 'class' => 'ajax'));
    $pm_data = cot_parse($row['pm_text'], $cfg['pm']['markup']);
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:pm.list.php

示例3: linkFile

 /**
  * A shortcut for plain output of a link to a CSS/JS file in the header of the page
  *
  * @param string $path Stylesheet *.css or script *.js path/url
  * @param string $type
  * @param int $order
  * @return bool
  *
  * @throws Exception
  */
 public static function linkFile($path, $type = '', $order = 50)
 {
     // header.php executed. Try add file to footer
     if (static::$headerComplete) {
         return Resources::linkFileFooter($path, $type, $order);
     }
     $tmp = explode('?', $path);
     $fileName = $tmp[0];
     if (in_array($fileName, static::$addedFiles)) {
         return false;
     }
     if (mb_strpos($fileName, '@') === 0) {
         $fileName = static::$alias[$fileName];
     } elseif (mb_strpos($fileName, 'http://') === false && mb_strpos($fileName, 'https://') === false && mb_strpos($fileName, '//') !== 0) {
         if (!file_exists($fileName)) {
             throw new Exception('Resource file «' . $fileName . '» not exists');
         }
     }
     if (empty($type)) {
         $type = preg_match('#\\.(js|css)$#i', $fileName, $m) ? strtolower($m[1]) : 'js';
     }
     static::$addedFiles[] = $tmp[0];
     static::$headerRc[$type][$order][] = $path;
     foreach (static::additionalFiles($tmp[0]) as $file) {
         static::linkFile($file, '', $order);
     }
 }
开发者ID:Cotonti,项目名称:valencia,代码行数:37,代码来源:resources.php

示例4: cot_rc_link_footer

/**
 * A shortcut to append a JavaScript or CSS file to {FOOTER_JS} tag
 *
 * @global array $out Output snippets
 * @param string $path JavaScript or CSS file path
 *
 * @deprecated Will be removed in v.1.0. Resources::linkFileFooter() instead
 */
function cot_rc_link_footer($path)
{
    Resources::linkFileFooter($path);
}
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:12,代码来源:functions.php

示例5: implode

if ($f_miniput['f_choose'] == 'fthumbs') {
    $fclass = 'fancybox-thumbs';
    $fgroup = 'thumb';
}
$fa_conf = '$(document).ready(function() {$("a[href]").filter(function() {return /\\.(jpg|jpeg|png|gif)$/i.test(this.href);}).attr({"class":"' . $fclass . '","data-fancybox-group":"' . $fgroup . '"})});';
if ($f_miniput['f_scale']) {
    if (empty($f_miniput['f_scalelspx'])) {
        $scale_param[] = !empty($f_miniput['f_scalewpx']) ? 'w:"' . $f_miniput['f_scalewpx'] . 'px"' : '';
        $scale_param[] = !empty($f_miniput['f_scalehpx']) ? 'h:"' . $f_miniput['f_scalehpx'] . 'px"' : '';
        $scale_param = implode(', ', $scale_param);
    } else {
        $scale_param = 'ls:"' . $f_miniput['f_scalelspx'] . 'px"';
    }
    $fa_conf .= '$(document).ready(function(){jQuery(document).ready(function($){$("a[data-fancybox-group] img").jScale({' . $scale_param . '})})});';
}
$fa_conf .= Resources::minify(file_get_contents($cfg['plugins_dir'] . '/fancyboxes/js/fancyboxes.cfg.js'), 'js');
if ($f_miniput['f_nomainjs']) {
    if ($env['ext'] != 'index' && $env['location'] != 'home') {
        Resources::linkFileFooter($cfg['plugins_dir'] . '/fancyboxes/js/jquery.fancybox.pack.js');
        if ($f_miniput['f_scale']) {
            Resources::linkFileFooter($cfg['plugins_dir'] . '/fancyboxes/js/jquery.jScale.js');
        }
        Resources::embedFooter($fa_conf);
    }
} else {
    Resources::linkFileFooter($cfg['plugins_dir'] . '/fancyboxes/js/jquery.fancybox.pack.js');
    if ($f_miniput['f_scale']) {
        Resources::linkFileFooter($cfg['plugins_dir'] . '/fancyboxes/js/jquery.jScale.js');
    }
    Resources::embedFooter($fa_conf);
}
开发者ID:Roffun,项目名称:fancyboxes,代码行数:31,代码来源:fancyboxes.footer.php

示例6: ckeditor_max_timestamp

global $ckeditor_timestamp;
if (!$ckeditor_timestamp) {
    $ckeditor_timestamp = ckeditor_max_timestamp($cfg['plugins_dir'] . '/ckeditor/lib');
}
// Main CKEditor file
Resources::linkFileFooter(cot::$cfg['plugins_dir'] . '/ckeditor/lib/ckeditor.js?' . $ckeditor_timestamp, 'js');
// Load preset and connector
if (cot::$usr['id'] > 0) {
    $preset_name = 'group_' . cot::$usr['maingrp'];
    if (!file_exists(cot::$cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.{$preset_name}.set.js")) {
        $preset_name = 'default';
    }
} else {
    $preset_name = file_exists(cot::$cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.group_1.set.js") ? 'group_1' : 'default';
}
Resources::linkFileFooter(cot::$cfg['plugins_dir'] . "/ckeditor/presets/ckeditor.{$preset_name}.set.js?" . $ckeditor_timestamp);
if (!empty($ckeditor_css_to_load) && is_array($ckeditor_css_to_load)) {
    foreach ($ckeditor_css_to_load as $key => $css_file) {
        if (!file_exists($css_file)) {
            unset($ckeditor_css_to_load[$key]);
        }
    }
} else {
    // Default ckeditor content styles
    $ckeditor_css_connector = "CKEDITOR.config.contentsCss = ['" . cot::$cfg['plugins_dir'] . "/ckeditor/lib/styles.js?'];";
    $ckeditor_css_to_load = array(cot::$cfg['plugins_dir'] . '/ckeditor/lib/styles.js?' . $ckeditor_timestamp, cot::$cfg['plugins_dir'] . '/ckeditor/presets/contents.default.css?' . $ckeditor_timestamp);
}
if (sizeof($ckeditor_css_to_load)) {
    $ckeditor_css_connector = "CKEDITOR.config.contentsCss = ['" . implode("','", $ckeditor_css_to_load) . "'];";
}
Resources::embedFooter("CKEDITOR.timestamp = {$ckeditor_timestamp}; CKEDITOR.config.baseHref='{$cfg['mainurl']}/'; " . $ckeditor_css_connector);
开发者ID:Roffun,项目名称:Cotonti,代码行数:31,代码来源:ckeditor.editor.php

示例7: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=header.main
[END_COT_EXT]
==================== */
/**
 * Cotonti Banners Module
 * Banner rotation with statistics
 *
 * @package Banners
 * @author Kalnov Alexey    <kalnovalexey@yandex.ru>
 * @copyright Portal30 Studio http://portal30.ru
 */
defined('COT_CODE') or die('Wrong URL.');
$brsInclided = false;
if (cot::$cfg['headrc_consolidate'] && cot::$cache) {
    Resources::addFile(cot::$cfg['modules_dir'] . "/brs/js/brs.js");
    $brsInclided = true;
}
if (!empty($cache_ext) && cot::$usr['id'] == 0 && cot::$cfg['cache_' . $cache_ext]) {
    Resources::embedFooter("var brsX = '" . cot::$sys['xk'] . "'");
    if (!$brsInclided) {
        Resources::linkFileFooter(cot::$cfg['modules_dir'] . "/brs/js/brs.js");
    }
}
开发者ID:Alex300,项目名称:brs,代码行数:27,代码来源:brs.header.main.php

示例8: indexAction

 public function indexAction()
 {
     Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/advboard/js/advboard.compare.js');
     $sort = cot_import('s', 'G', 'ALP');
     // order field name
     $way = cot_import('w', 'G', 'ALP', 4);
     // order way (asc, desc)
     //$maxrowsperpage = cot::$cfg['advboard']['cat___default']['maxrowsperpage'];
     $maxrowsperpage = 0;
     /* === Hook === */
     foreach (cot_getextplugins('advboard.compare.first') as $pl) {
         include $pl;
     }
     /* ===== */
     $sort = empty($sort) ? cot::$cfg['advboard']['cat___default']['order'] : $sort;
     $way = empty($way) || !in_array($way, array('asc', 'desc')) ? cot::$cfg['advboard']['cat___default']['way'] : $way;
     $canonicalUrlParams = array('m' => 'compare');
     $where = array();
     if (!empty($_SESSION['advboard_compare']) && !empty($_SESSION['advboard_compare'][cot::$sys['site_id']])) {
         $where['id'] = array('id', array_keys($_SESSION['advboard_compare'][cot::$sys['site_id']]));
         $where['state'] = array('state', advboard_model_Advert::PUBLISHED);
         $where['begin'] = array('begin', cot::$sys['now'], '<=');
         $where['expire'] = array('SQL', "expire = 0 OR expire > " . cot::$sys['now']);
     }
     $template = array('advboard', 'compare');
     cot::$out['subtitle'] = cot::$L['advboard_compare'];
     // Building the canonical URL
     cot::$out['canonical_uri'] = cot_url('advboard', $canonicalUrlParams);
     $condition = array();
     foreach ($where as $key => $val) {
         $condition[] = $val;
     }
     $order = array(array('sticky', 'desc'), array($sort, $way));
     /* === Hook === */
     foreach (cot_getextplugins('advboard.compare.query') as $pl) {
         include $pl;
     }
     /* ===== */
     $advertisement = null;
     $totallines = 0;
     if (!empty($condition)) {
         $totallines = advboard_model_Advert::count($condition);
         if ($totallines > 0) {
             $advertisement = advboard_model_Advert::find($condition, $maxrowsperpage, 0, $order);
         }
     }
     /* === Hook === */
     foreach (cot_getextplugins('advboard.compare.main') as $pl) {
         include $pl;
     }
     /* ===== */
     $crumbs = array();
     if (cot::$cfg['advboard']['firstCrumb']) {
         $crumbs[] = array(cot_url('advboard'), cot::$L['advboard_ads']);
     }
     $crumbs[] = array(cot_url('advboard', array('m' => 'compare')), cot::$L['advboard_compare']);
     $breadcrumbs = '';
     if (!empty($crumbs)) {
         $breadcrumbs = cot_breadcrumbs($crumbs, cot::$cfg['homebreadcrumb'], true);
     }
     //        $pageUrlParams = $urlParams;
     //        if($durl > 1) $pageUrlParams['d'] = $durl;
     $view = new View();
     $view->breadcrumbs = $breadcrumbs;
     $view->page_title = htmlspecialchars(cot::$L['advboard_compare']);
     $view->advertisement = $advertisement;
     $view->totalitems = $totallines;
     //        $view->urlParams = $urlParams;
     //        $view->pageUrlParams = $pageUrlParams;
     /* === Hook === */
     foreach (cot_getextplugins('advboard.compare.view') as $pl) {
         include $pl;
     }
     /* ===== */
     return $view->render($template);
 }
开发者ID:ASDAFF,项目名称:advboard,代码行数:76,代码来源:Compare.php

示例9: indexAction

 /**
  * Список рассылок
  */
 public function indexAction()
 {
     $maxrowsperpage = cot::$cfg['maxrowsperpage'];
     if ($maxrowsperpage < 1) {
         $maxrowsperpage = 1;
     }
     list($pg, $d, $durl) = cot_import_pagenav('d', $maxrowsperpage);
     //page number for pages list
     $sort = 'title';
     $way = 'asc';
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.list.first') as $pl) {
         include $pl;
     }
     /* ===== */
     $urlParams = array();
     $canonicalUrlParams = array();
     if ($durl > 1) {
         $canonicalUrlParams['d'] = $durl;
     }
     $where = array();
     cot::$out['subtitle'] = $title = cot::$L['subscribe_subscribes'];
     // Building the canonical URL
     cot::$out['canonical_uri'] = cot_url('subscribe', $canonicalUrlParams);
     $condition = array(array('active', 1), array('periodical', 1));
     $order = array(array('active', 'desc'), array($sort, $way));
     $userSubscribesCondition = array();
     if (cot::$usr['id'] > 0) {
         $userSubscribesCondition[] = array('active', 1);
         $userSubscribesCondition[] = array('user', cot::$usr['id']);
         if (!empty(cot::$usr['profile']['user_email'])) {
             //$userSubscribesCondition[] = array('email', cot::$usr['profile']['user_email'], '=', 'OR');
             $userSubscribesCondition = array(array('SQL', 'active=1 AND (user=' . cot::$usr['id'] . ' OR email=' . cot::$db->quote(cot::$usr['profile']['user_email']) . ')'));
         }
     }
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.list.query') as $pl) {
         include $pl;
     }
     /* ===== */
     $totallines = subscribe_model_Subscribe::count($condition);
     $items = null;
     if ($totallines > 0) {
         $items = subscribe_model_Subscribe::find($condition, $maxrowsperpage, $d, $order);
     }
     // Подписки пользователя
     $userSubscribes = null;
     $userSubscribesIds = array();
     if (!empty($items)) {
         if (cot::$usr['id'] > 0) {
             $userSubscribes = subscribe_model_Subscriber::find($userSubscribesCondition, 0, 0, array(array('active', 'desc')));
             if (!empty($userSubscribes)) {
                 foreach ($userSubscribes as $usRow) {
                     $userSubscribesIds[] = $usRow->rawValue('subscribe');
                 }
             }
         }
     }
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.list.main') as $pl) {
         include $pl;
     }
     /* ===== */
     if (cot::$usr['id'] > 0) {
         Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/subscribe/js/subscriber.js');
     }
     $crumbs = array(cot::$L['subscribe_subscribes']);
     $pagenav = cot_pagenav('subscribe', $urlParams, $d, $totallines, $maxrowsperpage);
     if (empty($pagenav['current'])) {
         $pagenav['current'] = 1;
     }
     $breadcrumbs = '';
     if (!empty($crumbs)) {
         $breadcrumbs = cot_breadcrumbs($crumbs, cot::$cfg['homebreadcrumb'], true);
     }
     $template = array('subscribe', 'list');
     //        $pageUrlParams = $urlParams;
     //        if($durl > 1) $pageUrlParams['d'] = $durl;
     $view = new View();
     $view->breadcrumbs = $breadcrumbs;
     $view->page_title = htmlspecialchars($title);
     $view->items = $items;
     $view->userSubscribes = $userSubscribes;
     $view->userSubscribesIds = $userSubscribesIds;
     $view->totalitems = $totallines;
     $view->pagenav = $pagenav;
     $view->urlParams = $urlParams;
     //        $view->pageUrlParams = $pageUrlParams;
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.list.view') as $pl) {
         include $pl;
     }
     /* ===== */
     return $view->render($template);
 }
开发者ID:Alex300,项目名称:subscribe,代码行数:98,代码来源:Main.php

示例10: defined

<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=global
[END_COT_EXT]
* ==================== */
/**
 * share global
 *
 * @author  Roffun
 * @copyright Copyright (C)  Roffun | https://github.com/Roffun/share
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_incfile('share', 'plug');
Resources::linkFileFooter($cfg['plugins_dir'] . '/share/js/goodshare.min.js');
Resources::embedFooter('$(document).ready(function(){$(".goodshare").css("display","block");$(".goodshare [data-type=toggle]").click(function(){$(".goodshare .hidden").toggle();});$(".goodshare .sh-close").click(function(){$(".goodshare .hidden").toggle();});});');
开发者ID:Roffun,项目名称:share,代码行数:18,代码来源:share.global.php

示例11: indexAction

 /**
  * Список рассылок
  *
  * @return string
  * @throws Exception
  */
 public function indexAction()
 {
     $uid = cot_import('uid', 'G', 'INT');
     if (!$uid || !cot::$usr['isadmin']) {
         $uid = cot::$usr['id'];
     }
     // Мои подписки - только для авторизованных пользователей
     if (!$uid) {
         cot_die_message('404');
     }
     $user = cot_user_data($uid);
     if (!$user) {
         cot_die_message('404');
     }
     cot::$out['canonical_uri'] = cot_url('subscribe', array('m' => 'user', 'uid' => $uid));
     $urlParams = array('m' => 'user');
     if ($uid != cot::$usr['id']) {
         $urlParams['uid'] = $uid;
     }
     $crumbs = array();
     if ($uid != cot::$usr['id']) {
         cot::$out['subtitle'] = $title = cot::$L['subscribe_user_subscribes'] . ': ' . cot_user_full_name($user);
         $crumbs[] = array(cot_url("users"), cot::$L['Users']);
         $crumbs[] = array(cot_url("users", "m=details&id=" . $user["user_id"] . "&u=" . $user["user_name"]), cot_user_full_name($user));
         $crumbs[] = cot::$L['subscribe_user_subscribes'];
         $urlParams['uid'] = $user['user_id'];
     } else {
         cot::$out['subtitle'] = $title = cot::$L['subscribe_my'];
         $crumbs[] = array(cot_url('users', array('m' => 'details')), cot::$L['subscribe_my_page']);
         $crumbs[] = cot::$L['subscribe_my'];
     }
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.user.list.query') as $pl) {
         include $pl;
     }
     /* ===== */
     // Все подписки данного пользователя
     $userSubscribes = subscribe_model_Subscriber::find(array(array('user', $uid), array('email', $user['user_email'], '=', 'OR')), 0, 0, array(array('active', 'desc')));
     $subIds = array();
     $totallines = 0;
     if ($userSubscribes) {
         $totallines = count($userSubscribes);
         foreach ($userSubscribes as $subscriberRow) {
             $subIds[] = $subscriberRow->rawValue('subscribe');
         }
     }
     $subscribes = null;
     if (!empty($subIds)) {
         $subIds = array_unique($subIds);
         $subscribes = subscribe_model_Subscribe::find(array(array('id', $subIds)), 0, 0, array(array('title', 'asc')));
         if (!empty($subscribes)) {
             foreach ($userSubscribes as $key => $subscriberRow) {
                 // маловероятная ситуация, но все же
                 if (!isset($subscribes[$subscriberRow->rawValue('subscribe')])) {
                     // Рассылки больше не существует.
                     // Удалить подписку
                     $subscriberRow->delete();
                     unset($userSubscribes[$key]);
                 }
             }
         }
     }
     Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/subscribe/js/subscriber.js');
     $breadcrumbs = '';
     if (!empty($crumbs)) {
         $breadcrumbs = cot_breadcrumbs($crumbs, cot::$cfg['homebreadcrumb'], true);
     }
     $template = array('subscribe', 'user', 'list');
     $view = new View();
     $view->breadcrumbs = $breadcrumbs;
     $view->page_title = htmlspecialchars($title);
     $view->fistNumber = 1;
     $view->userSubscribes = $userSubscribes;
     $view->subscribes = $subscribes;
     $view->totalitems = $totallines;
     $view->user = $user;
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.user.list.view') as $pl) {
         include $pl;
     }
     /* ===== */
     return $view->render($template);
 }
开发者ID:Alex300,项目名称:subscribe,代码行数:89,代码来源:User.php

示例12: indexAction


//.........这里部分代码省略.........
     $allowedFilters = array('id', 'sid', 'name', 'email', 'active');
     $f = cot_import('f', 'G', 'ARR');
     $filterForm = array('hidden' => '');
     if (!empty($f)) {
         foreach ($f as $key => $val) {
             if (!in_array($key, $allowedFilters)) {
                 unset($f[$key]);
             }
         }
         if (!empty($f['id'])) {
             $where['id'] = array('id', $f['id']);
             $urlParams['f[id]'] = $f['id'];
         }
         if (!empty($f['sid'])) {
             $where['sid'] = array('subscribe', $f['sid']);
             $urlParams['f[sid]'] = $f['sid'];
         }
         $f['active'] = isset($_GET['f']['active']) ? cot_import($_GET['f']['active'], 'D', 'INT') : -2;
         if ($f['active'] == -1) {
             unset($where['active']);
         } elseif ($f['active'] >= 0 && $f['active'] < 2) {
             $where['active'] = array('active', $f['active']);
             $urlParams['f[active]'] = $f['active'];
         }
         if (!empty($f['name'])) {
             $where['name'] = array('name', '*' . $f['name'] . '*');
             $urlParams['f[name]'] = $f['name'];
         }
         if (!empty($f['email'])) {
             $where['email'] = array('email', '*' . $f['email'] . '*');
             $urlParams['f[email]'] = $f['email'];
         }
     }
     if (isset(cot::$cfg['plugin']['urleditor']) && cot::$cfg['plugin']['urleditor']['preset'] != 'handy') {
         $filterForm['hidden'] .= cot_inputbox('hidden', 'm', 'subscribe');
     }
     $filterForm['hidden'] .= cot_inputbox('hidden', 'n', 'user');
     $condition = array();
     foreach ($where as $key => $val) {
         $condition[] = $val;
     }
     $order = array(array($sort, $way));
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.admin.subscriber.list.query') as $pl) {
         include $pl;
     }
     /* ===== */
     $totallines = subscribe_model_Subscriber::count($condition);
     $items = null;
     if ($totallines > 0) {
         $items = subscribe_model_Subscriber::find($condition, $maxrowsperpage, $d, $order);
     }
     // Если передан номер страницы превышающий максимальный
     if (empty($items) && $totallines > 0 && $pg > 1) {
         $totalpages = ceil($totallines / $maxrowsperpage);
         $args = $urlParams;
         if ($totalpages > 1) {
             if (cot::$cfg['easypagenav']) {
                 $args['d'] = $totalpages;
             } else {
                 $args['d'] = ($totalpages - 1) * $maxrowsperpage;
             }
         }
         cot_redirect(cot_url('admin', $args, '', true));
     }
     //$addNewUrl = cot_url('admin', array('m'=>'subscribe','a' => 'edit'));
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.admin.subscriber.list.main') as $pl) {
         include $pl;
     }
     /* ===== */
     $pagenav = cot_pagenav('admin', $urlParams, $d, $totallines, $maxrowsperpage, 'd', '', true);
     if (empty($pagenav['current'])) {
         $pagenav['current'] = 1;
     }
     $pagenav['page'] = $pagenav['current'];
     if (!cot::$cfg['easypagenav']) {
         $pagenav['page'] = ($pagenav['current'] - 1) * $maxrowsperpage;
     }
     $subscribes = subscribe_model_Subscribe::keyValPairs();
     Resources::linkFileFooter(cot::$cfg['modules_dir'] . '/subscribe/js/admin.subscriber.js');
     $template = array('subscribe', 'admin', 'subscriber', 'list');
     $view = new View();
     $view->page_title = $admintitle;
     $view->fistNumber = $d + 1;
     $view->items = $items;
     $view->totalitems = $totallines;
     $view->pagenav = $pagenav;
     $view->subscribes = $subscribes;
     $view->urlParams = $urlParams;
     $view->filter = $f;
     $view->filterForm = $filterForm;
     $view->states = $states;
     /* === Hook === */
     foreach (cot_getextplugins('subscribe.admin.subscriber.list.view') as $pl) {
         include $pl;
     }
     /* ===== */
     return $view->render($template);
 }
开发者ID:Alex300,项目名称:subscribe,代码行数:101,代码来源:AdminUser.php

示例13: adv_compare_checkbox

/**
 * Чекбокс "Добавить к сравнению
 *
 * @param advboard_model_Advert $item
 * @param string $title
 * @return string
 */
function adv_compare_checkbox($item, $title = null)
{
    static $loaded = false;
    $choosen = false;
    if ($item instanceof advboard_model_Advert) {
        $id = $item->id;
    } else {
        $id = $item;
    }
    if ($id == 0) {
        return '';
    }
    if (!empty($_SESSION['advboard_compare']) && !empty($_SESSION['advboard_compare'][cot::$sys['site_id']])) {
        if (isset($_SESSION['advboard_compare'][cot::$sys['site_id']][$id]) && !empty($_SESSION['advboard_compare'][cot::$sys['site_id']][$id])) {
            $choosen = true;
        }
    }
    if (is_null($title)) {
        $title = cot::$L['advboard_compare_add'];
    }
    $ret = cot_checkbox($choosen, 'advboard_comp[]', $title, array('class' => 'advboard_compare'), $id, 'input_check');
    if (!$loaded) {
        Resources::linkFileFooter(cot::$cfg["modules_dir"] . '/advboard/js/advboard.compare.form.js');
        $loaded = true;
        $ret .= cot_xp();
    }
    return $ret;
}
开发者ID:ASDAFF,项目名称:advboard,代码行数:35,代码来源:advboard.functions.php


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