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


PHP Tags::max_count方法代码示例

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


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

示例1: get

 /**
  * Produce HTML output for all this fieldset and all contained controls
  *
  * @param boolean $forvalidation True if this control should render error information based on validation.
  * @return string HTML that will render this control in the form
  */
 function get($forvalidation = true)
 {
     $theme = $this->get_theme($forvalidation, $this);
     $max = Tags::max_count();
     $tag = $this->tag;
     $theme->class = 'tag_' . $tag->slug;
     $theme->id = $tag->id;
     $theme->weight = $max > 0 ? round($tag->count * 10 / $max) : 0;
     $theme->caption = $tag->tag;
     $theme->count = $tag->count;
     return $theme->fetch('tabcontrol_tag', true);
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:18,代码来源:formui.php

示例2: ajax_tags

 /**
  * Handles AJAX from /admin/tags
  * Used to delete and rename tags
  */
 public function ajax_tags($handler_vars)
 {
     Utils::check_request_method(array('POST'));
     $wsse = Utils::WSSE($handler_vars['nonce'], $handler_vars['timestamp']);
     if ($handler_vars['digest'] != $wsse['digest']) {
         Session::error(_t('WSSE authentication failed.'));
         echo Session::messages_get(true, array('Format', 'json_messages'));
         return;
     }
     $tag_names = array();
     $action = $this->handler_vars['action'];
     switch ($action) {
         case 'delete':
             foreach ($_POST as $id => $delete) {
                 // skip POST elements which are not tag ids
                 if (preg_match('/^tag_\\d+/', $id) && $delete) {
                     $id = substr($id, 4);
                     $tag = Tags::get_by_id($id);
                     $tag_names[] = $tag->tag;
                     Tags::delete($tag);
                 }
             }
             $msg_status = sprintf(_n('Tag %s has been deleted.', 'Tags %s have been deleted.', count($tag_names)), implode($tag_names, ', '));
             Session::notice($msg_status);
             echo Session::messages_get(true, array('Format', 'json_messages'));
             break;
         case 'rename':
             if (isset($this->handler_vars['master'])) {
                 $theme_dir = Plugins::filter('admin_theme_dir', Site::get_dir('admin_theme', TRUE));
                 $this->theme = Themes::create('admin', 'RawPHPEngine', $theme_dir);
                 $master = $this->handler_vars['master'];
                 $tag_names = array();
                 foreach ($_POST as $id => $rename) {
                     // skip POST elements which are not tag ids
                     if (preg_match('/^tag_\\d+/', $id) && $rename) {
                         $id = substr($id, 4);
                         $tag = Tags::get_by_id($id);
                         $tag_names[] = $tag->tag;
                     }
                 }
                 Tags::rename($master, $tag_names);
                 $msg_status = sprintf(_n('Tag %1$s has been renamed to %2$s.', 'Tags %1$s have been renamed to %2$s.', count($tag_names)), implode($tag_names, ', '), $master);
                 Session::notice($msg_status);
                 $this->theme->tags = Tags::get();
                 $this->theme->max = Tags::max_count();
                 echo json_encode(array('msg' => Session::messages_get(true, 'array'), 'tags' => $this->theme->fetch('tag_collection')));
             }
             break;
     }
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:54,代码来源:adminhandler.php

示例3: build_cloud

 private function build_cloud()
 {
     $tags = Tags::get();
     $max = Tags::max_count();
     $hide = $this->get_hide_tag_list();
     $this->step = $max / Options::get('fluffytag__steps');
     $this->prefix = explode(',', Options::get('fluffytag__prefix'));
     //$tags = array_filter($tags, create_function( '$a' 'return $a->slug == ' );
     $tags = array_filter($tags, array($this, 'add_count'));
     //print_r( $tags );
     return $tags;
 }
开发者ID:habari-extras,项目名称:fluffytag,代码行数:12,代码来源:fluffytag.plugin.php


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