• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JPagination类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getPhotos

 /**
  * TuiyoModelPhotos::getPhotos()
  * An array of all photos belonging to userID
  * @param mixed $userID
  * @param mixed $albumID
  * @param mixed $limit
  * @param mixed $published
  * @param bool $newFirst
  * @return
  */
 public function getPhotos($userID, $albumID = NULL, $published = NULL, $newFirst = TRUE, $uselimit = TRUE, $overiteLimit = NULL)
 {
     $limit = $uselimit ? $this->getState('limit') : NULL;
     $limit = !is_null($overiteLimit) ? (int) $overiteLimit : $limit;
     $limitstart = $this->getState('limitstart');
     //1. Get all Photos
     $photosTable = TuiyoLoader::table("photos", true);
     $photos = $photosTable->getAllPhotos($userID, $albumID, $limitstart, $published, $newFirst, $limit);
     //print_R( $photos );
     //1b. Paginate?
     jimport('joomla.html.pagination');
     $dbo = $photosTable->_db;
     $this->_total = $dbo->loadResult();
     $pageNav = new JPagination($this->_total, $limitstart, $limit);
     $root = JURI::root();
     $this->pageNav = $pageNav->getPagesLinks();
     //Set the total count
     $this->setState('total', $this->_total);
     $this->setState('pagination', $this->pageNav);
     //2. Check the existence of each photo!
     foreach ($photos as $photo) {
         $photo->date_added = TuiyoTimer::diff(strtotime($photo->date_added));
         $photo->last_modified = TuiyoTimer::diff(strtotime($photo->last_modified));
         $photo->src_original = $root . substr($photo->src_original, 1);
         $photo->src_thumb = $root . substr($photo->src_thumb, 1);
     }
     return (array) $photos;
 }
开发者ID:night-coder,项目名称:ignite,代码行数:38,代码来源:photos.php


