Пример #1
0
 function login_form($message = "")
 {
     $tpl = new template("templates/");
     $tpl->load("login.html");
     $tpl->set_block("form");
     $tpl->set_variable("AppTitle", traducir_cadena("AppTitle"));
     $tpl->set_variable("AdminModule", traducir_cadena("AdminModule"));
     $tpl->set_variable("Institute", traducir_cadena("Institute"));
     $tpl->set_variable("WelcomeAdmin", traducir_cadena("WelcomeAdmin"));
     $tpl->set_variable("message", traducir_cadena($message));
     $tpl->set_variable("user", traducir_cadena("user"));
     $tpl->set_variable("password", traducir_cadena("password"));
     $tpl->parse_block("form");
     return $tpl->get();
 }
Пример #2
0
function ModificarExtrasTemplate($id, $comentario, $paginas)
{
    $oTemplate = new template();
    if (!$oTemplate->Load($id)) {
        error(__FILE__ . __LINE__, "W: no pudo mostrareditar '{$id}'");
        return false;
    }
    $nombreoriginal = $oTemplate->get("Nombre");
    $oTemplate->set("Comentario", $comentario, FORCE);
    $oTemplate->set("Paginas", $paginas, FORCE);
    if ($oTemplate->Save()) {
        if (isVerbose()) {
            echo gas("aviso", _("Datos extra cambiados"));
        }
        $_SESSION["Template_{$nombreoriginal}"] = false;
        //invalida copia de sesion de template
    } else {
        echo gas("problema", _("No se puede cambiar dato"));
    }
}
Пример #3
0
 function login_form($message = "", $clave_examen = "")
 {
     $tpl = new template("templates/");
     $tpl->load("form.html");
     $tpl->set_block("form");
     $tpl->set_variable("AppTitle", traducir_cadena("AppTitle"));
     $tpl->set_variable("ExamModule", traducir_cadena("ExamModule"));
     $tpl->set_variable("Institute", traducir_cadena("Institute"));
     $tpl->set_variable("WelcomeExam", traducir_cadena("WelcomeExam"));
     $tpl->set_variable("Instructions", traducir_cadena("Instructions"));
     $tpl->set_variable("message", $message);
     $tpl->set_variable("txtsessionid", traducir_cadena("txtsessionid"));
     $sessionid = rand();
     $tpl->set_variable("randval", $sessionid);
     $tpl->set_variable("txtstudentid", traducir_cadena("txtstudentid"));
     $tpl->set_variable("txtidexamen", $clave_examen);
     $tpl->set_variable("txtquestionpaperid", traducir_cadena("txtquestionpaperid"));
     $tpl->set_variable("txtsubmit", traducir_cadena("txtsubmit"));
     $tpl->set_variable("txtreset", traducir_cadena("txtreset"));
     $tpl->set_variable("password", traducir_cadena("password"));
     $tpl->parse_block("form");
     return $tpl->get();
 }
Пример #4
0
	function makeElementView($value) {
		GLOBAL $parser;
		$this->init(&$parser,$value);
		
		$file_size = (file_exists($this->full_name))?formatFileSize(filesize($this->full_name)):'';
		$file_link = HTTP_ROOT.FILE_PATH.$this->file['path'].$this->id.'_'.$this->original_name;
		
		if ($file_size!='') {
			$tpl = new template(TPL_PATH);
			$tpl_name=$parser->getSystemTemplate('type/file');
			$tpl->loadTemplatefile($tpl_name,true,true);
			$tpl->parseVariable(array(
				'file_name'	=> $this->original_name,
				'id'		=> $this->id,
				'link'		=> $file_link,
				'size'		=> $file_size,
				'data_name'	=> $this->file_name		
			),'view');
			$view = $tpl->get();
		}
		
		if ($parser->buffer=='dynamic_view') {
			if (file_exists($this->full_name)) {
				return $view;
			} else {
				return ' ';	
			}
		}		
		
		$to_parse='FILE_'.strtoupper($this->file_name);
		
		$return[$to_parse] = $file_link;
		$return[$to_parse.'_NAME'] = $this->original_name;
		$return[$to_parse.'_SRC'] = $file_link;
		$return[$to_parse.'_SIZE'] = $file_size;
		$return[$this->field_name] = $view;
		return $return;
	}
