Source for file Document.php
Documentation is available at Document.php
* A Framework for Creating and Using Complex Web Elements
* The purpose of this framework is to provide a library of high-level objects
* to facilitate common HTML coding tasks, such as menus, tables, and forms.
* The intent is to reduce repetitive HTML coding as much as possible, replacing
* it with a combination of configuration files and style sheets with
* standardized naming conventions.
* This framework is built on and requires the
* {@link http://framework.zend.com/ Zend Framework}.
* @author Lyle Frost <lfrost@cnz.com>
* @copyright Copyright (c) 2006-2007 Citadel Network <{@link http://www.citadelnetwork.com/}>
* @license http://www.citadelnetwork.com/license/cnzframework New BSD License
* @version $Id: Document.php 27 2007-07-19 18:47:54Z lfrost $
Zend_Loader::loadClass('Cnz_Html_Element');
* This class creates a <kbd>div</kbd> block to contain the "real" document
* content of the page. This content is included from a separate file,
* defaulting to the file <kbd>document.php</kbd> in the current directory.
* This separation allows the page content to be edited separately from the
* supporting framework (menu, banner, etc.).
* Ideally, this would also be used by search engines. If a standard existed
* for identifying real content from the supporting framework, search engines
* could weight this content more heavily. This would reduce the search noise
* that results when some criteria appear only in the menu, advertising links,
* There are currently no configuration settings for this class, but the section
private $saveIndentLevel = 0;
private $documentFile = self::DEFAULT_DOCUMENT_FILE;
/* Methods ===========================================================*/
* filename Document filename
* @param array $options Options
if (isset ($options['filename'])) $this->documentFile = $options['filename'];
* @param string $style Value for outermost style attribute
public function display($style = NULL)
// This is for compatibility with mod_rewrite.
Cnz_Html::getLogger()->err(__METHOD__ . '[' . __LINE__ . '] ' . ' Error changing directory to ' . $dir . ' from directory ' . $curDir . '.');
echo $indent, '<div class = "', $this->genStyles(), '"';
echo ' id = "', $this->genId(), '"';
if (!empty($style)) echo ' style = "', $style, '"';
echo '<!-- DOCUMENT BEGIN >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->', "\n";
Zend_Loader::loadFile($this->documentFile, $dir);
echo '<!-- DOCUMENT END <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -->', "\n";
Cnz_Html::getLogger()->debug(__METHOD__ . '[' . __LINE__ . '] ' . ' No document file ' . $this->documentFile . ' from directory ' . getcwd() . '.');
// Note: documentFile could have changed $indent.
echo $indent, '</div>', "\n";
// Restore current directory.
Cnz_Html::getLogger()->err(__METHOD__ . '[' . __LINE__ . '] ' . ' Error changing directory to ' . $curDir . ' from directory ' . getcwd() . '.');
|