コード例 #1
0
 function header($vars = array())
 {
     $rubr_enc = $this->system->path_encode($this->system->rubrik);
     if (RheinaufFile::is_file(DOCUMENT_ROOT . INSTALL_PATH . '/CSS/' . $rubr_enc . '.css')) {
         $vars['other_css'] .= '<link rel="stylesheet" href="/' . INSTALL_PATH . '/CSS/' . rawurlencode($rubr_enc) . '.css" media="screen" type="text/css" />';
     }
     return $this->template->parse_template('HEADER', $vars);
 }
コード例 #2
0
	function Template($template)
	{
		if (@RheinaufFile::is_file($template)) $this->template = RheinaufFile::get_file($template);
		else $this->template = $template;
		if (@RheinaufFile::is_file($snippet_pfad = INSTALL_PATH.'/Templates/Snippets.html'))
		{
			$this->snippets = $this->get_all_parts(file_get_contents($snippet_pfad));
		}
	}
コード例 #3
0
 function header($vars = array())
 {
     $rubr_enc = $this->system->path_encode($this->system->rubrik);
     $seite_enc = $this->system->path_encode($this->system->seite);
     if (RheinaufFile::is_file(DOCUMENT_ROOT . INSTALL_PATH . "/CSS/{$rubr_enc}/{$seite_enc}.css")) {
         $vars['other_css'] .= '<link rel="stylesheet" href="' . "/CSS/{$rubr_enc}/{$seite_enc}.css" . '" media="screen" type="text/css" />';
     } else {
         if (RheinaufFile::is_file(DOCUMENT_ROOT . INSTALL_PATH . "/CSS/{$rubr_enc}.css")) {
             $vars['other_css'] .= '<link rel="stylesheet" href="' . "/CSS/{$rubr_enc}.css" . '" media="screen" type="text/css" />';
         }
     }
     return $this->template->parse_template('HEADER', $vars);
 }
コード例 #4
0
 function content_module($title, $module)
 {
     $vars['title'] = $title;
     $vars['navi'] = $this->navi_menu();
     if (preg_match('/(.*?)\\((.*?)\\)/', $module, $match)) {
         $module = $match[1];
         $args = $match[2];
     }
     if (!class_exists($module)) {
         include_once $module . '.php';
     }
     if (is_callable(array($module, 'class_init'))) {
         eval('$instance = new $module (' . $args . ');');
         $instance->class_init($this);
     } else {
         $instance = new $module($this);
     }
     if ($module != 'Login' && $this->require_valid_user) {
         // hier nochmal checken, falls Modul eine eigene User-Tabelle mitbringt
         if ($this->custom_user_table) {
             Login::check_login($this);
         }
         if (!$this->valid_user) {
             return;
         }
     }
     $instance_show = $instance->show();
     $vars['other_css'] = $this->other_css;
     if (isset($instance->other_css)) {
         $vars['other_css'] .= $instance->other_css;
     }
     if (isset($GLOBALS['other_css'])) {
         $vars['other_css'] .= $GLOBALS['other_css'];
     }
     $vars['scripts'] = $this->scripts;
     if (isset($instance->scripts)) {
         $vars['scripts'] .= $instance->scripts;
     }
     //deprecated
     if (isset($GLOBALS['scripts'])) {
         $vars['scripts'] .= $GLOBALS['scripts'];
     }
     // half deprecated
     if (isset($_GET['noframe']) || $this->noframe) {
         if (isset($instance->extern)) {
             $GLOBALS['INCLUDE_EXTERN'] = $instance->extern;
             return;
         }
         return $instance_show;
     }
     if (RheinaufFile::is_file(DOCUMENT_ROOT . INSTALL_PATH . '/Templates/' . $modul . '/template.html')) {
         $page = new Seite($this, DOCUMENT_ROOT . INSTALL_PATH . '/Templates/' . $modul . '/template.html');
     } else {
         $page = new Seite($this, $this->template ? $this->template : 'default');
     }
     if (isset($instance->extern)) {
         $GLOBALS['HEADER'] = $page->header($vars);
         $GLOBALS['FOOTER'] = $page->footer($vars);
         $GLOBALS['INCLUDE_EXTERN'] = $instance->extern;
         return;
     }
     $header = $page->header($vars);
     //	if ($modul!='Admin')
     //	{
     $content = new Template($instance_show);
     $content->system =& $this;
     $content->init_snippets();
     $content = $content->parse_template('', $vars);
     //	}
     //	else $content = $instance_show;
     $footer = $page->footer($vars);
     return $header . $content . $footer;
 }
コード例 #5
0
 function dir_tree($dir, $durl = '', $include = '', $exclude = '', $dirinclude = '', $direxclude = '')
 {
     static $seen = array();
     $files = array();
     $dir = realpath($dir);
     if (isset($seen[$dir])) {
         return $files;
     }
     $seen[$dir] = TRUE;
     $dh = @opendir($dir);
     while ($dh && ($file = readdir($dh))) {
         if ($file !== '.' && $file !== '..') {
             $path = realpath($dir . '/' . $file);
             $url = $durl . '/' . $file;
             if ($dirinclude && !preg_match($dirinclude, $url) || $direxclude && preg_match($direxclude, $url)) {
                 continue;
             }
             if (RheinaufFile::is_dir($path)) {
                 if ($subdir = RheinaufFile::dir_tree($path, $url)) {
                     $files[] = array('url' => $url, 'children' => $subdir);
                 }
             } elseif (RheinaufFile::is_file($path)) {
                 if ($include && !preg_match($include, $url) || $exclude && preg_match($exclude, $url)) {
                     continue;
                 }
                 $files[] = array('url' => $url);
             }
         }
     }
     @closedir($dh);
     return RheinaufFile::dirsort($files);
 }
