Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * This file contains the foldable pager for menus GUI class.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       GUI
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Timo Hummel
 10:  * @copyright        four for business AG <www.4fb.de>
 11:  * @license          http://www.contenido.org/license/LIZENZ.txt
 12:  * @link             http://www.4fb.de
 13:  * @link             http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * Class for foldable pager for menus.
 20:  *
 21:  * @package    Core
 22:  * @subpackage GUI
 23:  */
 24: class cGuiObjectPager extends cGuiFoldingRow {
 25: 
 26:     public $_pagerLink;
 27:     public $_parameterToAdd;
 28: 
 29:     /**
 30:      * @throws cException if the given link is not an object
 31:      */
 32:     public function __construct($uuid, $items, $itemsperpage, $currentpage, $link, $parameterToAdd, $id = '') {
 33:         if ((int) $currentpage == 0) {
 34:             $currentpage = 1;
 35:         }
 36: 
 37:         if ($id == '') {
 38:             parent::__construct($uuid, i18n("Paging"));
 39:         } else {
 40:             parent::__construct($uuid, i18n("Paging"), $id);
 41:         }
 42: 
 43:         if (!is_object($link)) {
 44:             throw new cException('Parameter link is not an object');
 45:             return false;
 46:         }
 47:         $this->_cPager = new cPager($items, $itemsperpage, $currentpage);
 48:         $this->_pagerLink = $link;
 49:         $this->_parameterToAdd = $parameterToAdd;
 50:     }
 51: 
 52:     public function render($bContentOnly = false) {
 53:         #Do not display Page navigation if there is only one Page and we are not in newsletter section
 54:         if ($this->_cPager->getMaxPages() == 1) {
 55:             $this->_headerRow->setStyle("display:none");
 56:             $this->_contentRow->setStyle("display:none");
 57:         }
 58: 
 59:         $items = $this->_cPager->getPagesInRange();
 60:         $link = $this->_pagerLink;
 61: 
 62:         $output = '';
 63: 
 64:         if (!$this->_cPager->isFirstPage()) {
 65:             $img = new cHTMLImage("images/paging/first.gif");
 66: 
 67:             $link->setAlt(i18n("First page"));
 68:             $link->setContent($img);
 69:             $link->setCustom($this->_parameterToAdd, 1);
 70:             $output .= $link->render();
 71:             $output .= " ";
 72: 
 73:             $img = new cHTMLImage("images/paging/previous.gif");
 74:             $link->setAlt(i18n("Previous page"));
 75:             $link->setContent($img);
 76: 
 77:             $link->setCustom($this->_parameterToAdd, $this->_cPager->getCurrentPage() - 1);
 78: 
 79:             $output .= $link->render();
 80:             $output .= " ";
 81:         } else {
 82:             $output .= '<img src="images/spacer.gif" alt="" width="8"> ';
 83:             $output .= '<img src="images/spacer.gif" alt="" width="8">';
 84:         }
 85: 
 86:         foreach ($items as $key => $item) {
 87:             $link->setContent($key);
 88:             $link->setAlt(sprintf(i18n("Page %s"), $key));
 89:             $link->setCustom($this->_parameterToAdd, $key);
 90: 
 91:             switch ($item) {
 92:                 case "|": $output .= "...";
 93:                     break;
 94:                 case "current": $output .= '<span class="cpager_currentitem">' . $key . "</span>";
 95:                     break;
 96:                 default: $output .= $link->render();
 97:             }
 98: 
 99:             $output .= " ";
100:         }
101: 
102:         if (!$this->_cPager->isLastPage()) {
103:             $img = new cHTMLImage("images/paging/next.gif");
104:             $link->setAlt(i18n("Next page"));
105:             $link->setContent($img);
106:             $link->setCustom($this->_parameterToAdd, $this->_cPager->getCurrentPage() + 1);
107: 
108:             $output .= $link->render();
109:             $output .= " ";
110: 
111:             $img = new cHTMLImage("images/paging/last.gif");
112: 
113:             $link->setCustom($this->_parameterToAdd, $this->_cPager->getMaxPages());
114:             $link->setAlt(i18n("Last page"));
115:             $link->setContent($img);
116: 
117:             $output .= $link->render();
118:             $output .= " ";
119:         } else {
120:             $output .= '<img src="images/spacer.gif" alt="" width="8"> ';
121:             $output .= '<img src="images/spacer.gif" alt="" width="8">';
122:         }
123: 
124:         $this->_contentData->setAlignment("center");
125:         $this->_contentData->setClass("foldingrow_content");
126: 
127:         #Do not display Page navigation if there is only one Page and we are not in newsletter section
128:         if ($this->_cPager->getMaxPages() == 1) {
129:             $output = '';
130:         }
131: 
132:         $this->_contentData->setContent($output);
133: 
134:         if ($bContentOnly) {
135:             return $output;
136:         } else {
137:             return parent::render();
138:         }
139:     }
140: 
141: }
142: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen