Beispiel #1
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new S7Ncms();
     }
     return self::$instance;
 }
 function __toString()
 {
     $s7n = S7Ncms::getInstance();
     $tmp = new S7N_Template('default_content');
     $s7n->output = $tmp->parse(array('title' => 'Error', 'content' => $this->getMessage()));
     $s7n->finalize();
     exit;
 }
Beispiel #3
0
 public function __construct()
 {
     $this->s7n = S7Ncms::getInstance();
     $this->db =& $this->s7n->db;
     $this->cfg =& $this->s7n->cfg;
     $this->output =& $this->s7n->output;
     $this->event = $this->s7n->getRequestedEvent();
     $this->user =& $this->s7n->user;
 }
 public function __construct($name)
 {
     $this->s7n = S7Ncms::getInstance();
     if (defined('ADMINISTRATION')) {
         $this->s7n->cfg['s7ncms']['theme'] = 'admin';
     }
     if (preg_match("/^[a-zA-Z_\\/\\-]+\$/", $name)) {
         $path = BASE_PATH . '/templates/' . $this->s7n->cfg['s7ncms']['theme'] . '/html/' . $name . '.html';
         if (file_exists($path)) {
             $this->template = file_get_contents($path);
         } else {
             $this->template = 'Template ' . $name . ' not found.';
         }
     } else {
         $this->template = $name;
     }
 }
Beispiel #5
0
 * All rights reserved.
 * 
 * See license.txt for full text and disclaimer
 * 
 * @author Eduard Baun <*****@*****.**>
 * @copyright Eduard Baun, 2006
 * @version $Id$
 */
ini_set('display_errors', 1);
error_reporting(E_ALL);
$startTime = microtime();
require '../config.php';
require '../lib/abstract/admin.php';
define('ADMINISTRATION', true);
try {
    $s7n = S7Ncms::getInstance();
    if (true or $s7n->user->isAdmin()) {
        $module = $s7n->getRequestedModule();
        if ($module === null) {
            $tpl = new S7N_Template('admin_overview');
            $s7n->output = $tpl->parse();
            //header('Location: '.$s7n->cfg['s7ncms']['scripturl'].$s7n->cfg['s7ncms']['defaultpage']);
            //exit;
        } else {
            $class = $s7n->getRequestedClass();
            $className = 'S7N_Admin_' . ucfirst($module) . '_' . ucfirst($class);
            if ($class == null or ctype_digit($class)) {
                $class = $module;
                $className = 'S7N_Admin_' . ucfirst($module);
            }
            $path = BASE_PATH . '/admin/modules/' . $module . '/' . $class . '.php';