本文整理汇总了PHP中loader::helper方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::helper方法的具体用法?PHP loader::helper怎么用?PHP loader::helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类loader
的用法示例。
在下文中一共展示了loader::helper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scanGateways
public function scanGateways($merge = true)
{
$gateways = array();
// Load file helper and read gateways directory
loader::helper('file');
$dirs = file_helper::scanFileNames(DOCPATH . 'libraries/payments');
// Loop through found directories
foreach ($dirs as $gateway) {
// Remove file extension
$gateway = substr($gateway, 0, -4);
if ($manifest = $this->getManifest($gateway)) {
$gateways[$gateway] = $manifest;
}
}
// Do we need to merge results with installed gateways?
if ($merge) {
// Loop through installed gateways
foreach ($this->getGateways(false, false) as $gateway) {
if (isset($gateways[$gateway['keyword']])) {
$gateways[$gateway['keyword']]['gateway_id'] = $gateway['gateway_id'];
$gateways[$gateway['keyword']]['name'] = $gateway['name'];
$gateways[$gateway['keyword']]['active'] = $gateway['active'];
}
}
}
// Order gateways
ksort($gateways);
return $gateways;
}
示例2: scanServices
public function scanServices($merge = true)
{
// Load file helper and read storage services directory
loader::helper('file');
$dirs = file_helper::scanFileNames(DOCPATH . 'libraries/storages');
$services = array();
// Loop through found directories
foreach ($dirs as $service) {
// Remove file extension
$service = substr($service, 0, -4);
if ($manifest = $this->getManifest($service)) {
$services[$service] = $manifest;
$services[$service]['default'] = 0;
}
}
// Do we need to merge results with installed storage services?
if ($merge) {
// Loop through installed storage services
foreach ($this->getServices() as $service) {
if (isset($services[$service['keyword']])) {
$services[$service['keyword']]['service_id'] = $service['service_id'];
$services[$service['keyword']]['default'] = $service['default'];
}
}
}
// Order services
ksort($services);
return $services;
}
示例3: view
public function view()
{
$ct = CollectionType::getByHandle('pb_post');
$ctID = $ct->getPageTypeID();
if ($this->targetCID > 0) {
$target = Page::getByID($this->targetCID);
$this->set('target', $target);
} else {
$target = Page::getByPath('/blogsearch');
$this->set('target', $target);
}
if (!$this->page_type) {
$this->page_type = 'pb_post';
}
$page_type = trim($this->page_type);
$query = "SELECT MIN(cv.cvDatePublic) as firstPost\n\t\t\tFROM CollectionVersions cv\n INNER JOIN Pages pp ON cv.cID = pp.cID\n\t\t\tINNER JOIN PageTypes pt ON pp.ptID = pt.ptID\n\t\t\tWHERE pt.ptHandle = ? and cv.cvIsApproved = 1\n\t\t\tAND cv.cvDatePublic < CURDATE()\n ORDER BY firstPost ASC";
$db = Loader::db();
$firstPost = $db->getOne($query, array($page_type));
if (strlen($firstPost)) {
$firstPost = new \DateTime($firstPost);
$this->set('firstPost', $firstPost);
}
$this->set('numMonths', $this->numMonths);
$this->set('navigation', loader::helper('navigation'));
}
示例4: scanCaptchas
public function scanCaptchas($merge = true)
{
// Load file helper and read captcha directory
loader::helper('file');
$dirs = file_helper::scanFileNames(DOCPATH . 'libraries/captchas');
$captchas = array();
// Loop through found directories
foreach ($dirs as $captcha) {
// Remove file extension
$captcha = substr($captcha, 0, -4);
if ($manifest = $this->getManifest($captcha)) {
$captchas[$captcha] = $manifest;
$captchas[$captcha]['default'] = 0;
}
}
// Do we need to merge results with installed captchas?
if ($merge) {
// Loop through installed captchas
foreach ($this->getCaptchas() as $captcha) {
if (isset($captchas[$captcha['keyword']])) {
$captchas[$captcha['keyword']]['captcha_id'] = $captcha['captcha_id'];
$captchas[$captcha['keyword']]['default'] = $captcha['default'];
}
}
}
// Order captchas
ksort($captchas);
return $captchas;
}
示例5: scanPlugins
public function scanPlugins($merge = true, $escape = true)
{
// Load file helper and read plugins directory
loader::helper('file');
$dirs = file_helper::scanDirectoryNames(DOCPATH . 'plugins');
$plugins = array();
// Loop through found directories
foreach ($dirs as $plugin) {
if ($manifest = $this->getManifest($plugin, false, $escape)) {
$plugins[$plugin] = $manifest;
}
}
// Do we need to merge results with installed plugins?
if ($merge) {
// Loop through installed plugins
foreach ($this->getPlugins($escape) as $plugin) {
if (isset($plugins[$plugin['keyword']])) {
$plugins[$plugin['keyword']]['plugin_id'] = $plugin['plugin_id'];
$plugins[$plugin['keyword']]['name'] = $plugin['name'];
$plugins[$plugin['keyword']]['version_new'] = $plugins[$plugin['keyword']]['version'];
$plugins[$plugin['keyword']]['version'] = $plugin['version'];
$plugins[$plugin['keyword']]['system'] = $plugin['system'];
}
}
}
// Order plugins
ksort($plugins);
return $plugins;
}
示例6: scanTemplates
public function scanTemplates($merge = true)
{
// Load file helper and read templates directory
loader::helper('file');
$dirs = file_helper::scanDirectoryNames(BASEPATH . 'templates');
$templates = array();
// Loop through found directories
foreach ($dirs as $template) {
if ($manifest = $this->getManifest($template)) {
$templates[$template] = $manifest;
$templates[$template]['default'] = 0;
}
}
// Do we need to merge results with installed templates?
if ($merge) {
// Loop through installed templates
foreach ($this->getTemplates() as $template) {
if (isset($templates[$template['keyword']])) {
$templates[$template['keyword']]['template_id'] = $template['template_id'];
$templates[$template['keyword']]['default'] = $template['default'];
}
}
}
// Order templates
ksort($templates);
return $templates;
}
示例7: usersProfileViewSidebarAds
public function usersProfileViewSidebarAds($user)
{
if (!$user['total_classifieds']) {
return '';
}
loader::helper('classifieds/classifieds');
echo classifieds_helper::getAds(array('user' => $user, 'limit' => 4, 'select_users' => false, 'template' => 'classifieds/helpers/classifieds_list'));
}
示例8: usersProfileViewSidebarBlogs
public function usersProfileViewSidebarBlogs($user)
{
if (!$user['total_blogs']) {
return '';
}
loader::helper('blogs/blogs');
echo blogs_helper::getBlogs(array('user' => $user, 'limit' => 4, 'select_users' => false, 'template' => 'blogs/helpers/blogs_list'));
}
示例9: usersProfileViewSidebarAlbums
public function usersProfileViewSidebarAlbums($user)
{
if (!$user['total_albums']) {
return '';
}
loader::helper('pictures/pictures');
echo pictures_helper::getAlbums(array('user' => $user, 'limit' => 4, 'select_users' => false));
}
示例10: __construct
public function __construct($totalnum = '', $maxnum = '', $key = "", $form_vars = array())
{
$this->totalnum = $totalnum;
$this->maxnum = $maxnum;
$this->key = $key;
$has_post = false;
$this->navchar = array(lang::get('first'), '[<]', '[>]', lang::get('last'));
$querystring = array($_GET["controller"] . "/" . $_GET["method"]);
$form_vars && $this->setFormVars($form_vars);
if (count($this->form_vars) > 0) {
foreach ($this->form_vars as $val) {
if ($_POST[$val]) {
$querystring[] = $val . "/" . urlencode($_POST[$val]);
$has_post = true;
}
}
}
if (count($_GET) > 0 && !$has_post) {
foreach ($_GET as $key => $val) {
if (!in_array($key, array("totalnum" . $this->key, "pagenum" . $this->key, "controller", "method"))) {
$querystring[] = $key . "/" . urlencode($val);
}
}
}
if (isset($_GET["maxnum" . $this->key]) && $_GET["maxnum" . $this->key] > 0) {
$this->maxnum = sprintf('%d', $_GET["maxnum" . $this->key]);
}
if ($this->maxnum < 1) {
$this->maxnum = $this->totalnum;
}
if ($this->totalnum < 1) {
$this->totalnum = 0;
$this->totalpage = 0;
$this->pagenum = 0;
$this->startnum = 0;
$this->endnum = 0;
$this->shownum = 0;
} else {
$this->totalpage = ceil($this->totalnum / $this->maxnum);
$this->pagenum = isset($_GET["pagenum" . $this->key]) && $_GET["pagenum" . $this->key] > 0 ? sprintf('%d', $_GET["pagenum" . $this->key]) : 1;
if ($this->pagenum > $this->totalpage) {
$this->pagenum = $this->totalpage;
}
$this->startnum = max(($this->pagenum - 1) * $this->maxnum, 0);
$this->endnum = min($this->startnum + $this->maxnum, $this->totalnum);
$this->shownum = $this->endnum - $this->startnum;
}
$querystring[] = "totalnum" . $this->key . "/" . $this->totalnum;
if (isset($_GET["maxnum" . $this->key])) {
$querystring[] = "maxnum" . $this->key . "/" . $this->maxnum;
}
loader::helper("url");
$this->linkhead = site_url(implode("/", $querystring));
}
示例11: usersSettingsAccountOptions
public function usersSettingsAccountOptions($settings, $user = array())
{
if (input::isCP()) {
if (uri::segment(3) == 'edit') {
loader::helper('array');
$expiration = array('name' => __('expire_date', 'users_account'), 'keyword' => 'expire_date', 'type' => 'date', 'value' => $user ? $user['expire_date'] : 0, 'rules' => array('valid_date'), 'select' => true);
$credits = array('name' => __('credits_current', 'users_account'), 'keyword' => 'total_credits', 'type' => 'number', 'value' => $user ? $user['total_credits'] : 0, 'rules' => array('required' => 1, 'min_value' => 0));
$settings = array_helper::spliceArray($settings, 'group_id', $credits, 'total_credits');
$settings = array_helper::spliceArray($settings, 'group_id', $expiration, 'expire_date');
}
} else {
if (config::item('subscriptions_active', 'billing')) {
$settings['subscription'] = array('name' => __('plan_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => config::item('usergroups', 'core', session::item('group_id')) . (session::item('expire_date') ? ' (' . __('expire_date', 'users_account') . ': ' . date_helper::formatDate(session::item('expire_date'), 'date') . ')' : '') . (session::permission('plans_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/plans', __('plan_change', 'users_account')) : ''));
}
if (config::item('credits_active', 'billing')) {
$settings['credits'] = array('name' => __('credits_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => session::item('total_credits') . (session::permission('credits_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/credits', __('credits_purchase', 'users_account')) : ''));
}
}
return $settings;
}
示例12: __construct
public function __construct()
{
parent::__construct();
loader::helper('money');
}
示例13: _get_currencies
protected function _get_currencies($setting)
{
loader::helper('money');
$setting['items'] = money_helper::currencies();
return $setting;
}
示例14: array
view::load('comments/likes', array('resource' => 'blog', 'itemID' => $blog['blog_id'], 'likes' => $blog['total_likes'], 'liked' => $blog['user_vote']['post_date'] ? 1 : 0, 'date' => $blog['user_vote']['post_date']));
?>
</li>
<?php
}
?>
</ul>
</footer>
</article>
</div>
<?php
if (session::permission('comments_view', 'comments') && config::item('blog_comments', 'blogs') && $blog['comments']) {
?>
<?php
loader::helper('comments/comments');
?>
<?php
comments_helper::getComments('blog', $blog['user_id'], $blog['blog_id'], $blog['total_comments'], $blog['comments']);
?>
<?php
}
?>
</section>
<?php
view::load('footer');
示例15: sfException
* $Id$
*/
//包含核心文件
require_once SYSTEMPATH . 'sf/sf.class.php';
require_once SYSTEMPATH . 'sf/config.class.php';
require_once SYSTEMPATH . 'sf/sfexception.class.php';
require_once SYSTEMPATH . 'sf/router.class.php';
require_once SYSTEMPATH . 'sf/loader.class.php';
require_once SYSTEMPATH . 'sf/language.class.php';
require_once SYSTEMPATH . 'sf/input.class.php';
//加载配置文件
config::load('default');
//加载必要库文件
loader::lib(array("controller", "model"));
//加载默认helper
loader::helper(config::get("auto_load_helper", 'url'));
//加载默认插件
config::get("auto_load_plugin") && loader::plugin(config::get("auto_load_plugin"));
//初始化pathinfo
router::parse();
//加载语言文件
lang::setLang(config::get("default_lang", "chinese"));
lang::load("global");
//执行控制器
$controller = sf::getController(router::getController());
try {
method_exists($controller, "load") && $controller->load();
//存在LOAD方法执行LOAD方法(页面执行开始执行)
if (!method_exists($controller, router::getMethod())) {
throw new sfException(sprintf(lang::get("Call to undefined method %s::%s"), get_class($controller), router::getMethod()));
}