• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Library\ObjectConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _initialize

 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('behaviors' => array('com:activities.controller.behavior.loggable', 'com:attachments.controller.behavior.attachable'), 'model' => 'com:categories.model.categories'));
     parent::_initialize($config);
     //Force the toolbars
     $config->toolbars = array('menubar', 'com:categories.controller.toolbar.category');
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:7,代码来源:category.php


示例2: upload

    /**
     * Builds the file upload control and initializes it's related javascript classes.
     * 
     * To enable maximum compliance with the current state of the file upload's accept attribute, specify both any MIME
     * types and any corresponding extension.
     * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#attr-input-accept
     * 
     * @param 	object 	An optional Library\ObjectConfig object with configuration options
     */
    public function upload($config = array())
    {
        $config = new Library\ObjectConfig($config);
        $config->append(array('container' => 'document.body'));
        if (!$config->allowed_extensions || !$config->allowed_mimetypes) {
            $container = $this->getObject('com:files.database.table.containers')->select(array('slug' => 'attachments-attachments'), Library\Database::FETCH_ROW);
            $config->append(array('allowed_extensions' => $container->parameters->allowed_extensions, 'allowed_mimetypes' => $container->parameters->allowed_mimetypes));
        }
        if ($config->container != 'document.body') {
            $config->container = '\'' . $config->container . '\'';
        }
        $extensions = json_encode($config->allowed_extensions->toArray());
        $html = <<<END
\t\t<script src="assets://attachments/js/attachments.upload.js" />
\t\t<script>
\t\twindow.addEvent('domready', function() {
\t\t\tnew Attachments.Upload({
\t\t\t\tcontainer: {$config->container},
\t\t\t    extensions: {$extensions}
\t\t\t});
\t\t});
\t\t</script>
END;
        $accept = array();
        foreach ($config->allowed_extensions->toArray() as $val) {
            $accept[] = '.' . $val;
        }
        $accept = array_merge($accept, $config->allowed_mimetypes->toArray());
        $html .= '<input type="file" name="attachments[]" accept="' . implode(', ', $accept) . '" />';
        return $html;
    }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:40,代码来源:attachment.php


示例3: render

    /**
     * Renders the reCAPTCHA widget.
     *
     * @param string  $error   The error message given by reCAPTCHA.
     * @param boolean $ssl     Determines is the request should be made over SSL.
     *
     * @return string - The HTML to be embedded in the user's form.
     */
    public function render($config = array())
    {
        $config = new Library\ObjectConfig($config);
        $params = $this->getObject('application.extensions')->users->params;
        $config->append(array('captcha' => array('public_key' => $params->get('recaptcha_public_key', null), 'api_server' => 'http://www.google.com/recaptcha/api', 'api_secure_server' => 'https://www.google.com/recaptcha/api', 'options' => array('theme' => 'clean', 'lang' => 'en')), 'error' => '', 'ssl' => false));
        $captcha = $config->captcha;
        $html = '';
        if ($public_key = $captcha->public_key) {
            if ($config->ssl) {
                $server = $captcha->api_secure_server;
            } else {
                $server = $captcha->api_server;
            }
            if ($config->error) {
                $config->error = '&amp;error=' . $config->error;
            }
            // Use options if any.
            if (count($options = $captcha->options)) {
                $options = Library\ObjectConfig::unbox($options);
                $html .= '<script type="text/javascript">';
                $html .= 'var RecaptchaOptions = ' . json_encode($options);
                $html .= '</script> ';
            }
            $html .= '<script data-inline type="text/javascript" src="' . $server . '/challenge?k=' . $public_key . $config->error . '"></script>
	<noscript>
  		<iframe src="' . $server . '/noscript?k=' . $public_key . $config->error . '" height="300" width="500" frameborder="0"></iframe><br/>
  		<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
  		<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
	</noscript>';
        }
        return $html;
    }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:40,代码来源:captcha.php


