Exemplo n.º 1
0
 public function ajaxShowBookmarks($uri)
 {
     $filter = JFilterInput::getInstance();
     $uri = $filter->clean($uri, 'string');
     CFactory::load('libraries', 'bookmarks');
     $bookmarks = new CBookmarks($uri);
     CFactory::load('libraries', 'apps');
     $appsLib =& CAppPlugins::getInstance();
     $appsLib->loadApplications();
     // @onLoadBookmarks deprecated.
     // since 1.5
     $appsLib->triggerEvent('onLoadBookmarks', array($bookmarks));
     $response = new JAXResponse();
     $tmpl = new CTemplate();
     $tmpl->set('bookmarks', $bookmarks->getBookmarks());
     $html = $tmpl->fetch('bookmarks.list');
     $total = $bookmarks->getTotalBookmarks();
     $height = $total * 10;
     $actions = '<input type="button" class="button" onclick="joms.bookmarks.email(\'' . $uri . '\');" value="' . JText::_('COM_COMMUNITY_SHARE_BUTTON') . '"/>';
     $actions .= '<input type="button" class="button" onclick="cWindowHide();" value="' . JText::_('COM_COMMUNITY_CANCEL_BUTTON') . '"/>';
     $response->addAssign('cwin_logo', 'innerHTML', JText::_('COM_COMMUNITY_SHARE_THIS'));
     $response->addScriptCall('cWindowAddContent', $html, $actions);
     return $response->sendResponse();
 }