/** * @param array An array of additional files to include from the root folder * @return object */ function &createTemplate($files = null) { global $mainframe; $tmpl = new patTemplate(); // patTemplate if ($GLOBALS['mosConfig_caching']) { $tmpl->useTemplateCache('File', array('cacheFolder' => $GLOBALS['mosConfig_cachepath'], 'lifetime' => 20)); } $tmpl->setNamespace('mos'); // load the wrapper and common templates $tmpl->setRoot(dirname(__FILE__) . '/tmpl'); $tmpl->readTemplatesFromFile('page.html'); $tmpl->applyInputFilter('ShortModifiers'); if (is_array($files)) { foreach ($files as $file) { $tmpl->readTemplatesFromInput($file); } } //echo $this->basePath() . '/components/' . $option . '/tmpl'; $tmpl->addGlobalVar('option', $GLOBALS['option']); $tmpl->addGlobalVar('self', $_SERVER['PHP_SELF']); $tmpl->addGlobalVar('itemid', $GLOBALS['Itemid']); $tmpl->addGlobalVar('siteurl', $GLOBALS['mosConfig_live_site']); $tmpl->addGlobalVar('adminurl', $GLOBALS['mosConfig_live_site'] . '/administrator'); $tmpl->addGlobalVar('templateurl', $GLOBALS['mosConfig_live_site'] . '/templates/' . $mainframe->getTemplate()); $tmpl->addGlobalVar('admintemplateurl', $GLOBALS['mosConfig_live_site'] . '/administrator/templates/' . $mainframe->getTemplate()); $tmpl->addGlobalVar('sitename', $GLOBALS['mosConfig_sitename']); $tmpl->addGlobalVar('treecss', 'dtree.css'); $tmpl->addGlobalVar('treeimgfolder', 'img'); $iso = split('=', _ISO); $tmpl->addGlobalVar('page_encoding', $iso[1]); $tmpl->addGlobalVar('version_copyright', $GLOBALS['_VERSION']->COPYRIGHT); $tmpl->addGlobalVar('version_url', $GLOBALS['_VERSION']->URL); $tmpl->addVar('form', 'formAction', $_SERVER['PHP_SELF']); $tmpl->addVar('form', 'formName', 'adminForm'); // tabs $turl = $GLOBALS['mosConfig_live_site'] . '/includes/js/tabs/'; $tmpl->addVar('includeTabs', 'taburl', $turl); return $tmpl; }
case 'view': $fbMenu = KUNENA_get_menu(NULL, $fbConfig, $fbIcons, $my_id, 3, $view, $catid, $id, $thread); break; case 'showcat': //get number of pending messages $kunena_db->setQuery("SELECT COUNT(*) FROM #__fb_messages WHERE catid='{$catid}' AND hold='1'"); $numPending = $kunena_db->loadResult(); check_dberror('Unable load pending messages.'); $fbMenu = KUNENA_get_menu(NULL, $fbConfig, $fbIcons, $my_id, 2, $view, $catid, $id, $thread, $is_Moderator, $numPending); break; default: $fbMenu = KUNENA_get_menu(NULL, $fbConfig, $fbIcons, $my_id, 1, $view); break; } // display header $KunenaTemplate->addVar('kunena-header', 'menu', $fbMenu); $KunenaTemplate->addVar('kunena-header', 'board_title', stripslashes($board_title)); if (file_exists(KUNENA_JTEMPLATEPATH . '/css/kunena.forum.css')) { $KunenaTemplate->addVar('kunena-header', 'css_path', KUNENA_JTEMPLATEURL . '/template/' . $fbConfig->template . '/kunena.forum.css'); } else { $KunenaTemplate->addVar('kunena-header', 'css_path', KUNENA_DIRECTURL . '/template/' . $fbConfig->template . '/kunena.forum.css'); } $KunenaTemplate->addVar('kunena-header', 'offline_message', stripslashes($fbConfig->board_offline) ? '<span id="fbOffline">' . _FORUM_IS_OFFLINE . '</span>' : ''); $KunenaTemplate->addVar('kunena-header', 'searchbox', getSearchBox()); $KunenaTemplate->addVar('kunena-header', 'pb_imgswitchurl', KUNENA_URLIMAGESPATH . "shrink.gif"); $KunenaTemplate->displayParsedTemplate('kunena-header'); //BEGIN: PROFILEBOX if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/profilebox/profilebox.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/profilebox/profilebox.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/profilebox/profilebox.php';
else{ // Erststart $query1="select * from archiv where user_id_kontrolle=0"; } $antwort1=$db->query($query1); $anzahl=$db->affected_rows(); $antwort1=array_bildung($antwort1); if($anzahl>0){ $antwort1[datum]=zeit_anpassung($antwort1[datum]); $antwort1[user_id_kontrolle]=status_anpassung($antwort1[user_id_kontrolle]); // $antwort1[id]=user_wandel($antwort1[id],$db); $tmpl->setAttribute('liste','visibility','visibility'); $tmpl->addVars('inhalt',$antwort1); } else{ $tmpl->addVar('gesamt','INFO','keie Datensätze vorhanden !'); } $query1 ="select id,Name,Vorname from user order by Name,Vorname"; // eintragen der aktiven User $antwort=$db->query($query1); $antwort=array_bildung($antwort); $tmpl->addVars('name',$antwort); //$tmpl->dump(); $tmpl->displayParsedTemplate(); $db->close(); gz_output(); ?>
$query3="select Rechte_Art,Modul,Formular from rechte where id='$ausgabe[$i]'"; // Zuordnung 'Rechte-Name' zu 'rechte-id' $abfrage3=$db->query($query3); while($wert=$abfrage3->fetch_array(patDBC_TYPEASSOC)){ // Abrufen eines Datensatzes if($wert[Formular]=='kein'){ $ausgabe1[Modul][$i]=$wert[Modul]; $ausgabe1[Rechte_Art][$i]=$wert[Rechte_Art]; $i++; } else{ $ausgabe2[USER_ID][$j]=$zugang[id]; $ausgabe2[Formular][$j]=$wert[Formular]; $ausgabe2[Name_Formular][$j]=$wert[Rechte_Art]; $j++; } } } } $tmpl->setAttribute('person','visibility','visibility'); $tmpl->setAttribute('navi','visibility','visibility'); $tmpl->addVars('navi',$ausgabe1); $tmpl->setAttribute('formulare','visibility','visibility'); $tmpl->addVars('formulare',$ausgabe2); $tmpl->addVar('person','PERSON_ID',$zugang[id]); $tmpl->setAttribute('logout','visibility','visibility'); } $db->close(); $tmpl->displayParsedTemplate(); gz_output(); ?>
$farbe=$kontrolle->farb_ausgabe(); // Ausgabe des Fehler - Farbenarray $fehler=$kontrolle->zaehler_ausgabe(); // Ausgabe der Fehlerzahl 1= Fehler , 0 = O.K. if($fehler==0){ $query1="insert into user (Name,Vorname,Passwort,Benutzername) values('$HTTP_POST_VARS[NAME]','$HTTP_POST_VARS[VORNAME]','$HTTP_POST_VARS[PASSWORT]','$HTTP_POST_VARS[BENUTZERNAME]')"; $abfrage1=$db->query($query1); $letzte_id=$db->insert_id(); $query2="insert into adresse (user_id) values('$letzte_id')"; $abfrage2=$db->query($query2); $db->close(); } else{ $tmpl = new patTemplate(); $tmpl->setBasedir(T_ANLEGEN); $tmpl->readTemplatesFromFile('anlegen.ihtml'); $tmpl->addVars('haupt',$farbe); $tmpl->addVars('haupt',$HTTP_POST_VARS); $tmpl->addVar('haupt','ANZEIGE','test'); $tmpl->displayParsedTemplate(); } } if(!$anlegen){ $tmpl = new patTemplate(); $tmpl->setBasedir(T_ANLEGEN); $tmpl->readTemplatesFromFile('anlegen.ihtml'); $tmpl->addVar('haupt','ANZEIGE','test'); $tmpl->displayParsedTemplate(); } ?>
$timezone = 'Europe/Berlin'; putenv('TZ=$timezone'); setlocale(LC_CTYPE, 'de'); //color config $rowcolordark = '#003366'; $rowcolorlight = '#004070'; $rowcolor = $rowcolorlight; $headercolor = $rowcolordark; $cellpad = '"1"'; $cellspc = '"3"'; //template config require_once "patTemplate.php"; $design = new patTemplate(); $design->setBasedir('./templates'); $design->readTemplatesFromFile('basic.xml'); $design->addVar("basic", "LANG_USERSONLINE", $lang['usersonline']); $design->addVar("basic", "LANG_QUICKSEARCH", $lang['quicksearch']); $design->addVar("basic", "LANG_EXTENDEDSEARCH", $lang['extendedsearch']); $design->addVar("basic", "LANG_ARTISTBROWSE", $lang['artistbrowser']); $design->addVar("basic", "LANG_ADDLYRICS", $lang['addlyrics']); $design->addVar("basic", "LANG_PREFERENCES", $lang['preferences']); $design->addVar("basic", "LANG_STAFF", $lang['staff']); $design->addVar("basic", "LANG_STATISTICS", $lang['statistics']); $db = new db_local(); $db_user = new db_local(); $db_user->query("SELECT id FROM catusers WHERE name = '{$_COOKIE['user']}' AND pass = '******'pass']}'"); if ($db_user->num_rows() == 0) { $user_id = 0; } else { $db_user->next_record(); $user_id = $db_user->record['id'];
$anfrage1=$db->query($query1); // loeschen der alten Rechte rechte_anlegen($db,$aendern_hidden,$rechte_check); // eintragen der neuen User - Rechte } /*********** Anzeige Personendaten *******************/ $query1 = "select * from user,adresse where user.id=$aendern_hidden and adresse.user_id=$aendern_hidden"; $anfrage1 = $db->query($query1); // $anfrage1->dump(); $antwort1 = array_bildung($anfrage1); // Personendaten $tmpl->setAttribute('person','visibility','visibility'); $tmpl->setAttribute('rechte','visibility','visibility'); $tmpl->setAttribute('fuss','visibility','visibility'); if($antwort1[aktiv][0]=='aktiv'){ // Bestimmung ob User aktiv / inaktiv $tmpl->addVar('person','ZUSTAND_AKTIV','checked'); } else{ $tmpl->addVar('person','ZUSTAND_PASSIV','checked'); } $antwort1[datum][0]=zeit_verbesserung($antwort1[datum][0]); // Umwandlung Datum if($antwort1[adresse_bestaetigt][0]=='ja'){ // Bestimmung ob Adresse unbestaetigt /bestaetigt $tmpl->addVar('person','ADRESSE_AKTIV','checked'); } else{ $tmpl->addVar('person','ADRESSE_INAKTIV','checked'); } $anzahl_adressen=count($antwort1[PLZ]); // Bestimmung Anzahl der Useradressen
function buildCFGFile($cacic_config) { $oTmpl = new patTemplate(); $oTmpl->setNamespace('cacicInstall'); $oTmpl->setRoot('templates'); $oTmpl->readTemplatesFromInput('install_navbar.tmpl'); $oTmpl->addVar('tmplCFGFile', 'cacic_path', addslashes(CACIC_PATH)); $oTmpl->addVar('tmplCFGFile', 'CACIC_URL', CACIC_URL); $oTmpl->addVar('tmplCFGFile', 'DB_SERVER', $cacic_config['db_host']); $oTmpl->addVar('tmplCFGFile', 'DB_PORT', $cacic_config['db_port']); $oTmpl->addVar('tmplCFGFile', 'DB_NAME', $cacic_config['db_name']); $oTmpl->addVar('tmplCFGFile', 'DB_USER', $cacic_config['db_user']); $oTmpl->addVar('tmplCFGFile', 'DB_USER_PASS', $cacic_config['db_pass']); $oTmpl->addVar('tmplCFGFile', 'CACIC_KEY', CACIC_KEY); $oTmpl->addVar('tmplCFGFile', 'CACIC_IV', CACIC_IV); $oTmpl->addVar('tmplCFGFile', 'CACIC_LANGUAGE', $_SESSION['cacic_language']); $oTmpl->addVar('tmplCFGFileCab', 'show_path', CACIC_PATH); $oTmpl->addVar('tmplCFGFileCab', 'cacic_ds', CACIC_DS); $oTmpl->displayParsedTemplate('tmplCFGFile'); }
$definition = patForms_Definition_Propel::create(array('name' => $classname, 'filename' => $path . '/form.' . $classname . '.xml')); // create a storage $storage = patForms::createStorage('Propel'); $storage->setStorageLocation($classname . 'peer'); // create a form $form =& patForms::createCreator('Definition')->create($definition); $form->setRenderer(patForms::createRenderer('Array')); $form->setStorage($storage); if (isset($pk)) { $form->setValues($pk); } // render it to a patTemplate (could be done by other template engines) $tpl = new patTemplate(); $tpl->setRoot($path); $tpl->readTemplatesFromInput('form.dynamic.tpl'); $tpl->addVar('page', 'title', 'Bookstore party'); $tpl->addVar('form', 'start', $form->serializeStart()); $tpl->addVar('form', 'end', $form->serializeEnd()); $tpl->addRows('elements', $form->renderForm()); // this should be possible to be done in a more elegant way if ($errors = $form->getValidationErrors()) { foreach ($errors as $field => $error) { $tpl->addVar('error', 'field', $field); foreach ($error as $line) { $tpl->addVar('error', 'message', $line['message']); $tpl->addVar('error', 'code', $line['code']); $tpl->parseTemplate('error', 'a'); } } $tpl->setAttribute('errors', 'visibility', 'visible'); }
$db->query($query2); } if($test[4]=='ja'){ move_uploaded_file($bild2,$bild_pfad."bild2_".$bildzusatz.".".$bildtest); $update="bild2_".$bildzusatz.".".$bildtest; $query2="update archiv set bild2='$update' where id='$bildzusatz'"; $db->query($query2); } $i++; } /*************** Neugenerierung Templat ************************/ $tmpl->readTemplatesFromFile($HTTP_POST_VARS[formular]); $tmpl->addVar('gesamt','INFO',$HTTP_POST_VARS[name_formular]); $tmpl->addVar('gesamt','USER_ID',$HTTP_POST_VARS[user_id]); $tmpl->addVar('gesamt','FORMULAR',$HTTP_POST_VARS[formular]); $tmpl->addVar('gesamt','NAME_FORMULAR',$HTTP_POST_VARS[name_formular]); if($j>0){ // setzen der Fehlermeldung $tmpl->setAttribute('fehler','visibility','visibility'); $tmpl->addVars('fehler',$fehler); } $tmpl->displayParsedTemplate(); $db->close(); gz_output(); exit(); }
include_once(PHP_PFAD.'patDbc.inc'); // Datenbankklasse include_once(PHP_PFAD.'function.inc'); // globale Funktionsdatei $tmpl = new patTemplate(); $tmpl->setBasedir(T_INFO); $tmpl->readTemplatesFromFile('info.ihtml'); $db = new patMysqlDbc($db_host,$db_name,$db_user,$db_pass); $db->connect(); /********* speichern der Info ************/ if($HTTP_POST_VARS[senden]){ $HTTP_POST_VARS[info]=trim($HTTP_POST_VARS[info]); if(strlen($HTTP_POST_VARS[info])>0){ $query1="insert into info (user_id, info, Absender) values ('$HTTP_POST_VARS[empfaenger]', '$HTTP_POST_VARS[info]', '$HTTP_POST_VARS[user]')"; $db->query($query1); } } /********* Abfragen der User ****************/ $query1="select * from user order by Name"; $abfrage1 = $db->query($query1); $abfrage1 = array_bildung($abfrage1); $tmpl->addVars('auswahl',$abfrage1); $tmpl->addVar('gesamt','USER',1); $tmpl->displayParsedTemplate(); $db->close(); gz_output(); ?>