コード例 #6
0
 function uninstall($module)
 {
     if (RheinaufFile::is_file(INSTALL_PATH . '/Module/' . $module . '/Install.php')) {
         include_once INSTALL_PATH . '/Module/' . $module . '/Install.php';
         $module .= 'Install';
     } else {
         include_once $module . '.php';
     }
     $class = new $module();
     if (method_exists($class, 'uninstall')) {
         $this->return .= $class->uninstall($this);
     }
 }
コード例 #7
0
 function golive()
 {
     $rubrik = $this->path_encode($this->navi[$_GET['edit']]['Rubrik']);
     $seite = $this->path_encode($this->navi[$_GET['edit']]['Subnavi'][$_GET['edit_page']]['Seite']);
     $folder = INSTALL_PATH . "/Content/{$rubrik}/{$seite}/";
     if (RheinaufFile::is_file($folder . 'Arbeitsversion/content.html')) {
         RheinaufFile::copy($folder . 'Arbeitsversion/content.html', $folder . 'content.html');
     }
 }
コード例 #8
0
 function new_page_create()
 {
     $navi_id = $_GET['edit'];
     $rubrik_id = $this->navi[$navi_id]['id'];
     $rubrik_name = $this->navi[$navi_id]['Rubrik'];
     $new_name = General::input_clean($_POST['new_name'], true);
     $Show = isset($_POST['Show']) ? $_POST['Show'] : '0';
     $new_id = count($this->navi[$navi_id]['Subnavi']);
     $new_subnavi = array();
     $new_subnavi['ext_link'] = $this->path_adjust($_POST['ext_link']);
     $new_subnavi['Seite'] = $new_name;
     $new_subnavi['Show'] = $Show;
     $new_subnavi['Show_to'] = $this->input_group_array();
     $this->navi[$navi_id]['Subnavi'][] = $new_subnavi;
     $this->make_the_new_navi();
     $name_encoded = $this->path_encode($this->I18n_get_real($new_name));
     $rubrik_name = $this->path_encode($this->I18n_get_real($rubrik_name));
     if (!RheinaufFile::is_dir(DOCUMENT_ROOT . $install_path . '/Content/' . $rubrik_name . '/' . $name_encoded)) {
         RheinaufFile::mkdir(INSTALL_PATH . "/Content/{$rubrik_name}/{$name_encoded}");
         RheinaufFile::chmod(INSTALL_PATH . "/Content/{$rubrik_name}/{$name_encoded}", 777);
     }
     $new_content_file = DOCUMENT_ROOT . $this->install_path . '/Content/' . $rubrik_name . '/' . $name_encoded . '/content.html';
     if (!RheinaufFile::is_file($new_content_file)) {
         RheinaufFile::write_file($new_content_file, ' ');
     }
     $this->htaccess_update();
 }
コード例 #9
0
	function Template($template)
	{
		if (@RheinaufFile::is_file($template)) $this->template = RheinaufFile::get_file($template);
		else $this->template = $template;
	}
コード例 #10
0
 function page_edit()
 {
     $navi_id = $_GET['edit'];
     $page_id = $_POST['page_id'];
     $new_name = General::input_clean($_POST['name'], true);
     $this->navi[$navi_id]['Subnavi'][$page_id]['Seite'] = $new_name;
     $this->navi[$navi_id]['Subnavi'][$page_id]['Show'] = isset($_POST['Show']) ? $_POST['Show'] : '0';
     $this->navi[$navi_id]['Subnavi'][$page_id]['Show_to'] = $this->input_group_array();
     $this->navi[$navi_id]['Subnavi'][$page_id]['ext_link'] = $_POST['ext_link'];
     $this->navi[$navi_id]['Subnavi'][$page_id]['Modul'] = $_POST['module'];
     $oldname = $this->I18n_get_real(General::input_clean($_POST['oldname']));
     $oldname_encoded = $this->path_encode($oldname);
     $name_encoded = $this->path_encode($this->I18n_get_real($new_name));
     $rubrik_name = $this->path_encode($this->I18n_get_real($this->navi[$navi_id]['Rubrik']));
     $path = DOCUMENT_ROOT . INSTALL_PATH . '/Content/' . $rubrik_name . '/';
     RheinaufFile::rename($path . $oldname_encoded, $path . $name_encoded);
     if (RheinaufFile::is_file(INSTALL_PATH . "/Templates/{$rubrik_name}/{$oldname_encoded}/template.html")) {
         RheinaufFile::rename(INSTALL_PATH . "/Templates/{$rubrik_name}/{$oldname_encoded}/template.html", INSTALL_PATH . "/Templates/{$rubrik_name}/{$name_encoded}/template.html");
     }
     if (RheinaufFile::is_file(INSTALL_PATH . "/CSS/{$rubrik_name}/{$oldname_encoded}.css")) {
         RheinaufFile::rename(INSTALL_PATH . "/CSS/{$rubrik_name}/{$oldname_encoded}.css", INSTALL_PATH . "/CSS/{$rubrik_name}/{$name_encoded}.css");
     }
     $this->make_the_new_navi();
     $this->htaccess_update();
 }