示例4: languages

    public function languages($config = array())
    {
        $config = new Library\ObjectConfig($config);
        $config->append(array('name' => 'language'));
        $result = '';
        $result = '
		    <script>
                window.addEvent(\'domready\', function() {
                    document.getElement(\'select[name=' . $config->name . ']\').addEvent(\'change\', function() {
                        window.location = this.value;
                    });
                });
            </script>
		';
        $options = array();
        $languages = $this->getObject('application.languages');
        $active = $languages->getActive();
        foreach ($languages as $language) {
            $route = $this->getTemplate()->getView()->getRoute('language=' . $language->slug);
            $options[] = $this->option(array('label' => $language->name, 'value' => $route));
            if ($language->iso_code == $active->iso_code) {
                $config->selected = $route;
            }
        }
        $config->options = $options;
        $result .= parent::optionlist($config);
        return $result;
    }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:28,代码来源:listbox.php


示例5: _initialize

 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('model' => 'com:tags.model.tags'));
     parent::_initialize($config);
     //Force the toolbars
     $config->toolbars = array('menubar', 'com:tags.controller.toolbar.tag');
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:7,代码来源:tag.php


示例6: link

 public function link($config)
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('title' => '', 'current' => false, 'active' => false, 'offset' => 0, 'limit' => 0, 'rel' => '', 'attribs' => array()));
     $html = '<a class="btn ' . $config->rel . '" href="#">' . JText::_($config->title) . '</a>';
     return $html;
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:7,代码来源:paginator.php


示例7: groups

 public function groups($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('name' => 'role_id'));
     $config->options = $this->options(array('entity' => $this->getObject('com:users.model.roles')->sort('id')->getRowset(), 'label' => 'name'));
     return $this->radiolist($config);
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:7,代码来源:select.php


示例8: tags

 public function tags($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('model' => 'tags', 'value' => 'id', 'text' => 'title', 'prompt' => false));
     $config->text = 'title';
     $config->sort = 'title';
     return parent::_render($config);
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:8,代码来源:listbox.php


示例9: thumbnail

 public function thumbnail($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('align' => 'right', 'class' => 'thumbnail article__thumbnail'));
     $image = $config->row;
     $html = '<img class="' . $config->class . '" align="' . $config->align . '" src="' . $image->thumbnail . '" />';
     return $html;
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:8,代码来源:image.php


示例10: gravatar

 public function gravatar($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('email' => '', 'size' => '32', 'attribs' => array()));
     $source = "http://www.gravatar.com/avatar/" . md5(strtolower(trim($config->email))) . "?s=" . $config->size;
     $html = '<img class="avatar" src="' . $source . '" />';
     return $html;
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:8,代码来源:image.php


示例11: _initialize

 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   Library\ObjectConfig $config Configuration options
  * @return  void
  */
 protected function _initialize(Library\ObjectConfig $config)
 {
     //Make asset paths absolute
     $base = $this->getObject('request')->getBaseUrl();
     $path = $this->getObject('request')->getBaseUrl()->getPath() . '/assets/';
     $config->append(array('priority' => self::PRIORITY_LOW, 'aliases' => array('"/assets/' => '"' . $path)));
     parent::_initialize($config);
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:16,代码来源:url.php


示例12: email

 public function email($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('identifier' => 'com:clients.model.emails', 'name' => 'id'));
     //@TODO : Fix - Forcing config option because of name collisions
     $config->text = 'email';
     $config->sort = 'email';
     return parent::_render($config);
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:9,代码来源:listbox.php


示例13: link

 /**
  * Render a page link
  *
  * @param   array   An optional array with configuration options
  * @return	string	Html
  */
 public function link($config)
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('title' => '', 'current' => false, 'active' => false, 'offset' => 0, 'limit' => 0, 'rel' => '', 'attribs' => array()));
     $route = $this->getTemplate()->getView()->getRoute('limit=' . $config->limit . '&offset=' . $config->offset);
     $rel = !empty($config->rel) ? 'rel="' . $config->rel . '"' : '';
     $html = '<a ' . $this->buildAttributes($config->attribs) . ' href="' . $route . '" ' . $rel . '>' . $this->translate($config->title) . '</a>';
     return $html;
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:15,代码来源:paginator.php


