Permalink
Browse files

Rename content pages to html.

Use file_get_contents() for html pages.
  • Loading branch information...
1 parent dccbe4e commit bc5d4ff8dafb5b11ed117f43aca01032367aee3d @haraldpdl committed Feb 24, 2012
@@ -18,7 +18,7 @@ public static function execute(ApplicationAbstract $application) {
if ( isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch']) ) {
$OSCOM_Template = Registry::get('Template');
- $application->setPageContent('entries_batch_edit.php');
+ $application->setPageContent('entries_batch_edit.html');
$cfg_input_fields = array();
@@ -18,7 +18,7 @@ class EntrySave {
public static function execute(ApplicationAbstract $application) {
$OSCOM_Template = Registry::get('Template');
- $application->setPageContent('entries_edit.php');
+ $application->setPageContent('entries_edit.html');
$OSCOM_ObjectInfo = new ObjectInfo(Configuration::getEntry($_GET['pID']));
@@ -15,6 +15,7 @@ class Controller extends \osCommerce\OM\Core\Site\Admin\ApplicationAbstract {
protected $_group = 'configuration';
protected $_icon = 'configuration.png';
protected $_sort_order = 200;
+ protected $_page_contents = 'main.html'; // HPDL (html should be the default)
protected function initialize() {
$this->_title = OSCOM::getDef('app_title');
@@ -26,7 +27,7 @@ protected function process() {
$this->_page_title = OSCOM::getDef('heading_title');
if ( isset($_GET['id']) && is_numeric($_GET['id']) ) {
- $this->_page_contents = 'entries.php';
+ $this->_page_contents = 'entries.html';
$this->_page_title .= ': ' . Configuration::get($_GET['id'], 'configuration_group_title');
$OSCOM_Template->setValue('group_id', $_GET['id']);
@@ -14,6 +14,7 @@
class Controller extends \osCommerce\OM\Core\Site\Admin\ApplicationAbstract {
protected $_link_to = false;
protected $_icon = 'login.png';
+ protected $_page_contents = 'main.html'; // HPDL (html should be the default)
protected function initialize() {}
@@ -101,7 +101,13 @@
echo Registry::get('MessageStack')->get('header');
}
- require($OSCOM_Template->getPageContentsFile());
+// HPDL use only file_get_contents() when content pages no longer contain PHP
+ $page_contents_file = $OSCOM_Template->getPageContentsFile();
+ if ( substr($page_contents_file, strrpos($page_contents_file, '.')+1) == 'html' ) {
+ echo file_get_contents($OSCOM_Template->getPageContentsFile());
+ } else {
+ include($OSCOM_Template->getPageContentsFile());
+ }
?>
</div>

0 comments on commit bc5d4ff

Please sign in to comment.