示例2: appFullView

 /**
  * Application full view
  **/
 function appFullView()
 {
     $document =& JFactory::getDocument();
     $this->showSubmenu();
     $applicationName = JString::strtolower(JRequest::getVar('app', '', 'GET'));
     if (empty($applicationName)) {
         JError::raiseError(500, 'CC APP ID REQUIRED');
     }
     if (!$this->accessAllowed('registered')) {
         return;
     }
     $output = '';
     //@todo: Since group walls doesn't use application yet, we process it manually now.
     if ($applicationName == 'walls') {
         CFactory::load('libraries', 'wall');
         $jConfig = JFactory::getConfig();
         $limit = $jConfig->get('list_limit');
         $limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
         $eventId = JRequest::getVar('eventid', '', 'GET');
         $my = CFactory::getUser();
         $config = CFactory::getConfig();
         $eventsModel = CFactory::getModel('Events');
         $event =& JTable::getInstance('Event', 'CTable');
         $event->load($eventId);
         $config = CFactory::getConfig();
         $document->setTitle(JText::sprintf('CC EVENTS WALL TITLE', $event->title));
         CFactory::load('helpers', 'owner');
         $guest = $event->isMember($my->id);
         $waitingApproval = $event->isPendingApproval($my->id);
         $status = $event->getUserStatus($my->id);
         $responded = $status == COMMUNITY_EVENT_STATUS_ATTEND || $status == COMMUNITY_EVENT_STATUS_WONTATTEND || $status == COMMUNITY_EVENT_STATUS_MAYBE;
         if (!$config->get('lockeventwalls') || $config->get('lockeventwalls') && $guest && !$waitingApproval && $responded || COwnerHelper::isCommunityAdmin()) {
             $output .= CWallLibrary::getWallInputForm($event->id, 'events,ajaxSaveWall', 'events,ajaxRemoveWall');
             // Get the walls content
             $output .= '<div id="wallContent">';
             $output .= CWallLibrary::getWallContents('events', $event->id, $event->isAdmin($my->id), 0, $limitstart, 'wall.content', 'events,events');
             $output .= '</div>';
             jimport('joomla.html.pagination');
             $wallModel = CFactory::getModel('wall');
             $pagination = new JPagination($wallModel->getCount($event->id, 'events'), $limitstart, $limit);
             $output .= '<div class="pagination-container">' . $pagination->getPagesLinks() . '</div>';
         }
     } else {
         CFactory::load('libraries', 'apps');
         $model = CFactory::getModel('apps');
         $applications =& CAppPlugins::getInstance();
         $applicationId = $model->getUserApplicationId($applicationName);
         $application = $applications->get($applicationName, $applicationId);
         if (!$application) {
             JError::raiseError(500, 'CC APPLICATION NOT FOUND');
         }
         // Get the parameters
         $manifest = JPATH_PLUGINS . DS . 'community' . DS . $applicationName . DS . $applicationName . '.xml';
         $params = new JParameter($model->getUserAppParams($applicationId), $manifest);
         $application->params =& $params;
         $application->id = $applicationId;
         $output = $application->onAppDisplay($params);
     }
     echo $output;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:63,代码来源:view.html.php


示例3: pagination

 /**
  * Creates a pagination using the passed in values
  *
  * @param array $config Configuration Options 
  * total => list total, limit => list limit, offset => list start offset 
  * 
  * @return string
  */
 public function pagination(array $config)
 {
     $config = new KConfig($config);
     jimport('joomla.html.pagination');
     $pagination = new JPagination($config->total, $config->offset, $config->limit);
     return $pagination->getListFooter();
 }
开发者ID:walteraries,项目名称:anahita,代码行数:15,代码来源:paginator.php


示例4: _displaylist

 function _displaylist($tpl = null)
 {
     $document = JFactory::getDocument();
     $this->assignRef('rules', $this->rules);
     $pagination = new JPagination($this->total, $this->limitstart, $this->limit);
     $document->setTitle($document->getTitle() . ' - ' . $pagination->getPagesCounter());
     $this->assignRef('pagination', $pagination);
     $this->assignRef('params', $this->params);
     parent::display($tpl);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:10,代码来源:view.html.php


示例5: DefaultPaginationSearchForm

function DefaultPaginationSearchForm($total, $limitstart, $limit)
{
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    ?>
	<div class="jev_pagination">
	<?php 
    echo $pageNav->getListFooter();
    ?>
	</div>
	<?php 
}
开发者ID:madcsaba,项目名称:li-de,代码行数:12,代码来源:defaultpaginationsearchform.php


示例6: display

 function display($tpl = null)
 {
     global $mainframe, $option;
     if (empty($layout)) {
         // degrade to default
         $layout = 'list';
     }
     // Initialize some variables
     $user =& JFactory::getUser();
     $pathway =& $mainframe->getPathway();
     // Get the page/component configuration
     $params =& $mainframe->getParams('com_content');
     // Request variables
     $task = JRequest::getCmd('task');
     $limit = JRequest::getVar('limit', $params->get('display_num', 20), '', 'int');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $month = JRequest::getInt('month');
     $year = JRequest::getInt('year');
     $filter = JRequest::getString('filter');
     // Get some data from the model
     $state =& $this->get('state');
     $items =& $this->get('data');
     $total =& $this->get('total');
     // Add item to pathway
     $pathway->addItem(JText::_('Archive'), '');
     $params->def('filter', 1);
     $params->def('filter_type', 'title');
     jimport('joomla.html.pagination');
     $pagination = new JPagination($total, $limitstart, $limit);
     $form = new stdClass();
     // Month Field
     $months = array(JHTML::_('select.option', null, JText::_('Month')), JHTML::_('select.option', '01', JText::_('JANUARY_SHORT')), JHTML::_('select.option', '02', JText::_('FEBRUARY_SHORT')), JHTML::_('select.option', '03', JText::_('MARCH_SHORT')), JHTML::_('select.option', '04', JText::_('APRIL_SHORT')), JHTML::_('select.option', '05', JText::_('MAY_SHORT')), JHTML::_('select.option', '06', JText::_('JUNE_SHORT')), JHTML::_('select.option', '07', JText::_('JULY_SHORT')), JHTML::_('select.option', '08', JText::_('AUGUST_SHORT')), JHTML::_('select.option', '09', JText::_('SEPTEMBER_SHORT')), JHTML::_('select.option', '10', JText::_('OCTOBER_SHORT')), JHTML::_('select.option', '11', JText::_('NOVEMBER_SHORT')), JHTML::_('select.option', '12', JText::_('DECEMBER_SHORT')));
     $form->monthField = JHTML::_('select.genericlist', $months, 'month', 'size="1" class="inputbox"', 'value', 'text', $month);
     // Year Field
     $years = array();
     $years[] = JHTML::_('select.option', null, JText::_('Year'));
     for ($i = 2000; $i <= 2010; $i++) {
         $years[] = JHTML::_('select.option', $i, $i);
     }
     $form->yearField = JHTML::_('select.genericlist', $years, 'year', 'size="1" class="inputbox"', 'value', 'text', $year);
     $form->limitField = $pagination->getLimitBox();
     $this->assign('filter', $filter);
     $this->assign('year', $year);
     $this->assign('month', $month);
     $this->assignRef('form', $form);
     $this->assignRef('items', $items);
     $this->assignRef('params', $params);
     $this->assignRef('user', $user);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:51,代码来源:view.html.php


示例7: _displaydetailrank

 function _displaydetailrank($tpl = null)
 {
     $document = JFactory::getDocument();
     $this->assignRef('detailrank', $this->detailrank);
     $pagination = new JPagination($this->total, $this->limitstart, $this->limit);
     // insert the page counter in the title of the window page
     $document->setTitle($document->getTitle() . ' - ' . $pagination->getPagesCounter());
     $this->assignRef('pagination', $pagination);
     $this->assignRef('params', $this->params);
     $this->assignRef('useAvatarFrom', $this->useAvatarFrom);
     $this->assignRef('linkToProfile', $this->linkToProfile);
     $this->assignRef('allowGuestUserViewProfil', $this->allowGuestUserViewProfil);
     parent::display("listing");
 }
开发者ID:q0821,项目名称:esportshop,代码行数:14,代码来源:view.html.php


示例8: getAllNotifications

 /**
  * TuiyoModelNotifications::getAllNotifications()
  * Add function documentation
  * @param mixed $userID
  * @param mixed $status
  * @return void
  */
 public function getAllNotifications($userID, $status = NULL)
 {
     $nTable = TuiyoLoader::table("notifications", true);
     $limit = $this->getState('limit');
     $limitstart = $this->getState('limitstart');
     $notices = $nTable->getUserNotifications((int) $userID, $limitstart, $limit);
     //1b. Paginate?
     jimport('joomla.html.pagination');
     $dbo = $nTable->_db;
     $this->_total = $dbo->loadResult();
     $pageNav = new JPagination($this->_total, $limitstart, $limit);
     $this->pageNav = $pageNav->getPagesLinks();
     //Set the total count
     $this->setState('total', $this->_total);
     $this->setState('pagination', $this->pageNav);
     return $notices;
 }
开发者ID:night-coder,项目名称:ignite,代码行数:24,代码来源:notifications.php


示例9: DefaultPaginationForm

function DefaultPaginationForm($total, $limitstart, $limit)
{
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    $Itemid = JRequest::getInt("Itemid");
    $task = JRequest::getVar("jevtask");
    $link = JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&Itemid={$Itemid}&task={$task}");
    ?>
	<div class="jev_pagination">
	<form action="<?php 
    echo $link;
    ?>
" method="post">
	<?php 
    // TODO add in catids so that changing it doesn't look the data
    echo $pageNav->getListFooter();
    ?>
	</form>
	</div>
	<?php 
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:21,代码来源:defaultpaginationform.php


示例10: _display

 function _display($tpl = null)
 {
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $uri2string = $uri->toString();
     $document->addScript(JURI::base(true) . '/media/system/js/core.js');
     $pagination = new JPagination($this->total, $this->limitstart, $this->limit);
     // insert the page counter in the title of the window page
     $titlesuite = $this->limitstart ? ' - ' . $pagination->getPagesCounter() : '';
     $document->setTitle($document->getTitle() . $titlesuite);
     $this->assignRef('params', $this->params);
     $this->assignRef('allowGuestUserViewProfil', $this->allowGuestUserViewProfil);
     $this->assignRef('rows', $this->rows);
     $this->assignRef('lists', $this->lists);
     $this->assignRef('limit', $this->limit);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('action', $uri2string);
     $this->assignRef('useAvatarFrom', $this->useAvatarFrom);
     $this->assignRef('linkToProfile', $this->linkToProfile);
     parent::display($tpl);
 }
开发者ID:q0821,项目名称:esportshop,代码行数:21,代码来源:view.html.php


示例11: testConstructor

 /**
  * This method tests the.
  *
  * This is a basic data driven test.  It takes the data passed, runs the constructor
  * and make sure the appropriate values get setup.
  *
  * @return  void
  *
  * @since   11.1
  * @dataProvider dataTestConstructor
  * @covers  JPagination::__construct
  */
 public function testConstructor($total, $limitstart, $limit, $expected)
 {
     $pagination = new JPagination($total, $limitstart, $limit);
     $this->assertEquals($expected['total'], $pagination->total, 'Wrong Total');
     $this->assertEquals($expected['limitstart'], $pagination->limitstart, 'Wrong Limitstart');
     $this->assertEquals($expected['limit'], $pagination->limit, 'Wrong Limit');
     $this->assertEquals($expected['pages.total'], $pagination->get('pages.total'), 'Wrong Total Pages');
     $this->assertEquals($expected['pages.current'], $pagination->get('pages.current'), 'Wrong Current Page');
     $this->assertEquals($expected['pages.start'], $pagination->get('pages.start'), 'Wrong Start Page');
     $this->assertEquals($expected['pages.stop'], $pagination->get('pages.stop'), 'Wrong Stop Page');
     unset($pagination);
 }
开发者ID:rvsjoen,项目名称:joomla-platform,代码行数:24,代码来源:JPaginationTest.php


示例12: onContentPrepare

 /**
  * Plugin that adds a pagebreak into the text and truncates text at that point
  *
  * @param   string   $context  The context of the content being passed to the plugin.
  * @param   object   &$row     The article object.  Note $article->text is also available
  * @param   mixed    &$params  The article params
  * @param   integer  $page     The 'page' number
  *
  * @return  mixed  Always returns void or true
  *
  * @since   1.6
  */
 public function onContentPrepare($context, &$row, &$params, $page = 0)
 {
     $canProceed = $context == 'com_content.article';
     if (!$canProceed) {
         return;
     }
     $style = $this->params->get('style', 'pages');
     // Expression to search for.
     $regex = '#<hr(.*)class="system-pagebreak"(.*)\\/>#iU';
     $input = JFactory::getApplication()->input;
     $print = $input->getBool('print');
     $showall = $input->getBool('showall');
     if (!$this->params->get('enabled', 1)) {
         $print = true;
     }
     if ($print) {
         $row->text = preg_replace($regex, '<br />', $row->text);
         return true;
     }
     // Simple performance check to determine whether bot should process further.
     if (JString::strpos($row->text, 'class="system-pagebreak') === false) {
         return true;
     }
     $view = $input->getString('view');
     $full = $input->getBool('fullview');
     if (!$page) {
         $page = 0;
     }
     if ($params->get('intro_only') || $params->get('popup') || $full || $view != 'article') {
         $row->text = preg_replace($regex, '', $row->text);
         return;
     }
     // Find all instances of plugin and put in $matches.
     $matches = array();
     preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER);
     if ($showall && $this->params->get('showall', 1)) {
         $hasToc = $this->params->get('multipage_toc', 1);
         if ($hasToc) {
             // Display TOC.
             $page = 1;
             $this->_createToc($row, $matches, $page);
         } else {
             $row->toc = '';
         }
         $row->text = preg_replace($regex, '<br />', $row->text);
         return true;
     }
     // Split the text around the plugin.
     $text = preg_split($regex, $row->text);
     // Count the number of pages.
     $n = count($text);
     // We have found at least one plugin, therefore at least 2 pages.
     if ($n > 1) {
         $title = $this->params->get('title', 1);
         $hasToc = $this->params->get('multipage_toc', 1);
         // Adds heading or title to <site> Title.
         if ($title) {
             if ($page) {
                 if ($page && @$matches[$page - 1][2]) {
                     $attrs = JUtility::parseAttributes($matches[$page - 1][1]);
                     if (@$attrs['title']) {
                         $row->page_title = $attrs['title'];
                     }
                 }
             }
         }
         // Reset the text, we already hold it in the $text array.
         $row->text = '';
         if ($style == 'pages') {
             // Display TOC.
             if ($hasToc) {
                 $this->_createToc($row, $matches, $page);
             } else {
                 $row->toc = '';
             }
             // Traditional mos page navigation
             $pageNav = new JPagination($n, $page, 1);
             // Page counter.
             $row->text .= '<div class="pagenavcounter">';
             $row->text .= $pageNav->getPagesCounter();
             $row->text .= '</div>';
             // Page text.
             $text[$page] = str_replace('<hr id="system-readmore" />', '', $text[$page]);
             $row->text .= $text[$page];
             // $row->text .= '<br />';
             $row->text .= '<div class="pager">';
             // Adds navigation between pages to bottom of text.
             if ($hasToc) {
//.........这里部分代码省略.........
开发者ID:educakanchay,项目名称:kanchay,代码行数:101,代码来源:pagebreak.php


示例13: appFullView

 /**
  * Application full view
  * */
 public function appFullView()
 {
     /**
      * Opengraph
      */
     // CHeadHelper::setType('website', JText::_('COM_COMMUNITY_PHOTOS_WALL_TITLE'));
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $applicationName = JString::strtolower($jinput->get->get('app', '', 'STRING'));
     if (empty($applicationName)) {
         JError::raiseError(500, JText::_('COM_COMMUNITY_APP_ID_REQUIRED'));
     }
     $output = '<div class="joms-page">';
     $output .= '<h3 class="joms-page__title">' . JText::_('COM_COMMUNITY_PHOTOS_WALL_TITLE') . '</h3>';
     if ($applicationName == 'walls') {
         //CFactory::load( 'libraries' , 'wall' );
         $limit = $jinput->request->get('limit', 5, 'INT');
         //JRequest::getVar( 'limit' , 5 , 'REQUEST' );
         $limitstart = $jinput->request->get('limitstart', 0, 'INT');
         //JRequest::getVar( 'limitstart', 0, 'REQUEST' );
         $albumId = JRequest::getInt('albumid', '');
         $my = CFactory::getUser();
         $album = JTable::getInstance('Album', 'CTable');
         $album->load($albumId);
         //CFactory::load( 'helpers' , 'owner' );
         //CFactory::load( 'helpers' , 'friends' );
         // Get the walls content
         $viewAllLink = false;
         $wallCount = false;
         if ($jinput->request->get('task', '') != 'app') {
             $viewAllLink = CRoute::_('index.php?option=com_community&view=photos&task=app&albumid=' . $album->id . '&app=walls');
             $wallCount = CWallLibrary::getWallCount('album', $album->id);
         }
         $output .= CWallLibrary::getWallContents('albums', $album->id, COwnerHelper::isCommunityAdmin() || COwnerHelper::isMine($my->id, $album->creator), $limit, $limitstart);
         if (CFriendsHelper::isConnected($my->id, $album->creator) || COwnerHelper::isCommunityAdmin()) {
             $output .= CWallLibrary::getWallInputForm($album->id, 'photos,ajaxAlbumSaveWall', 'photos,ajaxAlbumRemoveWall');
         }
         $output .= CWallLibrary::getViewAllLinkHTML($viewAllLink, $wallCount);
         jimport('joomla.html.pagination');
         $wallModel = CFactory::getModel('wall');
         $pagination = new JPagination($wallModel->getCount($album->id, 'albums'), $limitstart, $limit);
         $output .= '<div class="cPagination">' . $pagination->getPagesLinks() . '</div>';
     } else {
         $model = CFactory::getModel('apps');
         $applications = CAppPlugins::getInstance();
         $applicationId = $model->getUserApplicationId($applicationName);
         $application = $applications->get($applicationName, $applicationId);
         if (is_callable(array($application, 'onAppDisplay'), true)) {
             // Get the parameters
             $manifest = CPluginHelper::getPluginPath('community', $applicationName) . '/' . $applicationName . '/' . $applicationName . '.xml';
             $params = new CParameter($model->getUserAppParams($applicationId), $manifest);
             $application->params = $params;
             $application->id = $applicationId;
             $output = $application->onAppDisplay($params);
         } else {
             JError::raiseError(500, JText::_('COM_COMMUNITY_APPS_NOT_FOUND'));
         }
     }
     $output .= '</div>';
     echo $output;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:64,代码来源:view.html.php


示例14: products

 function products()
 {
     $mainframe = JFactory::getApplication();
     $jshopConfig = JSFactory::getConfig();
     $session = JFactory::getSession();
     $session->set("jshop_end_page_buy_product", $_SERVER['REQUEST_URI']);
     $session->set("jshop_end_page_list_product", $_SERVER['REQUEST_URI']);
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeLoadProductList', array());
     $vendor_id = JRequest::getInt("vendor_id");
     $vendor = JSFactory::getTable('vendor', 'jshop');
     $vendor->load($vendor_id);
     $dispatcher->trigger('onBeforeDisplayVendor', array(&$vendor));
     appendPathWay($vendor->shop_name);
     $seo = JSFactory::getTable("seo", "jshop");
     $seodata = $seo->loadData("vendor-product-" . $vendor_id);
     if (!isset($seodata->title) || $seodata->title == "") {
         $seodata = new stdClass();
         $seodata->title = $vendor->shop_name;
         $seodata->keyword = $vendor->shop_name;
         $seodata->description = $vendor->shop_name;
     }
     setMetaData($seodata->title, $seodata->keyword, $seodata->description);
     $action = xhtmlUrl($_SERVER['REQUEST_URI']);
     $products_page = $jshopConfig->count_products_to_page;
     $count_product_to_row = $jshopConfig->count_products_to_row;
     $context = "jshoping.vendor.front.product";
     $contextfilter = "jshoping.list.front.product.vendor." . $vendor_id;
     $orderby = $mainframe->getUserStateFromRequest($context . 'orderby', 'orderby', $jshopConfig->product_sorting_direction, 'int');
     $order = $mainframe->getUserStateFromRequest($context . 'order', 'order', $jshopConfig->product_sorting, 'int');
     $limit = $mainframe->getUserStateFromRequest($context . 'limit', 'limit', $products_page, 'int');
     if (!$limit) {
         $limit = $products_page;
     }
     $limitstart = JRequest::getInt('limitstart');
     if ($order == 4) {
         $order = 1;
     }
     $orderbyq = getQuerySortDirection($order, $orderby);
     $image_sort_dir = getImgSortDirection($order, $orderby);
     $field_order = $jshopConfig->sorting_products_field_s_select[$order];
     $filters = getBuildFilterListProduct($contextfilter, array("vendors"));
     $total = $vendor->getCountProducts($filters);
     jimport('joomla.html.pagination');
     $pagination = new JPagination($total, $limitstart, $limit);
     $pagenav = $pagination->getPagesLinks();
     $dispatcher->trigger('onBeforeFixLimitstartDisplayProductList', array(&$limitstart, &$total, 'vendor'));
     if ($limitstart >= $total) {
         $limitstart = 0;
     }
     $rows = $vendor->getProducts($filters, $field_order, $orderbyq, $limitstart, $limit);
     addLinkToProducts($rows, 0, 1);
     foreach ($jshopConfig->sorting_products_name_s_select as $key => $value) {
         $sorts[] = JHTML::_('select.option', $key, $value, 'sort_id', 'sort_value');
     }
     insertValueInArray($products_page, $jshopConfig->count_product_select);
     foreach ($jshopConfig->count_product_select as $key => $value) {
         $product_count[] = JHTML::_('select.option', $key, $value, 'count_id', 'count_value');
     }
     $sorting_sel = JHTML::_('select.genericlist', $sorts, 'order', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'sort_id', 'sort_value', $order);
     $product_count_sel = JHTML::_('select.genericlist', $product_count, 'limit', 'class = "inputbox" size = "1" onchange = "submitListProductFilters()"', 'count_id', 'count_value', $limit);
     $_review = JSFactory::getTable('review', 'jshop');
     $allow_review = $_review->getAllowReview();
     if ($jshopConfig->show_product_list_filters) {
         $first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'manufacturer_id', 'name');
         $_manufacturers = JSFactory::getTable('manufacturer', 'jshop');
         $listmanufacturers = $_manufacturers->getList();
         array_unshift($listmanufacturers, $first_el);
         if (isset($filters['manufacturers'][0])) {
             $active_manufacturer = $filters['manufacturers'][0];
         } else {
             $active_manufacturer = '';
         }
         $manufacuturers_sel = JHTML::_('select.genericlist', $listmanufacturers, 'manufacturers[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'manufacturer_id', 'name', $active_manufacturer);
         $first_el = JHTML::_('select.option', 0, _JSHOP_ALL, 'category_id', 'name');
         $categories = buildTreeCategory(1);
         array_unshift($categories, $first_el);
         if (isset($filters['categorys'][0])) {
             $active_category = $filters['categorys'][0];
         } else {
             $active_category = 0;
         }
         $categorys_sel = JHTML::_('select.genericlist', $categories, 'categorys[]', 'class = "inputbox" onchange = "submitListProductFilters()"', 'category_id', 'name', $active_category);
     } else {
         $categorys_sel = null;
         $manufacuturers_sel = null;
     }
     $willBeUseFilter = willBeUseFilter($filters);
     $display_list_products = count($rows) > 0 || $willBeUseFilter;
     $dispatcher->trigger('onBeforeDisplayProductList', array(&$rows));
     $view_name = "vendor";
     $view_config = array("template_path" => $jshopConfig->template_path . $jshopConfig->template . "/" . $view_name);
     $view = $this->getView($view_name, getDocumentType(), '', $view_config);
     $view->setLayout("products");
     $view->assign('config', $jshopConfig);
     $view->assign('template_block_list_product', "list_products/list_products.php");
     $view->assign('template_no_list_product', "list_products/no_products.php");
     $view->assign('template_block_form_filter', "list_products/form_filters.php");
     $view->assign('template_block_pagination', "list_products/block_pagination.php");
     $view->assign('path_image_sorting_dir', $jshopConfig->live_path . 'images/' . $image_sort_dir);
//.........这里部分代码省略.........
开发者ID:olegverstka,项目名称:monax.dev,代码行数:101,代码来源:vendor.php


示例15: insertHTML

 function insertHTML()
 {
     $article = $this->article;
     $model = $this->getModel();
     $mainframe = JFactory::getApplication();
     $doc =& JFactory::getDocument();
     if (JPATH_BASE != JPATH_ADMINISTRATOR) {
         $doc->addStyleSheet('components/com_ginclude/css/general.css');
         $doc->addStyleSheet('components/com_ginclude/css/component.css');
     }
     if (@$_REQUEST['part'] != '') {
         $part = $_REQUEST['part'];
     } else {
         $part = -1;
     }
     $articleParts = $model->getParts($article->id, $part);
     $result = '';
     $result .= '<div style="position:relative;"><h3>' . JText::_('ARTICLE') . ': ' . $article->title . '</h3>';
     $result .= JText::_('SECTION') . ': <strong>' . $article->section . '</strong> ' . JText::_('CATEGORY') . ': <strong>' . $article->categorie . '</strong> ' . JText::_('CREATED') . ': <strong>' . $article->cdate . '</strong>';
     $result .= '<div style="position:absolute;right:5px;top:10px;"><button onclick="location.href=\'index.php?option=com_ginclude&task=articles&tmpl=component\';">' . JText::_('SELECT_OTHER_ARTICLE') . '</button></div>';
     $result .= '</div>';
     if ($articleParts === false) {
         /*clanek neni rozdelen na casti => nabidneme ho ke vlozeni cely*/
         $result .= '<div><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'-1\');">' . JText::_('INSERT_FULL_ARTICLE') . '</a></div>';
     } else {
         /*nacetli jsme jednotlive sekce, tak zobrazime vyber*/
         /*strankovani*/
         $limit = JRequest::getVar('limit', $mainframe->getCfg(list_limit));
         $limitstart = JRequest::getVar('limitstart', 0);
         $articles = $model->getArticles(JRequest::getInt('section', -1), JRequest::getInt('categorie', -1), JRequest::getString('filter', ''), JRequest::getCmd('filter_order', 'title'), JRequest::getCmd('filter_order_Dir', 'asc'), $limitstart, $limit);
         $total = 0;
         /**/
         $result .= '<form action="index.php" id="adminForm" name="adminForm">
         <input type="hidden" name="article" value="' . $article->id . '" />
         <input type="hidden" name="tmpl" value="component" />
         <input type="hidden" name="task" value="insert" />
         <input type="hidden" name="option" value="com_ginclude" />
         <table class="adminlist" cellspacing="1">';
         $result .= '<thead><tr><th style="text-align:left;">' . JText::_('ARTICLE_SECTION') . ': <select name="part" onchange="document.getElementById(\'adminForm\').submit();"><option value="-1">--' . JText::_('SELECT') . '--</option>';
         if (count($articleParts['main']) > 0) {
             foreach ($articleParts['main'] as $key => $value) {
                 $result .= '<option value="' . $key . '"';
                 if ($key == $part) {
                     $result .= ' selected="selected" ';
                 }
                 $result .= '>' . $value . '</option>';
             }
         }
         $result .= '</select>';
         if ($part != -1) {
             $result .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $part . '\');" style="font-weight:normal;">' . JText::_('INSERT_SECTION_CONTENT') . '</a>&nbsp;';
         }
         $result .= '</th></tr></thead>';
         if ($part == -1) {
             /*neni vybrana zadna sekce clanku -> musime vypsat info pro uzivatele*/
             $result .= '<tbody><tr><td>' . JText::_('ARTICLE_SECTION_SELECT') . '</td></tr></tbody>';
         } elseif (count($articleParts['part']) > 0) {
             /*v dané sekci jsou vložitelné oblasti*/
             $result .= '<tbody>';
             $rowClass = 'row1';
             $pos = -1;
             $max = $limit + $limitstart;
             if (count($articleParts['part']) > 0) {
                 foreach ($articleParts['part'] as $key => $value) {
                     $pos++;
                     if ($pos >= $limitstart && $pos < $max) {
                         if ($rowClass == 'row0') {
                             $rowClass = 'row1';
                         } else {
                             $rowClass = 'row0';
                         }
                         $result .= '<tr class="' . $rowClass . '"><td><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $key . '\');">' . $value . '</a></td></tr>';
                     }
                 }
             }
             $total = $pos + 1;
             $result .= '</tbody>';
         } else {
             /*nejsou žádné konkrétní obsahy*/
             $result .= '<tbody><tr class="row0"><td><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $part . '\');">' . JText::_('INSERT_CONTENT') . '...</a></td></tr></tbody>';
         }
         jimport('joomla.html.pagination');
         if ($total > 1) {
             $pageNav = new JPagination($total, $limitstart, $limit);
             $result .= '<tfoot><tr><td>' . $pageNav->getListFooter() . '</td></tr></tfoot></table>';
         }
         $result .= '</table>';
         $result .= '</form>';
     }
     return $result;
 }
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:91,代码来源:insert.html.php


示例16: _getArticleHTML

        public static function _getArticleHTML($userid, $limit, $limitstart, $row, $app, $total, $cat, $myblogItemId, $introtext, $params)
        {
            JPluginHelper::importPlugin('content');
            $dispatcher = JDispatcher::getInstance();
            $html = "";
            if (!empty($row)) {
                $html .= '<div id="application-myarticles" class="joms-tab__app">';
                $html .= '<ul class="list-articles cResetList">';
                foreach ($row as $data) {
                    $text_limit = $params->get('limit', 50);
                    if (JString::strlen($data->introtext) > $text_limit) {
                        $content = strip_tags(JString::substr($data->introtext, 0, $text_limit));
                        $content .= " .....";
                    } else {
                        $content = $data->introtext;
                    }
                    $data->text = $content;
                    $result = $dispatcher->trigger('onPrepareContent', array(&$data, &$params, 0));
                    if (empty($data->permalink)) {
                        $myblog = 0;
                        $permalink = "";
                    } else {
                        $myblog = 1;
                        $permalink = $data->permalink;
                    }
                    if (empty($cat[$data->catid])) {
                        $cat[$data->catid] = "";
                    }
                    $data->sectionid = empty($data->sectionid) ? 0 : $data->sectionid;
                    $link = plgCommunityMyArticles::buildLink($data->id, $data->alias, $data->catid, $cat[$data->catid], $data->sectionid, $myblog, $permalink, $myblogItemId);
                    $created = new JDate($data->created);
                    $date = CTimeHelper::timeLapse($created);
                    $html .= '	<li>';
                    $html .= '		<span class="joms-text--small">' . $date . '</span>';
                    $html .= '		<a href="' . $link . '">' . htmlspecialchars($data->title) . '</a>';
                    if ($introtext == 1) {
                        $html .= '<p>' . $content . '</p>';
                    }
                    $html .= '	</li>';
                }
                $html .= '</ul>';
                if ($app == 1) {
                    jimport('joomla.html.pagination');
                    $pagination = new JPagination($total, $limitstart, $limit);
                    $html .= '
                    <div class="list-articles--button">
						' . $pagination->getPagesLinks() . '
					</div>';
                } else {
                    $showall = CRoute::_('index.php?option=com_community&view=profile&userid=' . $userid . '&task=app&app=myarticles');
                    $html .= "<div class='list-articles--button'><a class='joms-button--link' href='" . $showall . "'>" . JText::_('PLG_MYARTICLES_SHOWALL') . "</a></div>";
                }
                $html .= '</div>';
            } else {
                $html .= "<p>" . JText::_("PLG_MYARTICLES_NO_ARTICLES") . "</p>";
            }
            return $html;
        }
开发者ID:Jougito,项目名称:DynWeb,代码行数:58,代码来源:myarticles.php


示例17: getDisplayTab


//.........这里部分代码省略.........
         $nbPlugSortBy = $params->get('nbPlugSortBy', "1");
         $nbPlugSortOrder = $params->get('nbPlugSortOrder', "DESC");
         $nbPlugShowPagination = $params->get('nbPlugShowPagination', "1");
         $nbPlugPaginationCount = $params->get('nbPlugPaginationCount', "5");
         $limit = $nbPlugPaginationCount > 0 ? $nbPlugPaginationCount : 0;
         $offset = JRequest::getVar('limitstart', 0, 'REQUEST');
         //get current user
         $userId = $user->id;
         //get user posts
         $rows = $this->getPosts($userId, $nbPlugSortBy, $nbPlugSortOrder, $nbPlugPaginationCount, $limit, $offset);
         //get user post count
         $row_count = $this->countPosts($userId);
         //get item id
         $itemId = $this->getItemId();
         //create_html
         if ($row_count <= 0) {
             $list = '<div class="cbNinjaBoard"><div class="cbNBposts"><table><tr><td>You currently have no NinjaBoard posts</td></tr></table></div></div>';
         } else {
             $list = "";
             //show only selected fields in a table row
             $list .= '<div class="cbNinjaBoard"><div class="cbNBposts"><table><thead><tr>';
             if ($nbPlugShowSubject) {
                 $list .= '<th>' . JText::_('NB_SUBJECT_CBP') . '</th>';
             }
             if ($nbPlugShowMessage) {
                 $list .= '<th>' . JText::_('NB_MESSAGE_CBP') . '</th>';
             }
             if ($nbPlugShowForum) {
                 $list .= '<th>' . JText::_('NB_FORUM_CBP') . '</th>';
             }
             if ($nbPlugShowHits) {
                 $list .= '<th>' . JText::_('NB_HITS_CBP') . '</th>';
             }
             if ($nbPlugShowCreated) {
                 $list .= '<th>' . JText::_('NB_CREATED_CBP') . '</th>';
             }
             if ($nbPlugShowModified) {
                 $list .= '<th>' . JText::_('NB_MODIFIED_CBP') . '</th>';
             }
             if ($nbPlugShowEdit) {
                 $list .= '<th>' . JText::_('NB_VIEW_POST_CBP') . '</th>';
             }
             $list .= '</tr></thead><tbody>';
             $items = array();
             foreach ($rows as $row) {
                 //get the item subject, show no subject if there is none, truncate subject if necessary
                 $item->subject_long = stripslashes($row->subject) ? stripslashes($row->subject) : JText::_('NB_NO_SUBJECT_CBP');
                 $item->subject_short = JString::strlen($row->subject) > $nbPlugTruncateSubject ? JString::substr($row->subject, 0, $nbPlugTruncateSubject - 4) . '...' : $item->subject_long;
                 $item->subject = $nbPlugTruncateSubject > 0 ? $item->subject_short : $item->subject_long;
                 //get the item message, show no message if there is none, truncate message if necessary
                 $item->message_long = stripslashes($row->message) ? stripslashes($row->message) : JText::_('NB_NO_MESSAGE_CBP');
                 $item->message_short = JString::strlen($row->message) > $nbPlugTruncateMessage ? JStri 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JPane类代码示例发布时间:2022-05-23
下一篇:
PHP JObject类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap