Changeset 3812 for extensions/akBookStyle/trunk/include/akContent.class.php
- Timestamp:
- Sep 1, 2009, 9:48:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/include/akContent.class.php
r3807 r3812 29 29 class akContent 30 30 { 31 private $json_url = false; 32 31 33 public function __construct($config) { 32 34 $this->plugin_config = $config; 33 35 $this->current_picture = 0; 36 37 $pattern = '`^/category/\d+(/start\-\d+)?/json$`'; 38 if (preg_match($pattern, $_SERVER['QUERY_STRING'], $matches)) { 39 $this->json_url = true; 40 } 34 41 } 35 42 … … 60 67 } 61 68 62 63 69 public function loc_end_index_thumbnails($tpl_vars, $images) { 64 70 foreach ($tpl_vars as &$tpl_var) { … … 74 80 } 75 81 82 if (isset($GLOBALS['template']->smarty->_tpl_vars['navbar']['URL_PREV'])) { 83 $GLOBALS['template']->smarty->_tpl_vars['navbar']['URL_PREV'] .= '/json'; 84 } 85 if (isset($GLOBALS['template']->smarty->_tpl_vars['navbar']['URL_NEXT'])) { 86 $GLOBALS['template']->smarty->_tpl_vars['navbar']['URL_NEXT'] .= '/json'; 87 } 88 76 89 return $tpl_vars; 90 } 91 92 public function isJsonUrl() { 93 return $this->json_url; 94 } 95 96 public function load_thumbnails($tpl_vars, $images) { 97 $template = new Template(PHPWG_ROOT_PATH.'template/'. $GLOBALS['user']['template'], 98 $GLOBALS['user']['theme'] 99 ); 100 $template->assign('thumbnails', $tpl_vars); 101 $template->assign('AK_BY_LINE', $this->plugin_config->ak_by_line); 102 $template->set_filenames(array('index_thumbnails'=> AK_PLUGIN_TEMPLATE . '/ak_vertical.tpl')); 103 $response['thumbnails'] = $template->parse('index_thumbnails', true); 104 header("Content-Type: application/json"); 105 echo json_encode($response); 106 exit(); 77 107 } 78 108
Note: See TracChangeset
for help on using the changeset viewer.