Source for file INFA_CMS_PAGE.phpclass

Documentation is available at INFA_CMS_PAGE.phpclass

  1. <?php
  2. /**
  3.   * openCSP class file
  4.   *
  5.   * @project Open CSP-Management
  6.   * @package cms
  7.   *
  8.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  9.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10.   *
  11.   * @since pk-16.06.2008
  12.   * @version $Id: INFA_CMS_PAGE.phpclass,v 1.7 2008/08/16 09:21:12 pitlinz Exp $
  13.   */
  14.  
  15. // ---------------------------------------------------------
  16. // requirements
  17. // ---------------------------------------------------------
  18.  
  19. if (!defined('CHAPTER_SHOWMODE_PAGEALL'))           define('CHAPTER_SHOWMODE_PAGEALL',0);
  20. if (!defined('CHAPTER_SHOWMODE_ALLWAYS_TOP'))       define('CHAPTER_SHOWMODE_ALLWAYS_TOP',1);
  21. if (!defined('CHAPTER_SHOWMODE_ALLWAYS_BOTTOM'))    define('CHAPTER_SHOWMODE_ALLWAYS_BOTTOM',2);
  22. if (!defined('CHAPTER_SHOWMODE_PAGEONLY'))          define('CHAPTER_SHOWMODE_PAGEONLY',3);
  23. if (!defined('CHAPTER_SHOWMODE_SUMMARYONLY'))       define('CHAPTER_SHOWMODE_SUMMARYONLY',4);
  24. if (!defined('CHAPTER_SHOWMODE_PROGRAMM'))          define('CHAPTER_SHOWMODE_PROGRAMM',5);
  25.  
  26.  
  27. /**
  28.   * openCSP interface INFA_CMS_PAGE
  29.   *
  30.   * @project Open CSP-Management
  31.   * @package cms
  32.   *
  33.   * @author Peter Krebs <pitlinz@users.sourceforge.net>
  34.   * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  35.   *
  36.   * @since pk-16.06.2008
  37.   * @version $Id: INFA_CMS_PAGE.phpclass,v 1.7 2008/08/16 09:21:12 pitlinz Exp $
  38.   */
  39. interface INFA_CMS_PAGE
  40. {
  41.     // ---------------------------------------------------------------------------
  42.     // constants
  43.     // ---------------------------------------------------------------------------
  44.     
  45.     // ---------------------------------------------------------------------------
  46.     // class (static)
  47.     // ---------------------------------------------------------------------------
  48.     
  49.     /*** class vars ------------------------------------------------------ */
  50.     
  51.     /*** class methods --------------------------------------------------- */
  52.     
  53.     // ---------------------------------------------------------------------------
  54.     // object vars
  55.     // ---------------------------------------------------------------------------
  56.     
  57.     /*** compostion --------------------------------------------------- */
  58.     
  59.     /*** attributes  -------------------------------------------------- */
  60.         
  61.     // ---------------------------------------------------------------------------
  62.     // factory / construct
  63.     // ---------------------------------------------------------------------------
  64.     
  65.     // ---------------------------------------------------------------------------
  66.     // getter / setter
  67.     // ---------------------------------------------------------------------------
  68.  
  69.     /**
  70.      * returns the page id
  71.      *
  72.      * @return int 
  73.      */
  74.     public function getId();    
  75.     
  76.     /**
  77.      * sets the page id
  78.      *
  79.      * @param int $aId 
  80.      */
  81.     public function setId($aId);    
  82.     
  83.     /**
  84.      * returns the page title
  85.      * 
  86.      * @return string 
  87.      */
  88.     public function getTitle($debug=False);
  89.     
  90.     /**
  91.       * returns the page state id
  92.       *
  93.       * @returns int
  94.       */
  95.     public function getStateId();
  96.     
  97.     /**
  98.      * has the method getContent been called?
  99.      *
  100.      * @return boolean 
  101.      */
  102.     public function getContentCalled();
  103.     
  104.     /**
  105.      * sets contentWasCalled
  106.      * 
  107.      * getContent has been called or is to omit
  108.      *
  109.      * @param boolean $called 
  110.      */
  111.     public function setContentCalled($called='True');    
  112.     
  113.     // ---------------------------------------------------------------------------
  114.     // db methods
  115.     // ---------------------------------------------------------------------------
  116.         
  117.     /**
  118.       * returns a field => value array as stored in the db
  119.       *
  120.       * ensure PAG_OBJECTVARS is serialized with the current values
  121.       *
  122.       * @param bool $withoutNull  null values are not added to the array
  123.       * @param bool $debug        show debug info?
  124.       *
  125.       * @returns array
  126.       *
  127.       */
  128.     public function getDBRow($withoutNull=True,$debug=False);
  129.  
  130.     /**
  131.       * sets a database row to the object fields
  132.       *
  133.       * unserializes PAG_OBJECTVARS
  134.       *
  135.       * @param  array $row the row form a select * from DBMS_TABLEOBJ::myTable
  136.       * @param  boolean $asPopulated set populateTS as if the object has been populated
  137.       * @param  boolean $debug 
  138.       *
  139.       * @returns boolean
  140.       *
  141.       */
  142.     public function setDBRow($row,$asPopulated=True,$debug=False);    
  143.     
  144.     
  145.     /**
  146.       * sets all fields of an array to the objcet
  147.       *
  148.       * @param array $valArr 
  149.       * @param boolean $debug 
  150.       *
  151.       * @return boolean 
  152.       *
  153.       */
  154.     public function setDBVal($valArr,$debug=False);   
  155.     
  156.     /*** form / editing --------------------------------------------------- */
  157.     
  158.     /**
  159.      * returns the form for the page
  160.      *  
  161.      * @param int $mode (form mode)
  162.      * @param string $frmName 
  163.      * @param string $frmClass 
  164.      * @param boolean $debug 
  165.      *
  166.      * @return CMS_PAGE_FORM 
  167.      * 
  168.      * @requires CMS_PAGE_FORM
  169.      * 
  170.      */
  171.     public function &getForm($mode=FRM_MODE_READONLY,$frmName='',$frmClass='CMS_PAGE_FORM',$debug=False);
  172.     
  173.     
  174.     // ---------------------------------------------------------------------------
  175.     // Project Methods
  176.     // ---------------------------------------------------------------------------
  177.     
  178.     /**
  179.       * returns the cms project id
  180.       *
  181.       * @param boolean $debug 
  182.       * 
  183.       * @return int 
  184.       *
  185.       */
  186.     function getProjId($debug=False)
  187.  
  188.     /**
  189.       * sets the cms project id
  190.       *
  191.       * @param $aId int Project ID
  192.       *
  193.       */
  194.     function setProjId($aId)
  195.     
  196.     /**
  197.       * returns the Project Object
  198.       *
  199.       * @param boolean $setAsCurrent if true and method $this->setAsCurrent() exists it will be called
  200.       * @param boolean $debug 
  201.       * @param boolean $forceObj (if true a new object will be instanciated if none is set)
  202.       *
  203.       * @return CMS_PROJECT 
  204.       * 
  205.       */
  206.     function &getMyProject($setAsCurrent=False,$debug=False,$forceObj=True);    
  207.     
  208.     /**
  209.       * sets the project object of the page
  210.       * 
  211.       * also sets the project id form $aProjObj
  212.       *
  213.       * @param CMS_PROJECT aProjObj
  214.       * @param boolean $debug 
  215.       *
  216.       */
  217.     function setMyProject(&$aProjObj,$debug=False);    
  218.     
  219.     // ---------------------------------------------------------------------------
  220.     // Menu Methods
  221.     // ---------------------------------------------------------------------------
  222.       
  223.     /**
  224.       * returns the cms menu id
  225.       *
  226.       * @return int 
  227.       *
  228.       */
  229.     function getMenId();
  230.  
  231.     /**
  232.       * sets the menu id
  233.       *
  234.       * @param int $aId 
  235.       *
  236.       */
  237.     function setMenId($aId);    
  238.     
  239.     /**
  240.       * returns the menu node of the object
  241.       *
  242.       * @param boolean $debug 
  243.       *
  244.       * @returns CMS_MENU_NODE
  245.       *
  246.       */
  247.     function &getMyMenuNode($debug=False);     
  248.     
  249.     /**
  250.       * sets the menu node object
  251.       *
  252.       * @param CMS_MENU_NODE $aNode 
  253.       * @param boolean $debug 
  254.       *
  255.       */
  256.     function setMyMenuNode(&$aNode,$debug=False);
  257.  
  258.     
  259.     // ---------------------------------------------------------------------------
  260.     // rights and state
  261.     // ---------------------------------------------------------------------------
  262.  
  263.     /**
  264.      * returns if the page is the current page
  265.      *
  266.      * @param boolean $debug 
  267.      * @return boolean 
  268.      * 
  269.      */
  270.     public function isCurrent($debug=False);    
  271.     
  272.     /**
  273.       * returns if the current page is online
  274.       *
  275.       * @param boolean $debug 
  276.       *
  277.       * @return boolean 
  278.       */
  279.     public function isOnline($debug=False)
  280.  
  281.     /**
  282.      * returns if the page is expired
  283.      * (PAG_SHOWTILL < NOW())
  284.      *
  285.      * @param boolean $debug 
  286.      * 
  287.      * @return boolean 
  288.      */
  289.     public function isExpired($debug=False);    
  290.     
  291.     /**
  292.       * returns if the current user can open the page
  293.       *
  294.       * @param boolean $debug 
  295.       *
  296.       * @returns boolean
  297.       *
  298.       ***/
  299.     public function curUserCanOpen($debug=False);    
  300.     
  301.     // ---------------------------------------------------------------------------
  302.     // navigation
  303.     // ---------------------------------------------------------------------------
  304.     
  305.     /*** preview / editing ----------------------------------------------- */
  306.     
  307.     /**
  308.      * returns the preview uri
  309.      * 
  310.      * @return string 
  311.      *
  312.      */
  313.     public function getPreviewUri();    
  314.     
  315.     // ---------------------------------------------------------------------------
  316.     // output
  317.     // ---------------------------------------------------------------------------
  318.     
  319.     /**
  320.       * executes a prepend script before the page output starts
  321.       *
  322.       * @param boolean $debug 
  323.       */ 
  324.     function execPrependCmds($debug=False);
  325.         
  326.     /*** HTML_PAGE  --------------------------------------------------- */
  327.     
  328.     /**
  329.       * @param CMS_HTML_PAGE $aHTMLPage 
  330.       */
  331.     function setMyHTMLPage(&$aHTMLPage);
  332.     
  333.     /**
  334.       * @return CMS_HTML_PAGE 
  335.       */
  336.     function getMyHTMLPage();
  337.     
  338.     /**
  339.       * returns the content
  340.       *
  341.       * @param int $chaShowMode 
  342.       * @param boolean $debug 
  343.       *
  344.       * @return string (html)
  345.       *
  346.       */
  347.     function getContent($chaShowMode=0,$debug=False);    
  348.     
  349.     /*** templates ---------------------------------------------------- */
  350.     
  351.     /**
  352.       * returns the template id
  353.       * 
  354.       * if col PTMP_ID is 0 the menu is asked for a template id
  355.       *
  356.       * @param boolean $debug 
  357.       *
  358.       * @return int 
  359.       * @access public
  360.       *
  361.       * @since pk-07-06-07
  362.       */
  363.     public function getTemplateId($debug=False);
  364.  
  365.     /**
  366.      * returns the template object
  367.      *
  368.      * @param boolean $debug 
  369.      * 
  370.      * @return CMS_PAGE_TEMPLATE 
  371.      */
  372.     public function &getTemplate($debug=False);
  373.  
  374.     /**
  375.       * returns an array of chapter template names with chapter template ID as index
  376.       * returns false if the page does not support chapter input
  377.       *
  378.       * @param bool $debug 
  379.       * @param boolean $getAll 
  380.       * 
  381.       * @returns array
  382.       *
  383.       */
  384.     public function getChaTemplates($debug=False,$getAll=False);
  385.         
  386. }
  387.  
  388. ?>

Documentation generated on Thu, 08 Jan 2009 17:44:25 +0100 by phpDocumentor 1.4.0a2