Changeset 3812
- Timestamp:
- Sep 1, 2009, 9:48:45 PM (15 years ago)
- Location:
- extensions/akBookStyle/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/css/ak_style.css
r3811 r3812 5 5 table.ak_display tr td { 6 6 vertical-align: top; 7 }8 9 td table.thumbnails {10 margin-right:20%;11 7 } 12 8 -
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 -
extensions/akBookStyle/trunk/js/ak_jquery-load.js
r3806 r3812 5 5 return false; 6 6 }); 7 }); 7 8 $(".navbar a.navButton") 9 .click(function() { 10 $a = $(this); 11 try { 12 $.get(this.href,{}, 13 function success(data) { 14 $('div.ak_thumbnails').html(data.thumbnails); 15 $a.click(function(e) { e.preventDefault();}); 16 }, 17 'json'); 18 } catch(e) { 19 alert(e); 20 } 21 return false; 22 }); 23 }); -
extensions/akBookStyle/trunk/public.php
r3787 r3812 37 37 2 38 38 ); 39 40 if ($public_content->isJsonUrl()) { 41 add_event_handler('loc_end_index_thumbnails', 42 array($public_content, 'load_thumbnails'), 43 EVENT_HANDLER_PRIORITY_NEUTRAL+1, 44 2 45 ); 46 } 39 47 ?>
Note: See TracChangeset
for help on using the changeset viewer.