リビジョン | 253 (tree) |
---|---|
日時 | 2010-08-23 13:58:24 |
作者 | kmorimatsu |
Item page done.
@@ -5,6 +5,9 @@ | ||
5 | 5 | * The template must be stored in skin directry as follows. |
6 | 6 | * For example, 'default/index' will be changed to 'templates/default_index_item.inc' etc. |
7 | 7 | */ |
8 | + /* | |
9 | + * commentform | |
10 | + */ | |
8 | 11 | |
9 | 12 | class jp_Nucleus_skin extends jeans { |
10 | 13 | static private function convert_template($skin,$type){ |
@@ -256,18 +259,9 @@ | ||
256 | 259 | } |
257 | 260 | static public function tag_commentform(&$data){ |
258 | 261 | /*Skinvar: commentform |
259 | - Adds a commentform to an item page. | |
260 | - Arguments | |
261 | - Optional: | |
262 | - | |
263 | - destinationurl: sets the URL to where Nucleus needs to redirect after adding the comment (by default, Nucleus redirects to the item detail page for the item) | |
264 | - | |
265 | - Skintypes | |
266 | - item | |
267 | - Examples | |
268 | - <%commentform%> | |
269 | - <%commentform(http://host/thanks.html)%>*/ | |
270 | - self::p("<%commentform%>","hsc"); | |
262 | + * destinationurl is not supported | |
263 | + */ | |
264 | + view::tag_parse($data,'/jeans/forms/commentform.inc'); | |
271 | 265 | } |
272 | 266 | static public function tag_comments(&$data,$skin_or_maxtoshow=false){ |
273 | 267 | /*Skinvar: comments |
@@ -279,7 +273,7 @@ | ||
279 | 273 | Examples |
280 | 274 | <%comments(mytemplate)%>*/ |
281 | 275 | if (self::usetemplate($data)) return jp_Nucleus_template::tag_comments($data,$skin_or_maxtoshow); |
282 | - self::p("<%comments%>","hsc"); | |
276 | + comments::tag_comments($data,self::convert_template($skin_or_maxtoshow,'comment')); | |
283 | 277 | } |
284 | 278 | static public function tag_else(&$data){ |
285 | 279 | /*Skinvars: if/ifnot/else/elseif/elseifnot/endif |
@@ -759,7 +753,7 @@ | ||
759 | 753 | } |
760 | 754 | static public function tag_index(&$data){ |
761 | 755 | } |
762 | - static public function tag_item(&$data){ | |
756 | + static public function tag_item(&$data,$template){ | |
763 | 757 | /*Skinvar: item |
764 | 758 | Shows the currently selected item (without comments) using a given template |
765 | 759 | Arguments |
@@ -768,7 +762,10 @@ | ||
768 | 762 | item |
769 | 763 | Examples |
770 | 764 | <%item(mytemplate)%>*/ |
771 | - self::p("<%index%>","hsc"); | |
765 | + $usetemplate=!empty($data['jp']['nucleus']['usetemplate']); | |
766 | + $data['jp']['nucleus']['usetemplate']=true; | |
767 | + item::tag_item($data,self::convert_template($template,'item')); | |
768 | + $data['jp']['nucleus']['usetemplate']=$usetemplate; | |
772 | 769 | } |
773 | 770 | static public function tag_itemid(&$data){ |
774 | 771 | /*Skinvar: itemid |
@@ -797,16 +794,8 @@ | ||
797 | 794 | self::p("<%itemlink%>","hsc"); |
798 | 795 | } |
799 | 796 | static public function tag_itemtitle(&$data){ |
800 | - /*Skinvar: itemtitle | |
801 | - Inserts the title of the item, with HTML-stripped off and entities encoded | |
802 | - Arguments | |
803 | - None | |
804 | - Skintypes | |
805 | - item | |
806 | - Examples | |
807 | - <%itemtitle%>*/ | |
808 | 797 | if (self::usetemplate($data)) return jp_Nucleus_template::tag_itemtitle($data); |
809 | - self::p("<%itemtitle%>","hsc"); | |
798 | + item::tag_data($data,'title'); | |
810 | 799 | } |
811 | 800 | static public function tag_loginform(&$data){ |
812 | 801 | view::tag_parse($data,'/jeans/forms/loginform.inc'); |
@@ -895,20 +884,10 @@ | ||
895 | 884 | <%nextitemtitle%>*/ |
896 | 885 | self::p("<%nextitemtitle%>","hsc"); |
897 | 886 | } |
898 | - static public function tag_nextlink(&$data){ | |
899 | - /*Skinvar: nextlink | |
900 | - Inserts a link to the next item (on item pages) or to the next archive (on archive pages) | |
901 | - Arguments | |
902 | - Optional | |
903 | - | |
904 | - linktext: when present, a full <a href... tag will be outputted, rather than a raw link | |
905 | - amount: for search and index skins: the amount of items to go forward/backward | |
906 | - | |
907 | - Skintypes | |
908 | - item, archive, search, index | |
909 | - Examples | |
910 | - <%nextlink%>*/ | |
911 | - self::p("<%nextlink%>","hsc"); | |
887 | + static public function tag_nextlink(&$data,$linktext=false){ | |
888 | + if ($linktext!==false) self::echo_html('<a href="'); | |
889 | + item::tag_newer($data,'link'); | |
890 | + if ($linktext!==false) self::echo_html('"><%0%></a>',$linktext); | |
912 | 891 | } |
913 | 892 | static public function tag_nucleusbutton(&$data,$file='/jeans/images/jeans.gif',$width=85,$height=31){ |
914 | 893 | $array=array('file'=>view::skinfile($data,$file), 'width'=>$width, 'height'=>$height); |
@@ -1140,20 +1119,10 @@ | ||
1140 | 1119 | <%previtemtitle%>*/ |
1141 | 1120 | self::p("<%previtemtitle%>","hsc"); |
1142 | 1121 | } |
1143 | - static public function tag_prevlink(&$data){ | |
1144 | - /*Skinvar: prevlink | |
1145 | - Inserts a link to the previous item (on item pages) or to the previous archive (on archive pages). For search and index pages | |
1146 | - Arguments | |
1147 | - Optional | |
1148 | - | |
1149 | - linktext: when present, a full <a href... tag will be outputted, rather than a raw link | |
1150 | - amount: for search and index skins: the amount of items to go forward/backward | |
1151 | - | |
1152 | - Skintypes | |
1153 | - item, archive, search, index | |
1154 | - Examples | |
1155 | - <%prevlink%>*/ | |
1156 | - self::p("<%prevlink%>","hsc"); | |
1122 | + static public function tag_prevlink(&$data,$linktext=false){ | |
1123 | + if ($linktext!==false) self::echo_html('<a href="'); | |
1124 | + item::tag_older($data,'link'); | |
1125 | + if ($linktext!==false) self::echo_html('"><%0%></a>',$linktext); | |
1157 | 1126 | } |
1158 | 1127 | static public function tag_query(&$data){ |
1159 | 1128 | /*Skinvar: query |
@@ -1228,24 +1197,15 @@ | ||
1228 | 1197 | <%set(IncludePrefix,somedir/)%>*/ |
1229 | 1198 | self::p("<%set%>","hsc"); |
1230 | 1199 | } |
1231 | - static public function tag_sitevar(&$data){ | |
1232 | - /*Skinvar: sitevar | |
1233 | - Includes a site variable | |
1234 | - Arguments | |
1235 | - type: name of the variable to show: | |
1236 | - | |
1237 | - url: URL of the site | |
1238 | - name: Name of the site | |
1239 | - admin: E-mail address of the administrator | |
1240 | - | |
1241 | - | |
1242 | - Skintypes | |
1243 | - all | |
1244 | - Examples | |
1245 | - <%sitevar(name)%> | |
1246 | - <%sitevar(url)%> | |
1247 | - <a href="mailto:<%sitevar(email)%>">Admin</a>*/ | |
1248 | - self::p("<%sitevar%>","hsc"); | |
1200 | + static public function tag_sitevar(&$data,$type){ | |
1201 | + switch($type){ | |
1202 | + case 'url': | |
1203 | + return self::p(_CONF_URL_INDEX); | |
1204 | + case 'name': | |
1205 | + return self::p(_CONF_SITE_NAME); | |
1206 | + case 'admin': | |
1207 | + return self::p(_CONF_ADMIN_EMAIL); | |
1208 | + } | |
1249 | 1209 | } |
1250 | 1210 | static public function tag_skinfile(&$data,$filename){ |
1251 | 1211 | /*Skin/Templatevar: skinfile |
@@ -145,9 +145,9 @@ | ||
145 | 145 | media other media object from media dir |
146 | 146 | relevance Includes the 'search hit relevance' in templates that display search results |
147 | 147 | */ |
148 | - /* | |
149 | - * <%morelink%> | |
150 | - */ | |
148 | + public static function tag_more(&$data){ | |
149 | + self::echo_html($data['more']); | |
150 | + } | |
151 | 151 | public static function tag_editlink(&$data){ |
152 | 152 | self::p(_CONF_URL_ADMIN.'?page=edititem&itemid='.$data['id']); |
153 | 153 | } |
@@ -240,6 +240,21 @@ | ||
240 | 240 | skinfile includes the correct URL for a file belonging to an imported skin |
241 | 241 | set sets a parser property |
242 | 242 | */ |
243 | + /* | |
244 | + * | |
245 | + */ | |
246 | + static public function tag_memberid(&$data){ | |
247 | + self::p($data['author']); | |
248 | + } | |
249 | + static public function tag_userlinkraw(&$data){ | |
250 | + self::p($data['link']); | |
251 | + } | |
252 | + static public function tag_ip(&$data){ | |
253 | + self::p($data['ip']); | |
254 | + } | |
255 | + static public function tag_user(&$data){ | |
256 | + self::p($data['user']); | |
257 | + } | |
243 | 258 | static public function tag_commentcount(&$data){ |
244 | 259 | self::p($data['comments']); |
245 | 260 | } |