Пример #5
0
$table->addRow()->addCell(lang::get('php_version'))->addCell(phpversion());
$table->addRow()->addCell(lang::get('mysql_version'))->addCell($sql->get('VERSION()'));
echo $table->show();
?>
        </div>
    </div>
    
    <div class="col-lg-4">
        <div class="panel panel-default">
            <div class="panel-heading">
            	<h3 class="panel-title"><?php 
echo lang::get('template');
?>
</h3>
            </div>
			<?php 
$template = new template(dyn::get('template'));
$table = table::factory(['class' => ['table', 'table-spriped', 'table-hover']]);
$table->addSection('tbody');
$table->addRow()->addCell(lang::get('name'))->addCell($template->get('name'));
$table->addRow()->addCell(lang::get('author'))->addCell($template->get('author'));
$table->addRow()->addCell(lang::get('version'))->addCell($template->get('version'));
$table->addRow()->addCell('<a href="' . $template->get('supportlink') . '" class="btn btn-sm btn-default btn-block" target="_blank">' . lang::get('support_visit') . '</a>', ['colspan' => 2]);
echo $table->show();
?>
        </div>
    </div>
        
    <div class="clearfix"></div>

</div>
Пример #6
0
 /**
  * make cp menu1
  *
  * @param array $menu
  * @return void
  */
 function calendar($script, $year, $month, $day)
 {
     $tpl = new template(TPL_PATH);
     $tpl->loadTemplatefile('def/calendar', true, true);
     $tpl->setVariable(array('SCRIPT' => $script, 'YEAR' => $year, 'MONTH' => $month - 1, 'DAY' => $day));
     $tpl->parseCurrentBlock();
     return $tpl->get();
 }
Пример #7
0
	function __makeListboxViewElement($list,$value) {
		GLOBAL $parser;
		
		$tpl = new template(TPL_PATH);
		$tpl->loadTemplateFile($parser->getSystemTemplate('type/listbox'));
		
		if (isset($list) and is_array($list)) {
				$values = preg_split("/[<>]/", $value, -1, PREG_SPLIT_NO_EMPTY);
				foreach ($values as $key => $value) {
					$values[$key] = $list[$value];
				}
				if (empty($values)) {
					$tpl->touchBlock('view_empty');
				}
				else {
					$cnt = 0;
					foreach ($list as $name) {
						$cnt++;
						if (in_array($name, $values)) {
							$tpl->setCurrentBlock('yes');
							$tpl->setVariable(array(
								'YES'	=> ''
							));
						} else {
							$tpl->setCurrentBlock('no');
							$tpl->setVariable('NO', '');
							
						}
						$tpl->setVariable(array(
							'NAME'	=> $name
						));
						$tpl->parseCurrentBlock();
							
						if ($cnt != count($list)) $tpl->touchBlock('view_separator');

						$tpl->setCurrentBlock('view_row');
						$tpl->setVariable(array(
							'ROW'	=> $name
						));
						$tpl->parseCurrentBlock();
					}
					$tpl->setCurrentBlock('view');
					$tpl->parseCurrentBlock();
				}
			}
		return trim($tpl->get());
	}
Пример #8
0
<DOCTYPE html>
<html>
  <head>
  </head>
  <body>
  
    
    <pre>
<?php 
echo template::get('status');
?>
<BR/>
<?php 
//$this->createField();
echo template::get('matrix');
?>

    </pre>
    
    <form name="input" action="?start/setShoot" method="post">
      Enter coordinates (row, col), e.g. A5 <input size="5" name="coord" autocomplete="off" autofocus="" type="input">
      <input type="submit"> <a href="?start/newGame">Restart</a>
    </form>


  <body>