示例14: _initialize

 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   Library\ObjectConfig $config Configuration options
  * @return  void
  */
 protected function _initialize(Library\ObjectConfig $config)
 {
     //Make images paths absolute
     $base = $this->getObject('request')->getBaseUrl();
     $site = $this->getObject('application')->getSite();
     $path = $base->getPath() . '/files/' . $site . '/files/';
     $config->append(array('aliases' => array('files://' => $path, '"files/' => '"' . $path)));
     parent::_initialize($config);
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:17,代码来源:files.php


示例15: languages

 public function languages($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('value' => 'iso_code', 'label' => 'name', 'identifier' => 'com:languages.model.languages', 'filter' => array('application' => 'site', 'enabled' => 1)));
     $listbox = parent::_listbox($config);
     if (!$config->size) {
         $listbox = str_replace('size="1"', '', $listbox);
     }
     return $listbox;
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:10,代码来源:listbox.php


示例16: status

 public function status($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('status' => '', 'original' => 0, 'deleted' => 0));
     $statuses = array(DatabaseRowTranslation::STATUS_COMPLETED => 'Completed', DatabaseRowTranslation::STATUS_MISSING => 'Missing', DatabaseRowTranslation::STATUS_OUTDATED => 'Outdated');
     $text = $config->original ? 'Original' : $statuses[$config->status];
     $class = $config->original ? 'original' : strtolower($statuses[$config->status]);
     $class = $config->deleted ? 'deleted' : $class;
     return '<span class="label label-' . $class . '">' . JText::_($text) . '</span>';
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:10,代码来源:grid.php


示例17: select

    public function select($config = array())
    {
        $config = new Library\ObjectConfig($config);
        $config->append(array('name' => '', 'visible' => true, 'link' => '', 'link_text' => $this->translate('Select'), 'link_selector' => 'modal'))->append(array('value' => $config->name));
        $input = '<input name="%1$s" id="%1$s" value="%2$s" %3$s size="40" />';
        $link = '<a class="%s"
					rel="{\'ajaxOptions\': {\'method\': \'get\'}, \'handler\': \'iframe\', \'size\': {\'x\': 700}}"
					href="%s">%s</a>';
        $html = sprintf($input, $config->name, $config->value, $config->visible ? 'type="text" readonly' : 'type="hidden"');
        $html .= sprintf($link, $config->link_selector, $config->link, $config->link_text);
        return $html;
    }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:12,代码来源:modal.php


示例18: product

 public function product($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('layout' => null, 'format' => 'html'));
     $product = $config->row;
     $needles = array(array('view' => 'product', 'id' => $product->id));
     $route = array('view' => 'product', 'id' => $product->id, 'layout' => $config->layout, 'format' => $config->format);
     if ($item = $this->_findPage($needles)) {
         $route['Itemid'] = $item->id;
     }
     return $this->getTemplate()->getView()->getRoute($route);
 }
开发者ID:janssit,项目名称:www.technovit.be,代码行数:12,代码来源:route.php


示例19: pagination

 /**
  * Render item pagination
  *
  * @param   array   An optional array with configuration options
  * @return  string  Html
  * @see     http://developer.yahoo.com/ypatterns/navigation/pagination/
  */
 public function pagination($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('limit' => 0));
     $html = '';
     $html .= '<div class="pagination">';
     $html .= '<div class="limit">' . $this->translate('Display NUM') . ' ' . $this->limit($config) . '</div>';
     $html .= $this->pages($config);
     $html .= '<div class="limit"> ' . $this->translate('Page') . ' <span class="page-current">1</span>';
     $html .= ' ' . $this->translate('of') . ' <span class="page-total">1</span></div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:20,代码来源:paginator.php


示例20: message

 public function message($config = array())
 {
     $config = new Library\ObjectConfig($config);
     $config->append(array('row' => ''));
     $row = $config->row;
     if ($row->name == 'session') {
         $item = $this->getTemplate()->getView()->getRoute('option=' . $row->type . '_' . $row->package . '&view=user&id=' . $row->created_by);
         $message = '<a href="' . $item . '">' . $row->title . '</a>';
         $message .= ' <span class="action">' . $row->status . '</span>';
     } else {
         $message = parent::message($config);
     }
     return $message;
 }
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:14,代码来源:activity.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP db\Settings类代码示例发布时间:2022-05-23
下一篇:
PHP db\Settings类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap