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


PHP tag::item_tags方法代码示例

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


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

示例1: item_edit_form

 static function item_edit_form($item, $view)
 {
     $url = url::site("tags/autocomplete");
     $view->script[] = "\$('#gEditFormContainer form').ready(function() {\n                         \$('#gEditFormContainer form input[id=tags]').autocomplete(\n                           '{$url}', {max: 30, formatResult: formatTagAutoCompleteResult}\n                         );\n                      });";
     $tag_value = implode("; ", tag::item_tags($item));
     $view->form->edit_item->input("tags")->label(t("Tags (comma or semicolon separated)"))->value($tag_value);
 }
开发者ID:e-lime,项目名称:gallery3,代码行数:7,代码来源:tag_event.php

示例2: dialog

 function dialog($album_id)
 {
     $album = ORM::factory("item", $album_id);
     access::required("view", $album);
     if (!access::can("edit", $album)) {
         // The user can't edit; perhaps they just logged out?
         url::redirect($album->abs_url());
     }
     $v = new Theme_View("page.html", "collection", "captionator");
     $v->content = new View("captionator_dialog.html");
     $v->content->album = $album;
     $v->content->enable_tags = module::is_active("tag");
     if ($v->content->enable_tags) {
         $v->content->tags = array();
         foreach ($album->viewable()->children() as $child) {
             $item = ORM::factory("item", $child->id);
             $tag_names = array();
             foreach (tag::item_tags($item) as $tag) {
                 $tag_names[] = $tag->name;
             }
             $v->content->tags[$child->id] = implode(", ", $tag_names);
         }
     }
     print $v;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:25,代码来源:captionator.php

示例3: tags_for

 public function tags_for($id)
 {
     $item = ORM::factory("item", $id);
     access::required("view", $item);
     $view = new View("tag_it_tags_for.html");
     $view->tags = tag::item_tags($item);
     print $view;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:8,代码来源:tag_it.php

示例4: get

 static function get($request)
 {
     $item = rest::resolve($request->url);
     $tags = array();
     foreach (tag::item_tags($item) as $tag) {
         $tags[] = rest::url("tag_item", $tag, $item);
     }
     return array("url" => $request->url, "members" => $tags);
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:9,代码来源:item_tags_rest.php

示例5: relationships

 static function relationships($resource_type, $resource)
 {
     switch ($resource_type) {
         case "item":
             $tags = array();
             foreach (tag::item_tags($resource) as $tag) {
                 $tags[] = rest::url("tag_item", $tag, $resource);
             }
             return array("tags" => array("url" => rest::url("item_tags", $resource), "members" => $tags));
     }
 }
开发者ID:andyst,项目名称:gallery3,代码行数:11,代码来源:tag_rest.php

示例6: get

 static function get($block_id, $theme)
 {
     $block = new Block();
     switch ($block_id) {
         case "simple":
             $item = $theme->item;
             if (!$item or !$item->is_photo()) {
                 return "";
             }
             $block->css_id = "g-about-this-photo";
             $block->title = t("About this photo");
             $block->content = new View("about_this_photo.html");
             // exif API doesn't give easy access to individual keys, so do this the hard way
             if (module::is_active("exif")) {
                 $exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find();
                 if ($exif->loaded()) {
                     $exif = unserialize($exif->data);
                     $timestamp = strtotime($exif["DateTime"]);
                     //$block->content->date = gallery::date($timestamp);
                     $block->content->date = date('D j M Y', $timestamp);
                     $block->content->time = gallery::time($timestamp);
                 }
             }
             $block->content->vcount = $theme->item()->view_count;
             // IPTC - copied more or less from iptc.php
             if (module::is_active("iptc")) {
                 $record = ORM::factory("iptc_record")->where("item_id", "=", $theme->item()->id)->find();
                 if ($record->loaded()) {
                     $record = unserialize($record->data);
                     $block->content->source = $record["Source"];
                     $block->content->caption = $record["Caption"];
                 }
             }
             if (module::is_active("tag")) {
                 $block->content->tags = tag::item_tags($theme->item());
             }
             break;
     }
     return $block;
 }
开发者ID:Retroguy,项目名称:gallery3-contrib,代码行数:40,代码来源:about_this_photo_block.php

示例7: about

 public function about($id)
 {
     $item = ORM::factory("item", $id);
     access::required("view", $item);
     $v = new Theme_View("about.html", "", "");
     $v->item = $item;
     $details = array(array("caption" => "Title", "value" => $item->title));
     if ($item->description != $item->title) {
         array_push($details, array("caption" => "Description", "value" => $item->description));
     }
     if (isset($item->captured)) {
         array_push($details, array("caption" => "Captured", "value" => date(module::get_var("gallery", "date_time_format", "Y-M-d H:i:s"), $item->captured)));
     }
     array_push($details, array("caption" => "Owner", "value" => $item->owner_id));
     array_push($details, array("caption" => "Filename", "value" => $item->name));
     array_push($details, array("caption" => "View count", "value" => $item->view_count));
     $v->details = $details;
     if (module::is_active("tag")) {
         $v->tags = tag::item_tags($item);
     }
     print $v;
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:22,代码来源:pear.php

示例8: item_index_data

 static function item_index_data($item, $data)
 {
     foreach (tag::item_tags($item) as $tag) {
         $data[] = $tag->name;
     }
 }
开发者ID:andyst,项目名称:gallery3,代码行数:6,代码来源:tag_event.php

示例9: fancylink

 public function fancylink($item, $view_type = "album", $group_img = true, $display_comment = true, $parent_title_class = "h2")
 {
     // view_type = album || dynamic || header
     $link = "";
     access::required("view", $item);
     $photo_size = module::get_var("three_nids", "photo_size");
     if ($photo_size == "full" || $item->is_movie()) {
         $width = $item->width;
         $height = $item->height;
     } else {
         $width = $item->resize_width;
         $height = $item->resize_height;
     }
     $description_mode = module::get_var("three_nids", "description");
     $description = "";
     $tags = tag::item_tags($item);
     if (count($tags) && $description_mode == "tags") {
         $description = " || " . implode(", ", $tags);
     } else {
         if ($description_mode == "item" && $item->description != "") {
             $description = " || " . str_replace("\"", """, $item->description);
         } else {
             if (($description_mode == "parent" || $description_mode == "item") && $item->parent()->description != "") {
                 $description = " || " . str_replace("\"", """, $item->parent()->description);
             }
         }
     }
     $title_mode = module::get_var("three_nids", "title");
     if ($title_mode == "parent") {
         $title = html::clean($item->parent()->title);
     } else {
         $title = html::clean($item->title);
     }
     $rel = "";
     if ($group_img == true) {
         $rel = " rel=\"fancygroup\" ";
     }
     if ($item->is_photo() || $item->is_movie()) {
         $fancymodule = "";
         if (module::is_active("exif")) {
             $fancymodule .= "exif::" . url::site("exif/show/{$item->id}") . ";;";
         }
         if (module::is_active("comment")) {
             $fancymodule .= "comment::" . url::site("three_nids/show_comments/{$item->id}") . ";;comment_count::" . three_nids::comment_count($item) . ";;";
         }
         if ($item->is_photo()) {
             $link .= "<a href=\"" . url::site("photos/{$item->id}") . "/?w=" . $width . "xewx&h=" . $height . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $title . $description . "\" name=\"" . $fancymodule . " \">";
         } else {
             $link .= "<a href=\"" . url::site("movies/{$item->id}") . "/?w=" . strval(20 + $width) . "xewx&h=" . strval(50 + $height) . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $item->parent()->title . $description . "\" name=\"" . $fancymodule . " \">";
         }
     } else {
         if ($item->is_album() && $view_type != "header") {
             $link .= "<a href=\"" . $item->url() . "\">";
         } else {
             // NOTE: we don't want to open an <a> here because $view_type is "header", but lower down
             // we're going to close one, so that's going to generate a mismatch.  For now, just open a
             // link anyway.
             // @todo: figure out what we really should be doing here.
             $link .= "<a href=\"" . $item->url() . "\">";
         }
     }
     if ($view_type != "header") {
         $link .= $item->thumb_img(array("class" => "g-thumbnail")) . "</a>";
         if ($item->is_album() && $view_type == "album") {
             $link .= "<a href=\"" . $item->url() . "?show=" . $item->id . "\"><{$parent_title_class}><span></span>" . html::clean($item->title) . "</{$parent_title_class}></a>";
         } else {
             if (!$item->is_album() && $view_type == "dynamic") {
                 $link .= "<a href=\"" . $item->parent()->url() . "?show=" . $item->id . "\" class=\"g-parent-album\"><{$parent_title_class}><span></span>" . html::clean($item->parent()->title) . "</{$parent_title_class}></a>";
             }
         }
         if (($item->is_photo() || $item->is_movie()) && $display_comment && module::is_active("comment")) {
             $link .= "<ul class=\"g-metadata\"><li><a href=\"" . url::site("three_nids/show_comments/{$item->id}") . "\" class=\"iframe fancyclass g-hidden\">" . three_nids::comment_count($item) . " " . t("comments") . "</a></li></ul>";
         }
     } else {
         $link .= "</a>";
     }
     return $link;
 }
开发者ID:patxo,项目名称:gallery3-contrib,代码行数:78,代码来源:three_nids.php

示例10: info_block_get_metadata

 static function info_block_get_metadata($block, $item)
 {
     $tags = array();
     foreach (tag::item_tags($item) as $tag) {
         $tags[] = "<a href=\"{$tag->url()}\">" . html::clean($tag->name) . "</a>";
     }
     if ($tags) {
         $info = $block->content->metadata;
         $info["tags"] = array("label" => t("Tags:"), "value" => implode(", ", $tags));
         $block->content->metadata = $info;
     }
 }
开发者ID:assad2012,项目名称:gallery3-appfog,代码行数:12,代码来源:tag_event.php

示例11: item_index_data

 static function item_index_data($item, $data)
 {
     $data[] = join(" ", tag::item_tags($item));
 }
开发者ID:eo04837,项目名称:gallery3,代码行数:4,代码来源:tag_event.php

示例12: item_edit_form

 static function item_edit_form($item, $form)
 {
     $tag_value = implode("; ", tag::item_tags($item));
     $form->edit_item->input("tags")->label(t("Tags (separate by , or ;)"))->value($tag_value);
 }
开发者ID:jasonhight,项目名称:gallery3,代码行数:5,代码来源:tag_event.php

示例13: item_index_data

 static function item_index_data($item)
 {
     return join(" ", tag::item_tags($item));
 }
开发者ID:shai,项目名称:gallery3,代码行数:4,代码来源:tag_search.php

示例14: fancylink

 public function fancylink($item, $viewtype = "album", $groupImg = true, $displayComment = true, $parentTitleClass = "h2")
 {
     //viewtype = album || dynamic || header
     $link = "";
     access::required("view", $item);
     $photo_size = module::get_var("theme_3nids", "photo_size");
     if ($photo_size == "full") {
         $width = $item->width;
         $height = $item->height;
     } else {
         $width = $item->resize_width;
         $height = $item->resize_height;
     }
     $desriptionMode = module::get_var("theme_3nids", "description");
     $description = "";
     $tags = tag::item_tags($item);
     if (count($tags) && $desriptionMode == "tags") {
         $description = " || " . implode(", ", $tags);
     } elseif ($desriptionMode == "item" && $item->description != "") {
         $description = " || " . str_replace("\"", "&quot;", $item->description);
     } elseif (($desriptionMode == "parent" || $desriptionMode == "item") && $item->parent()->description != "") {
         $description = " || " . str_replace("\"", "&quot;", $item->parent()->description);
     }
     $titleMode = module::get_var("theme_3nids", "title");
     if ($titleMode == "parent") {
         $title = html::clean($item->parent()->title);
     } else {
         $title = html::clean($item->title);
     }
     $rel = "";
     if ($groupImg == true) {
         $rel = " rel=\"fancygroup\" ";
     }
     if ($item->is_photo() || $item->is_movie()) {
         $fancymodule = "";
         if (module::is_active("exif")) {
             $fancymodule .= "exif::" . url::site("exif/show/{$item->id}") . ";;";
         }
         if (module::is_active("comment")) {
             $fancymodule .= "comment::" . url::site("comments_3nids?item_id={$item->id}") . ";;comment_count::" . comment_3nids::count($item) . ";;";
         }
         if ($item->is_photo()) {
             $link .= "<a href=\"" . url::site("photo_3nids/show/{$item->id}") . "/?w=" . $width . "xewx&h=" . $height . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $title . $description . "\" name=\"" . $fancymodule . " \">";
         } else {
             $link .= "<a href=\"" . url::site("movie_3nids/show/{$item->id}") . "/?w=" . strval(20 + $width) . "xewx&h=" . strval(50 + $height) . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . $item->parent()->title . $description . "\" name=\"" . $fancymodule . " \">";
         }
     } elseif ($item->is_album() && $viewtype != "header") {
         $link .= "<a href=\"" . $item->url() . "\">";
     }
     if ($viewtype != "header") {
         $link .= $item->thumb_img(array("class" => "g-thumbnail")) . "</a>";
         if ($item->is_album() && $viewtype == "album") {
             $link .= "<a href=\"" . $item->url() . "?show=" . $item->id . "\"><{$parentTitleClass}><span></span>" . html::clean($item->title) . "</{$parentTitleClass}></a>";
         } elseif (!$item->is_album() && $viewtype == "dynamic") {
             $link .= "<a href=\"" . $item->parent()->url() . "?show=" . $item->id . "\" class=\"g-parent-album\"><{$parentTitleClass}><span></span>" . html::clean($item->parent()->title) . "</{$parentTitleClass}></a>";
         }
         if (($item->is_photo() || $item->is_movie()) && $displayComment == true && module::is_active("comment")) {
             $link .= "<ul class=\"g-metadata\"><li><a href=\"" . url::site("comments_3nids?item_id={$item->id}") . "\" class=\"iframe fancyclass g-hidden\">" . comment_3nids::count($item) . " " . t("comments") . "</a></li></ul>";
         }
     } else {
         $link .= "</a>";
     }
     return $link;
 }
开发者ID:Nendilo,项目名称:gallery3-contrib,代码行数:64,代码来源:theme_3nids.php


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