<html>
Пример #9
0
 function getRaw($vars = array())
 {
     if (!$this->is) {
         trigger_error('Seite existiert nicht!');
         return;
     }
     $modPath = sysPATH . $this->vs['module'] . '/';
     // dont use the getter;
     $Cont = $this;
     $res = is_file($modPath . 'control.php') ? include $modPath . 'control.php' : null;
     if (is_file($modPath . 'index.php')) {
         $T = new template($res);
         $T->assign('vars', $vars);
         $T->assign('Cont', $this);
         $str = $T->get($modPath . 'index.php');
         qg::fire('cms::parseTemplate', array('Cont' => $Cont, 'string' => &$str));
     } else {
         $str = '<div>' . ($this->edit ? L('Das Modul ist nicht existiert nicht!') : '') . '</div>';
     }
     is_file($modPath . 'pub/main.js') && html::addJsFile($this->modUrl . 'pub/main.js');
     is_file($modPath . 'pub/main.css') && html::addCSSFile($this->modUrl . 'pub/main.css');
     return $str;
 }
Пример #10
0
     } else {
         header("content-type: image/jpeg");
         imageJpeg($im, NULL, 90);
     }
     exit;
     break;
     if (me() <= 0 || getS('user', 'u_email') != ownStaGramAdmin) {
         jump2();
     }
     if (isset($_POST["saveuser"]) && $_POST["saveuser"] == 1) {
         $own->setUserData(-1, $_POST['FORM']);
         header("location: index.php?action=users");
         exit;
     }
     $tplContent->setVariable("view", "edit");
     $html = $tplContent->get('tpl.users.php');
     break;
 case 'users':
     if (me() <= 0 || getS('user', 'u_email') != ownStaGramAdmin) {
         jump2();
     }
     if (isset($_GET['id']) && (int) $_GET["id"] > 0) {
         if (isset($_POST["saveuser"]) && $_POST["saveuser"] == 1) {
             $own->setUserData((int) $_GET["id"], $_POST['FORM']);
             header("location: index.php?action=users");
             exit;
         }
         $edit = $own->getUserData((int) $_GET["id"]);
         $tplContent->setVariable("view", "edit");
         $tplContent->setVariable($edit);
     } else {
Пример #11
0
 function includeTpl($tplName, $data = array(), $modul = NULL)
 {
     if ($modul == NULL) {
         $modul = $this->modulName;
     }
     $tpl = new template();
     $tpl->modulName = $modul;
     foreach ($data as $key => $value) {
         $tpl->setVariable($key, $value);
     }
     return $tpl->get($tplName);
 }
Пример #12
0
<?php

namespace qg;

qg::on('action', function () {
    if (!isset($_GET['file']) || strpos(appRequestUri, 'editor') !== 0) {
        return;
    }
    $file = urldecode($_GET['file']);
    if (!isset($_SESSION['fileEditor']['allow'][$file]) && !Usr()->superuser) {
        echo 'no access';
        exit;
    }
    !is_dir(dirname($file)) && mkdir(dirname($file));
    !is_file($file) && touch($file);
    if ($ask = G()->ASK) {
        $done = 0;
        if (isset($ask['save']) && is_file($file)) {
            copy($file, appPATH . 'cache/tmp/pri/fileEditorBackup_' . urlencode($file) . '_' . date('dmYhi'));
            if (file_put_contents($file, $ask['save']) && is_writable($file)) {
                $done = 1;
            }
        }
        Answer($done);
    }
    /* neu */
    $T = new template(array('file' => $file));
    echo $T->get(sysPATH . 'fileEditor/view/codemirror.php');
    exit;
});
Пример #13
0
 function __destruct()
 {
     $str = ob_get_clean();
     if ($this->template) {
         $tpl = new template();
         $tpl->assign('content', $str);
         $str = $tpl->get($this->template);
     }
     qg_flush($str);
 }
Пример #14
0
 function getRaw($vars = array())
 {
     if (!$this->is) {
         trigger_error('Seite existiert nicht!');
         return;
     }
     $Cont = $this;
     $res = is_file($this->modPath . 'control.php') ? include $this->modPath . 'control.php' : null;
     if (is_file($this->modPath . 'index.php')) {
         $T = new template($res);
         $T->assign('vars', $vars);
         $T->assign('Cont', $this);
         $str = $T->get($this->modPath . 'index.php');
     } else {
         $str = '<div>' . ($Cont->edit ? L('Das Modul ist nicht existiert nicht!') : '') . '</div>';
     }
     if (is_file($this->modPath . 'pub/main.js')) {
         html::addJsFile($this->modUrl . 'pub/main.js');
     }
     if (is_file($this->modPath . 'pub/main.css')) {
         html::addCSSFile($this->modUrl . 'pub/main.css');
     }
     return $str;
 }
Пример #15
0
 /**
  * @return string
  * @desc make paging
  */
 function makePaging()
 {
     global $app;
     // check paging
     if ($app->paging === false) {
         return '';
     }
     $tpl = new template(TPL_PATH);
     if (!isset($app->paging['template'])) {
         $tpl_name = $this->getSystemTemplate('paging' . $app->paging['type']);
     } else {
         $tpl_name = $app->paging['template'];
     }
     $tpl->loadTemplatefile($tpl_name);
     //$app->load('paging1','inc');
     include SYS_ROOT . INIT_PATH . INC_PATH . 'paging' . $app->paging['type'] . '.inc.php';
     return $tpl->get();
     $app->clearPaging();
 }
Пример #16
0
 static function render()
 {
     $Page = self::PageFromRequest();
     if (!$Page->is()) {
         // search for redirect
         if ($redirect = D()->one("SELECT redirect FROM page_redirect WHERE request = " . D()->quote(appRequestUri))) {
             if (is_numeric($redirect)) {
                 $url = $_SERVER['SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . Page($redirect)->url();
             } else {
                 $url = $redirect;
             }
             header('HTTP/1.1 301');
             // better 302 (temporary) ?
             header('Location: ' . $url);
             exit;
         }
         // not found
         header("HTTP/1.1 404 Not Found");
         $Page = Page(G()->SET['cms']['pageNotFound']->v);
     }
     self::$MainPage = self::$RequestedPage = $Page;
     if (!self::$MainPage->access()) {
         // no access
         header("HTTP/1.1 401 Unauthorized");
         self::$MainPage = Page(G()->SET['cms']['pageNoAccess']->v);
     }
     if (!self::$MainPage->isReadable()) {
         // offline
         header("HTTP/1.1 401 Unauthorized");
         self::$MainPage = Page(G()->SET['cms']['pageOffline']->v);
     }
     qg::fire('deliverHtml');
     // deprecated
     //qg::fire('cms::render-before'); // todo
     html::$content .= self::$MainPage->get();
     self::$MainPage->access() > 1 && html::addBodyFile(sysPATH . 'cms/view/frontend.php');
     qg::fire('cms-ready');
     // deprecated
     $tpl = new template();
     echo $tpl->get(appPATH . 'qg/html-template.php');
     //qg::fire('cms::render-after'); // todo
 }
Пример #17
0
     $Codigo = trim($_POST["Codigo"]);
     /*
     		//$Codigo = str_replace('\\"', '"',$Codigo);		
     		//$Codigo = str_replace("\\'", "'",$Codigo );
     		//$Codigo = str_replace("\\\\n", "\\n",$Codigo );
     		//$Codigo = str_replace("\\\\t", "\\t",$Codigo );
     		$Codigo = str_replace("\\\\", "\\",$Codigo );
     		$Codigo = str_replace("\\", "",$Codigo );		
     		
     		//str_replace("\\\'", "\\'",$Codigo )*/
     $Codigo = stripslashes($Codigo);
     error(0, "Info: llega del navegador '{$Codigo}'");
     if ($id and $Codigo) {
         if ($ot->Load($id)) {
             error(0, "Info: text:'" . $Codigo . "'");
             $oldnombre = $ot->get("Nombre");
             $ot->set("Nombre", $Nombre, FORCE);
             $ot->setCodigo($Codigo);
             $idTemplate = $id;
             $code = $Codigo;
             $ot->Save();
             $_SESSION["Template_{$oldnombre}"] = false;
         }
     }
     break;
 default:
     $id = $_GET["id"];
     if ($id) {
         if ($ot->Load($id)) {
             $code = $ot->getCodigo();
             $Nombre = $ot->getNombre();