
Öffentliche Methoden | |
| init () | |
| getSessionVar ($varName) | |
| setSessionVar ($varName, $value) | |
| getRequestVar ($varName, $transcode='') | |
| hasRequestVar ($varName) | |
| getRequestId () | |
| setTemplateVar ($varName, $value) | |
| setTemplateVars ($varList) | |
| addValidationError ($name, $message="COMMON_VALIDATION_ERROR", $vars=array(), $log=array()) | |
| addNotice ($type, $name, $text, $status=OR_NOTICE_OK, $vars=array(), $log=array()) | |
| message ($title='ERROR', $add_info='') | |
| forward ($unbenutzterParameter="") | |
| callSubAction ($subActionName) | |
| userIsAdmin () | |
| getUserFromSession () | |
| lastModified ($time) | |
| maxAge ($max=3600) | |
| setMenu () | |
| checkMenu ($name) | |
| getCharset () | |
| isEditable () | |
| isEditMode () | |
Öffentliche Attribute | |
| $db | |
| $templateVars = Array() | |
| $actionName | |
| $subActionName | |
| $actionClassName | |
| $writable | |
| $publishing | |
| $actionConfig | |
| $currentUser | |
Definiert in Zeile 40 der Datei Action.class.php.
| Action::addNotice | ( | $ | type, | |
| $ | name, | |||
| $ | text, | |||
| $ | status = OR_NOTICE_OK, |
|||
| $ | vars = array(), |
|||
| $ | log = array() | |||
| ) |
F�gt ein Meldung hinzu.
| String | $type Typ des Objektes, zu dem diese Meldung geh�rt. | |
| String | $name Name des Objektes, zu dem diese Meldung geh�rt. | |
| String | $text Textschl�ssel der Fehlermeldung (optional) | |
| String | $status Einer der Werte OR_NOTICE_(OK|WARN|ERROR) | |
| Array | $vars Variablen f�r den Textschl�ssel | |
| Array | $log Weitere Hinweistexte f�r diese Meldung. |
Definiert in Zeile 227 der Datei Action.class.php.
Benutzt lang().
Wird benutzt von ObjectAction::addacl(), TemplateAction::addelement(), GroupAction::addgroup(), UserAction::addgrouptouser(), ProjectAction::addproject(), TemplateAction::addtemplate(), UserAction::adduser(), GroupAction::addusertogroup(), addValidationError(), PageelementAction::afterSave(), FolderAction::changesequence(), IndexAction::checkLogin(), FolderAction::create(), FolderAction::createnew(), FolderAction::createnewfile(), FolderAction::createnewfolder(), FolderAction::createnewlink(), FolderAction::createnewpage(), FolderAction::createpage(), ObjectAction::delacl(), UserAction::delete(), TemplateAction::delete(), ProjectAction::delete(), LinkAction::delete(), GroupAction::delete(), FolderAction::delete(), ElementAction::delete(), UserAction::delgroup(), GroupAction::deluser(), FileAction::doextract(), ProjectAction::export(), UserAction::groups(), TransferAction::import(), ObjectAction::inherit(), IndexAction::login(), ProfileAction::mailcode(), ProjectAction::maintenance(), FolderAction::multiple(), IndexAction::openid(), IndexAction::passwordcode(), IndexAction::passwordcommit(), IndexAction::projectmenu(), PageAction::pubnow(), FolderAction::pubnow(), FileAction::pubnow(), UserAction::pwchange(), IndexAction::registercode(), IndexAction::registercommit(), FolderAction::reorder(), FileAction::replace(), PageAction::replacetemplate(), FileAction::resize(), UserAction::rights(), UserAction::save(), ProjectAction::save(), ModelAction::save(), GroupAction::save(), TemplateAction::saveextension(), UserAction::savegroups(), ProfileAction::savemail(), TemplateAction::savename(), ElementAction::savename(), ProfileAction::saveprofile(), PageAction::saveprop(), FolderAction::saveprop(), FileAction::saveprop(), ElementAction::saveproperties(), ProfileAction::savepw(), TemplateAction::savesrc(), ElementAction::savetype(), FileAction::savevalue(), FolderAction::setbottom(), FolderAction::settop(), IndexAction::show() und TemplateAction::srcaddelement().
00228 { 00229 if ( !is_array($log)) 00230 $log = array($log); 00231 00232 if ( !is_array($vars)) 00233 $vars = array($vars); 00234 00235 if ( $status === true ) 00236 $status = OR_NOTICE_OK; 00237 elseif ( $status === false ) 00238 $status = OR_NOTICE_ERROR; 00239 00240 $this->templateVars['notices'][] = array('type'=>$type, 00241 'name'=>$name, 00242 'key'=>'NOTICE_'.$text, 00243 'vars'=>$vars, 00244 'text'=>lang('NOTICE_'.$text,$vars), 00245 'log'=>$log, 00246 'status'=>$status); 00247 }
| Action::addValidationError | ( | $ | name, | |
| $ | message = "COMMON_VALIDATION_ERROR", |
|||
| $ | vars = array(), |
|||
| $ | log = array() | |||
| ) |
F�gt einen Validierungsfehler hinzu.
| String | $name Name des validierten Eingabefeldes | |
| String | Textschl�ssel der Fehlermeldung (optional) |
Definiert in Zeile 208 der Datei Action.class.php.
Benutzt addNotice().
Wird benutzt von ObjectAction::addacl(), TemplateAction::addelement(), GroupAction::addgroup(), ProjectAction::addproject(), TemplateAction::addtemplate(), UserAction::adduser(), IndexAction::checkLogin(), FolderAction::createnew(), FolderAction::createnewfile(), FolderAction::createnewfolder(), FolderAction::createnewlink(), FolderAction::createnewpage(), UserAction::delete(), ProjectAction::delete(), PageelementAction::diff(), IndexAction::login(), ProfileAction::mailcode(), IndexAction::openid(), IndexAction::passwordcode(), IndexAction::passwordcommit(), UserAction::pwchange(), IndexAction::registercode(), IndexAction::registercommit(), FileAction::resize(), UserAction::save(), ProjectAction::save(), GroupAction::save(), ProfileAction::savemail(), TemplateAction::savename(), ProfileAction::saveprofile(), PageAction::saveprop(), FolderAction::saveprop(), ProfileAction::savepw() und TemplateAction::srcaddelement().
00209 { 00210 if ( !empty($message) ) 00211 $this->addNotice('','',$message,OR_NOTICE_ERROR,$vars,$log); 00212 00213 $this->templateVars['errors'][] = $name; 00214 }
| Action::callSubAction | ( | $ | subActionName | ) |
Ruft eine weitere Subaction auf.
| String | $subActionName Name der n�chsten Subaction. Es muss eine Methode mit diesem Namen geben. |
Definiert in Zeile 406 der Datei Action.class.php.
Benutzt $subActionName, actionName, Session::setSubaction(), subActionName und Logger::trace().
Wird benutzt von ObjectAction::addacl(), TemplateAction::addelement(), GroupAction::addgroup(), ProjectAction::addproject(), TemplateAction::addtemplate(), UserAction::adduser(), FolderAction::changesequence(), PageAction::changetemplateselectelements(), IndexAction::checkLogin(), TreeAction::close(), FolderAction::createnew(), FolderAction::createnewfile(), FolderAction::createnewfolder(), FolderAction::createnewlink(), FolderAction::createnewpage(), UserAction::delete(), ProjectAction::delete(), PageelementAction::diff(), FileAction::docompress(), FileAction::doextract(), FileAction::douncompress(), PageAction::elsave(), IndexAction::login(), ProfileAction::mailcode(), FolderAction::multiple(), IndexAction::object(), TreeAction::open(), IndexAction::openid(), IndexAction::passwordcode(), IndexAction::passwordcommit(), IndexAction::project(), IndexAction::projectmenu(), UserAction::pwchange(), IndexAction::registercode(), IndexAction::registercommit(), FolderAction::reorder(), FileAction::resize(), UserAction::save(), ProjectAction::save(), GroupAction::save(), PageAction::saveform(), ProfileAction::savemail(), TemplateAction::savename(), ProfileAction::saveprofile(), PageAction::saveprop(), FolderAction::saveprop(), ProfileAction::savepw(), ClipboardAction::set(), FolderAction::setbottom(), ModelAction::setdefault(), FolderAction::settop(), IndexAction::show(), IndexAction::showlogin() und TemplateAction::srcaddelement().
00407 { 00408 if ( in_array($this->actionName,array('page','file','link','folder')) ) 00409 Session::setSubaction( $subActionName ); 00410 00411 $this->subActionName = $subActionName; 00412 00413 Logger::trace("next subaction is '$subActionName'"); 00414 00415 $this->$subActionName(); 00416 }
| Action::checkMenu | ( | $ | name | ) |
Ermittelt, ob der Men�punkt aktiv ist. Ob ein Men�punkt als aktiv angezeigt werden soll, steht meist erst zur Laufzeit fest.
Diese Methode kann von den Unterklassen �berschrieben werden. Falls diese Methode nicht �berschrieben wird, sind alle Men�punkte aktiv.
| String | $name Logischer Name des Men�punktes |
Erneute Implementation in FileAction, FolderAction, GroupAction, IndexAction, PageelementAction, ProfileAction, TemplateAction, TreetitleAction und UserAction.
Definiert in Zeile 578 der Datei Action.class.php.
Wird benutzt von setMenu().
| Action::forward | ( | $ | unbenutzterParameter = "" |
) |
Ausgabe des Templates.
Erst hier soll die Ausgabe auf die Standardausgabe, also die Ausgabe f�r den Browser, starten.
| String | Wird nicht benutzt! |
Definiert in Zeile 277 der Datei Action.class.php.
Benutzt $actionName, $conf, $REQ, $subActionName, actionConfig, actionName, getCharset(), getRequestId(), getRequestVar(), Session::getUser(), Http::serverError(), setMenu() und subActionName.
Wird benutzt von LoginAction::blank(), TemplateAction::edit(), ProjectAction::edit(), LinkAction::edit(), PageelementAction::editlink(), PageelementAction::editnumber(), PageelementAction::editselect(), PageAction::elsave(), PageAction::form(), TransferAction::import(), PageelementAction::link(), ProjectAction::listing(), ModelAction::listing(), LanguageAction::listing(), message(), PageAction::prop(), FileAction::pub(), ProjectAction::select(), TitleAction::show(), ClipboardAction::show(), BorderAction::show() und BackgroundAction::show().
00278 { 00279 if ( isset($this->actionConfig[$this->subActionName]['direct']) ) 00280 exit; // Die Ausgabe ist bereits erfolgt (z.B. Bin�rdateien o. WebDAV) 00281 00282 // Pruefen, ob HTTP-Header gesendet wurden. Dies deutet stark darauf hin, dass eine 00283 // PHP-Fehlermeldung ausgegeben wurde. In diesem Fall wird hier abgebrochen. 00284 // Weitere Ausgabe wuerde keinen Sinn machen, da wir nicht wissen, was 00285 // passiert ist. 00286 if ( headers_sent() ) 00287 Http::serverError("Some server error messages occured - see above - CMS canceled."); 00288 00289 $httpAccept = getenv('HTTP_ACCEPT'); 00290 $types = explode(',',$httpAccept); 00291 00292 // Weitere Variablen anreichern. 00293 $this->templateVars['session'] = array('name'=>session_name(),'id'=>session_id()); 00294 $this->templateVars['version'] = OR_VERSION; 00295 00296 if ( sizeof($types)==1 && in_array('application/json',$types) || $this->getRequestVar('output')=='json' ) 00297 { 00298 require_once( OR_SERVICECLASSES_DIR."JSON.class.".PHP_EXT ); 00299 $json = new JSON(); 00300 header('Content-Type: application/json'); 00301 echo $json->encode( $this->templateVars ); 00302 exit; 00303 } 00304 00305 if ( sizeof($types)==1 && in_array('application/xml',$types) || $this->getRequestVar('output')=='xml' ) 00306 { 00307 require_once( OR_SERVICECLASSES_DIR."XML.class.".PHP_EXT ); 00308 $xml = new XML(); 00309 $xml->root = 'server'; // Name des XML-root-Elementes 00310 header('Content-Type: application/xml'); 00311 echo $xml->encode( $this->templateVars ); 00312 exit; 00313 } 00314 00315 $this->setMenu(); 00316 00317 $tplName = $this->actionName.'/'.$this->subActionName; 00318 00319 00320 if ( isset($this->actionConfig[$this->subActionName]['action']) ) 00321 $tplName = $this->actionConfig[$this->subActionName]['action'].'/'.$this->subActionName; 00322 00323 if (isset($this->actionConfig[$this->subActionName]['alias'])) 00324 $tplName = (method_exists(new ObjectAction(),$this->subActionName)?'object':$this->actionName).'/'.$this->actionConfig[$this->subActionName]['alias']; 00325 00326 if (isset($this->actionConfig[$this->subActionName]['target'])) 00327 $targetSubActionName = $this->actionConfig[$this->subActionName]['target']; 00328 00329 if ( isset($this->actionConfig[$this->subActionName]['menu'])) 00330 $windowTitle = 'menu_title_'.$this->actionName.'_'.$this->actionConfig[$this->subActionName]['menu']; 00331 00332 global $conf; 00333 global $REQ; 00334 global $PHP_SELF; 00335 global $HTTP_SERVER_VARS; 00336 global $image_dir; 00337 00338 $tplName = str_replace( '_','/',$tplName ); 00339 00340 $tplFileName = $tplName.'.tpl.'.PHP_EXT; 00341 $conf_php = PHP_EXT; 00342 00343 // ?bertragen der Array-Variablen in den aktuellen Kontext 00344 // 00345 extract( $this->templateVars ); 00346 00347 // ?bertragen der Array-Variablen in den aktuellen Kontext 00348 // 00349 00350 if ( count($errors)>0 ) 00351 extract( $REQ ); 00352 00353 // Setzen einiger Standard-Variablen 00354 // 00355 $tpl_dir = OR_THEMES_DIR.$conf['interface']['theme'].'/pages/html/'; 00356 $image_dir = OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/images/'; 00357 00358 $user = Session::getUser(); 00359 00360 if ( strpos($conf['interface']['style']['extend'],'/')===false ) 00361 $root_stylesheet = OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/css/'.$conf['interface']['style']['extend'].'.css'; 00362 else 00363 $root_stylesheet = $style['extend']; 00364 00365 if ( !is_object($user) ) 00366 $user_stylesheet = OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/css/'.$conf['interface']['style']['default'].'.css'; 00367 else 00368 $user_stylesheet = OR_THEMES_EXT_DIR.$conf['interface']['theme'].'/css/'.$user->style.'.css'; 00369 00370 $self = $HTTP_SERVER_VARS['PHP_SELF']; 00371 00372 $tplFileName = str_replace( '_','/',$tplFileName ); 00373 00374 if ( !empty($conf['interface']['override_title']) ) 00375 $cms_title = $conf['interface']['override_title']; 00376 else 00377 $cms_title = OR_TITLE.' '.OR_VERSION; 00378 00379 $charset = $this->getCharset(); 00380 00381 $showDuration = $conf['interface']['show_duration']; 00382 00383 $subActionName = $this->subActionName; 00384 $actionName = $this->actionName; 00385 $requestId = $this->getRequestId(); 00386 00387 if ( $conf['theme']['compiler']['enable'] ) 00388 { 00389 $te = new TemplateEngine(); 00390 $te->compile( $tplName ); 00391 unset($te); 00392 } 00393 00394 // Einbinden des Templates 00395 require( $tpl_dir.$tplFileName ); 00396 00397 exit; 00398 }
| Action::getCharset | ( | ) |
Ermitelt den Zeichensatz f�r die Ausgabe.
Definiert in Zeile 591 der Datei Action.class.php.
Benutzt $db, db_connection() und lang().
Wird benutzt von PageAction::edit(), forward() und PageAction::show().
00592 { 00593 $db = db_connection(); 00594 00595 if ( isset($db->conf['charset']) ) 00596 return $db->conf['charset']; 00597 else 00598 return lang('CHARSET'); 00599 }
| Action::getRequestId | ( | ) |
Ermittelt die aktuelle Id aus dem Request.
Um welche ID es sich handelt, ist abh�ngig von der Action.
Definiert in Zeile 166 der Datei Action.class.php.
Benutzt getRequestVar() und hasRequestVar().
Wird benutzt von ObjectAction::addacl(), MainmenuAction::addSubAction(), TreeAction::close(), ObjectAction::delacl(), MainmenuAction::element(), ElementAction::ElementAction(), MainmenuAction::file(), FileAction::FileAction(), MainmenuAction::folder(), FolderAction::FolderAction(), forward(), MainmenuAction::group(), GroupAction::GroupAction(), MainmenuAction::language(), IndexAction::language(), LanguageAction::LanguageAction(), MainmenuAction::link(), LinkAction::LinkAction(), MainmenuAction::model(), IndexAction::model(), ModelAction::ModelAction(), IndexAction::object(), TreeAction::open(), MainmenuAction::page(), PageAction::PageAction(), MainmenuAction::pageelement(), PageelementAction::PageelementAction(), MainmenuAction::project(), IndexAction::project(), ProjectAction::ProjectAction(), ClipboardAction::set(), setMenu(), MainmenuAction::show(), MainAction::show(), MainmenuAction::template(), TemplateAction::TemplateAction(), MainmenuAction::user(), UserAction::UserAction() und GroupAction::users().
00167 { 00168 if ( $this->hasRequestVar('idvar') ) 00169 return intval( $this->getRequestVar( $this->getRequestVar('idvar') ) ); 00170 else 00171 return intval( $this->getRequestVar( REQ_PARAM_ID ) ); 00172 }
| Action::getRequestVar | ( | $ | varName, | |
| $ | transcode = '' | |||
| ) |
Ermittelt den Inhalt der gew�nschten Request-Variablen. Falls nicht vorhanden, wird "" zur�ckgegeben.
| String | $varName Schl�ssel |
Definiert in Zeile 119 der Datei Action.class.php.
Benutzt $REQ.
Wird benutzt von ObjectAction::addacl(), TemplateAction::addelement(), GroupAction::addgroup(), UserAction::addgrouptouser(), LanguageAction::addlanguage(), ModelAction::addmodel(), ProjectAction::addproject(), TemplateAction::addtemplate(), UserAction::adduser(), GroupAction::addusertogroup(), PageelementAction::afterSave(), FolderAction::changesequence(), PageAction::changetemplateselectelements(), IndexAction::checkForDb(), FilemanagerAction::createFolder(), FolderAction::createnew(), FolderAction::createnewfile(), FolderAction::createnewfolder(), FolderAction::createnewlink(), FolderAction::createnewpage(), ObjectAction::delacl(), TemplateAction::delete(), ProjectAction::delete(), ModelAction::delete(), LanguageAction::delete(), FolderAction::delete(), UserAction::delgroup(), GroupAction::deluser(), PageelementAction::diff(), FileAction::docompress(), PageelementAction::doexportlongtext(), FileAction::douncompress(), FolderAction::edit(), PageelementAction::editdate(), PageAction::elsave(), ProjectAction::export(), FilemanagerAction::FilemanagerAction(), forward(), getRequestId(), TransferAction::import(), init(), isEditMode(), IndexAction::login(), ProfileAction::mailcode(), MainmenuAction::MainmenuAction(), FolderAction::multiple(), MainmenuAction::pageelement(), PageelementAction::PageelementAction(), IndexAction::passwordcode(), IndexAction::passwordcommit(), UserAction::pwchange(), SearchAction::quicksearch(), IndexAction::registercode(), IndexAction::registercommit(), IndexAction::registeruserdata(), PageelementAction::release(), FolderAction::reorder(), PageAction::replacetemplate(), FileAction::resize(), UserAction::save(), ProjectAction::save(), ModelAction::save(), LinkAction::save(), LanguageAction::save(), GroupAction::save(), PageelementAction::savedate(), TemplateAction::saveextension(), PageAction::saveform(), PageelementAction::saveinsert(), PageelementAction::savelink(), PageelementAction::savelongtext(), ProfileAction::savemail(), TemplateAction::savename(), ElementAction::savename(), PageelementAction::savenumber(), ProfileAction::saveprofile(), PageAction::saveprop(), LinkAction::saveprop(), FolderAction::saveprop(), FileAction::saveprop(), ElementAction::saveproperties(), ProfileAction::savepw(), PageelementAction::saveselect(), TemplateAction::savesrc(), PageelementAction::savetext(), ElementAction::savetype(), FileAction::savevalue(), SearchAction::searchcontent(), SearchAction::searchprop(), FolderAction::setbottom(), FolderAction::settop(), MainAction::show(), IndexAction::show(), IndexAction::showlogin(), TemplateAction::srcaddelement(), TemplateAction::TemplateAction() und PageelementAction::usevalue().
00120 { 00121 global $REQ; 00122 00123 if ( !isset($REQ[ $varName ]) ) 00124 return ''; 00125 00126 00127 switch( $transcode ) 00128 { 00129 case 'abc': 00130 $value = strip_tags( strtolower($REQ[ $varName ] ) ); 00131 $my_set = 'abcdefghijklmnopqrstuvwxyz._-'; 00132 $first = strtr( $value, $my_set, str_repeat('#', strlen($my_set)) ); 00133 $second = strtr( $value, $first , str_repeat('_', strlen($first )) ); 00134 return $second; 00135 00136 case 'all': 00137 return strip_tags( $REQ[ $varName ] ); 00138 00139 default: 00140 return $REQ[ $varName ]; 00141 } 00142 }
| Action::getSessionVar | ( | $ | varName | ) |
Liest eine Session-Variable
| String | $varName Schl�ssel |
Definiert in Zeile 87 der Datei Action.class.php.
Benutzt $SESS.
Wird benutzt von PageelementAction::editdate(), PageelementAction::editinsert(), PageelementAction::editlink(), PageelementAction::editlongtext(), PageelementAction::editnumber(), PageelementAction::editselect(), PageelementAction::edittext(), MainmenuAction::file(), PageelementAction::link(), MainmenuAction::link(), IndexAction::passwordcommit(), PageAction::saveform() und IndexAction::showlogin().
00088 { 00089 global $SESS; 00090 00091 if ( !isset($SESS[ $varName ]) ) 00092 return ''; 00093 else return $SESS[ $varName ]; 00094 }
| Action::getUserFromSession | ( | ) |
Ermitteln des Benutzerobjektes aus der Session
Definiert in Zeile 435 der Datei Action.class.php.
Benutzt Session::getUser().
Wird benutzt von WebdavAction::WebdavAction().
00436 { 00437 return Session::getUser(); 00438 }
| Action::hasRequestVar | ( | $ | varName | ) |
Ermittelt, ob der aktuelle Request eine Variable mit dem angegebenen Namen enth�lt.
| String | $varName Schl�ssel |
Definiert in Zeile 152 der Datei Action.class.php.
Benutzt $REQ.
Wird benutzt von ObjectAction::addacl(), ProjectAction::addproject(), PageelementAction::afterSave(), FolderAction::createnewfile(), UserAction::delete(), LinkAction::delete(), GroupAction::delete(), ElementAction::delete(), FolderAction::edit(), PageelementAction::editdate(), PageAction::elsave(), ProjectAction::export(), getRequestId(), ObjectAction::inherit(), ProjectAction::maintenance(), FolderAction::multiple(), PageelementAction::PageelementAction(), IndexAction::passwordcode(), FolderAction::pubnow(), UserAction::pwchange(), IndexAction::registercode(), IndexAction::registercommit(), FileAction::resize(), UserAction::save(), LanguageAction::save(), PageelementAction::savedate(), PageAction::saveform(), UserAction::savegroups(), PageelementAction::saveinsert(), PageelementAction::savelink(), PageelementAction::savelongtext(), PageelementAction::savenumber(), ElementAction::saveproperties(), PageelementAction::saveselect(), PageelementAction::savetext(), IndexAction::show() und IndexAction::userinfo().
00153 { 00154 global $REQ; 00155 00156 return( !empty($REQ[$varName]) ); 00157 }
| Action::init | ( | ) |
Wird durch das Controller-Skript (do.php) nach der Kontruierung des Objektes aufgerufen. So koennen Unterklassen ihren eigenen Kontruktor besitzen, ohne den Superkontruktor (=diese Funktion) aufrufen zu m�ssen.
Definiert in Zeile 66 der Datei Action.class.php.
Benutzt $conf, getRequestVar() und Session::getUser().
00067 { 00068 global $conf; 00069 $this->writable = !$conf['security']['readonly' ]; 00070 $this->publishing = !$conf['security']['nopublish']; 00071 $this->currentUser = Session::getUser(); 00072 00073 $this->templateVars['errors' ] = array(); 00074 $this->templateVars['notices'] = array(); 00075 $this->templateVars['mode' ] = $this->getRequestVar('mode'); 00076 00077 header('Content-Language: '.$conf['language']['language_code']); 00078 }
| Action::isEditable | ( | ) |
Stellt fest, ob die Anzeige dieser Aktion editierbar ist.
Definiert in Zeile 607 der Datei Action.class.php.
Benutzt actionConfig und subActionName.
Wird benutzt von isEditMode().
00608 { 00609 return isset($this->actionConfig[$this->subActionName]['editable']) && $this->actionConfig[$this->subActionName]['editable']; 00610 }
| Action::isEditMode | ( | ) |
Stellt fest, ob sich die Anzeige im Editier-Modus befindet.
Definiert in Zeile 618 der Datei Action.class.php.
Benutzt getRequestVar() und isEditable().
Wird benutzt von PageelementAction::editlongtext() und TemplateAction::src().
00619 { 00620 return !$this->isEditable() || $this->getRequestVar('mode')=='edit' || (isset($this->templateVars) && $this->templateVars['mode']=='edit'); 00621 }
| Action::lastModified | ( | $ | time | ) |
Benutzen eines sog. "Conditional GET".
Diese Funktion setzt einen "Last-Modified"-HTTP-Header. Ist der Inhalt der Seite nicht neuer, so wird der Inhalt der Seite nicht ausgegeben, sondern nur HTTP-Status 304 ("304 not modified") gesetzt. Der Rest der Seite muss dann nicht mehr erzeugt werden, wodurch die Performance stark erhoeht werden kann. Ggf. kann das Benutzen dieses Mechanismus zu unerw�nschten Effekten f�hren, dann muss "conditional GET" in der Konfiguration deaktiviert werden.
Credits: Danke an Charles Miller
Gefunden auf:| Timestamp | Letztes Aenderungsdatum dieser Seite |
Definiert in Zeile 463 der Datei Action.class.php.
Benutzt $conf und Session::getUser().
Wird benutzt von IndexAction::applications(), EmptyAction::EmptyAction(), MainmenuAction::file(), FileAction::FileAction(), MainmenuAction::folder(), FolderAction::FolderAction(), MainmenuAction::page(), IndexAction::projectmenu(), MainAction::show(), IndexAction::show(), BorderAction::show() und BackgroundAction::show().
00464 { 00465 $user = Session::getUser(); 00466 if ( $user->loginDate > $time ) 00467 // Falls Benutzer-Login nach letzter �nderung. 00468 // Zweck: Nach einem Login sollte mind. 1x jede Seite neu geladen werden, dies 00469 // Ist z.B. nach einer Style-�nderung durch den Benutzer notwendig. 00470 // Falls aus Versehen doch einmal zuviel gecacht wurde, kann man das durch ein 00471 // Neu-Login beheben. 00472 $time = $user->loginDate; 00473 00474 // Conditional-Get eingeschaltet? 00475 global $conf; 00476 if ( ! $conf['cache']['conditional_get'] ) 00477 return; 00478 00479 $lastModified = substr(date('r',$time-date('Z')),0,-5).'GMT'; 00480 $etag = '"'.md5($lastModified).'"'; 00481 00482 // Header senden 00483 header('Last-Modified: '.$lastModified ); 00484 header('ETag: ' .$etag ); 00485 00486 // Die vom Interpreter sonst automatisch gesetzten 00487 // Header uebersteuern 00488 header('Cache-Control: must-revalidate'); 00489 header('Pragma:'); 00490 00491 // See if the client has provided the required headers 00492 $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false; 00493 $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'] ) : false; 00494 00495 if ( !$if_modified_since && !$if_none_match ) 00496 return; 00497 00498 // At least one of the headers is there - check them 00499 if ( $if_none_match && $if_none_match != $etag ) 00500 return; // etag is there but doesn't match 00501 00502 00503 if ( $if_modified_since && $if_modified_since != $lastModified ) 00504 return; // if-modified-since is there but doesn't match 00505 00506 // Der entfernte Browser bzw. Proxy holt die Seite nun aus seinem Cache 00507 header('HTTP/1.0 304 Not Modified'); 00508 exit; // Sofortiges Skript-Ende 00509 }
| Action::maxAge | ( | $ | max = 3600 |
) |
| max | Anzahl der Sekunden, die die Seite im Browsercache bleiben darf |
Definiert in Zeile 516 der Datei Action.class.php.
Wird benutzt von EmptyAction::EmptyAction(), BorderAction::show() und BackgroundAction::show().
00517 { 00518 // Die Header "Last-Modified" und "ETag" wurden bereits in der 00519 // Methode "lastModified()" gesetzt. 00520 00521 header('Expires: '.substr(date('r',time()-date('Z')+$max),0,-5).'GMT' ); 00522 header('Pragma: '); // 'Pragma' ist Bullshit und 00523 // wird von den meisten Browsern ignoriert. 00524 header('Cache-Control: public, max-age='.$max.", s-maxage=".$max); 00525 }
| Action::message | ( | $ | title = 'ERROR', |
|
| $ | add_info = '' | |||
| ) |
| unknown_type | $title | |
| unknown_type | $add_info |
Definiert in Zeile 256 der Datei Action.class.php.
Benutzt forward(), lang(), setTemplateVar() und Logger::warn().
Wird benutzt von ElementAction::properties().
00257 { 00258 Logger::warn( 'creating error message, info='.$add_info ); 00259 00260 $this->setTemplateVar( 'title',lang( $title ) ); 00261 $this->setTemplateVar( 'text' ,lang( $title.'_DESC' ) ); 00262 $this->setTemplateVar( 'info' ,$add_info ); 00263 00264 $this->forward('message'); 00265 }
| Action::setMenu | ( | ) |
Definiert in Zeile 529 der Datei Action.class.php.
Benutzt $actionName, actionConfig, checkMenu(), getRequestId(), setTemplateVar(), subActionName und Html::url().
Wird benutzt von forward().
00530 { 00531 if (!isset($this->actionConfig[$this->subActionName]['menu'])) 00532 return; 00533 $windowMenu = array(); 00534 $name = $this->actionConfig[$this->subActionName]['menu']; 00535 $menuList = explode(',',$this->actionConfig['menu'][$name]); 00536 00537 if ( isset($this->actionConfig[$this->subActionName]['menuaction'])) 00538 $actionName = $this->actionConfig[$this->subActionName]['menuaction']; 00539 else 00540 $actionName = $this->subActionName; 00541 00542 foreach( $menuList as $menuName ) 00543 { 00544 if ( isset($this->actionConfig[$menuName]['alias']) ) 00545 $menuText = 'menu_'.$this->actionName.'_'.$this->actionConfig[$menuName]['alias']; 00546 else 00547 $menuText = 'menu_'.$this->actionName.'_'.$menuName; 00548 00549 00550 $menuKey = 'accesskey_window_'.$menuName; 00551 00552 // Logger::trace("testing menu $menuName"); 00553 $menuEntry = array('subaction'=>$menuName, 00554 'text' =>$menuText, 00555 'title' =>$menuText.'_DESC', 00556 'key' =>$menuKey ); 00557 00558 if ( $this->checkMenu($menuName) ) 00559 $menuEntry['url'] = Html::url($actionName,$menuName,$this->getRequestId()); 00560 00561 $windowMenu[] = $menuEntry; 00562 } 00563 $this->setTemplateVar('windowMenu',$windowMenu); 00564 }
| Action::setSessionVar | ( | $ | varName, | |
| $ | value | |||
| ) |
Setzt eine Session-Variable
| Sring | $varName Schl�ssel | |
| mixed | $value Inhalt |
Definiert in Zeile 104 der Datei Action.class.php.
Benutzt $SESS.
Wird benutzt von IndexAction::passwordcode() und IndexAction::showlogin().
00105 { 00106 global $SESS; 00107 00108 $SESS[ $varName ] = $value; 00109 }
| Action::setTemplateVar | ( | $ | varName, | |
| $ | value | |||
| ) |
Setzt eine Variable f�r die Oberfl�che.
| String | $varName Schl�ssel | |
| Mixed | $value |
Definiert in Zeile 182 der Datei Action.class.php.
Wird benutzt von ObjectAction::aclform(), TemplateAction::add(), ProjectAction::add(), LanguageAction::add(), TemplateAction::addel(), TemplateAction::addelement(), UserAction::addgroup(), TemplateAction::addtemplate(), GroupAction::adduser(), LanguageAction::advanced(), IndexAction::applications(), PageelementAction::archive(), PageAction::changetemplate(), PageAction::changetemplateselectelements(), FileAction::compress(), SearchAction::content(), FolderAction::create(), FolderAction::createfile(), FolderAction::createfolder(), FolderAction::createlink(), FolderAction::createnewfile(), FolderAction::createpage(), ProjectAction::delete(), PageelementAction::diff(), UserAction::edit(), TemplateAction::edit(), ProfileAction::edit(), PageelementAction::edit(), LinkAction::edit(), LanguageAction::edit(), FolderAction::edit(), PageelementAction::editdate(), PageelementAction::editinsert(), PageelementAction::editlink(), PageelementAction::editlongtext(), PageelementAction::editnumber(), PageelementAction::editselect(), PageelementAction::edittext(), FileAction::editvalue(), TemplateAction::el(), PageAction::el(), MainmenuAction::element(), ElementAction::ElementAction(), PageAction::elsave(), SearchAction::explainResult(), ProjectAction::export(), PageelementAction::exportlongtext(), TemplateAction::extension(), MainmenuAction::file(), MainmenuAction::folder(), PageAction::form(), MainmenuAction::group(), GroupAction::GroupAction(), UserAction::groups(), ProfileAction::groups(), TransferAction::import(), PageelementAction::importlongtext(), MainmenuAction::language(), PageelementAction::link(), MainmenuAction::link(), UserAction::listing(), TemplateAction::listing(), ProjectAction::listing(), ModelAction::listing(), LanguageAction::listing(), GroupAction::listing(), IndexAction::logout(), MainmenuAction::MainmenuAction(), ProjectAction::maintenance(), message(), IndexAction::metaValues(), MainmenuAction::model(), TemplateAction::name(), ElementAction::name(), FolderAction::order(), MainmenuAction::page(), MainmenuAction::pageelement(), TemplateAction::pages(), IndexAction::password(), MainmenuAction::prefs(), MainmenuAction::project(), IndexAction::projectmenu(), SearchAction::prop(), PageelementAction::prop(), PageAction::prop(), LinkAction::prop(), FolderAction::prop(), FileAction::prop(), ElementAction::properties(), FolderAction::pub(), IndexAction::registeruserdata(), TemplateAction::remove(), ProjectAction::remove(), ModelAction::remove(), LanguageAction::remove(), ElementAction::remove(), UserAction::rights(), ObjectAction::rights(), GroupAction::rights(), PageelementAction::savelongtext(), MainmenuAction::search(), ProjectAction::select(), FolderAction::select(), setMenu(), setTemplateVars(), PageAction::setWindowMenu(), TreetitleAction::show(), TitleAction::show(), StatusAction::show(), MainmenuAction::show(), MainAction::show(), IndexAction::show(), FolderAction::show(), ClipboardAction::show(), BorderAction::show(), BackgroundAction::show(), IndexAction::showlogin(), FileAction::size(), TemplateAction::src(), PageAction::src(), TemplateAction::srcelement(), MainmenuAction::template(), TemplateAction::TemplateAction(), MainmenuAction::transfer(), ElementAction::type(), MainmenuAction::user(), UserAction::UserAction() und GroupAction::users().
| Action::setTemplateVars | ( | $ | varList | ) |
Setzt eine Liste von Variablen f�r die Oberfl�che.
| Array | $varList Assoziatives Array |
Definiert in Zeile 193 der Datei Action.class.php.
Benutzt setTemplateVar().
Wird benutzt von ObjectAction::aclform(), PageAction::changetemplate(), UserAction::edit(), ProjectAction::edit(), ProfileAction::edit(), ModelAction::edit(), LinkAction::edit(), GroupAction::edit(), FileAction::edit(), FileAction::editvalue(), FileAction::extract(), PageAction::prop(), LinkAction::prop(), FolderAction::prop(), FileAction::prop(), UserAction::pw(), UserAction::remove(), LinkAction::remove(), GroupAction::remove(), FolderAction::remove(), ObjectAction::rights(), TreeAction::show(), LinkAction::showprop() und FileAction::size().
00194 { 00195 foreach( $varList as $name=>$value ) 00196 { 00197 $this->setTemplateVar( $name,$value ); 00198 } 00199 }
| Action::userIsAdmin | ( | ) |
Ermitteln, ob Benutzer Administratorrechte besitzt
Definiert in Zeile 423 der Datei Action.class.php.
Benutzt Session::getUser().
Wird benutzt von TemplateAction::addel(), PageAction::changetemplate(), TreetitleAction::checkMenu(), ModelAction::checkmenu(), LanguageAction::checkmenu(), IndexAction::checkMenu(), GroupAction::GroupAction(), MainmenuAction::language(), ModelAction::listing(), LanguageAction::listing(), IndexAction::metaValues(), MainmenuAction::model(), IndexAction::projectmenu(), PageAction::prop(), ElementAction::savetype(), ModelAction::setdefault(), ElementAction::type() und UserAction::UserAction().
00424 { 00425 $user = Session::getUser(); 00426 return $user->isAdmin; 00427 }
| Action::$actionClassName |
Definiert in Zeile 46 der Datei Action.class.php.
| Action::$actionConfig |
| Action::$actionName |
Definiert in Zeile 44 der Datei Action.class.php.
Wird benutzt von forward(), IndexAction::logout() und setMenu().
| Action::$currentUser |
Definiert in Zeile 58 der Datei Action.class.php.
| Action::$db |
Definiert in Zeile 42 der Datei Action.class.php.
Wird benutzt von ProjectAction::addproject(), IndexAction::checkLogin(), IndexAction::evaluateRequestVars(), ProjectAction::export(), getCharset(), IndexAction::logout(), IndexAction::password(), IndexAction::registeruserdata(), IndexAction::setDb(), WebdavAction::setDefaultDb(), TitleAction::show(), IndexAction::show() und IndexAction::showlogin().
| Action::$publishing |
Definiert in Zeile 49 der Datei Action.class.php.
| Action::$subActionName |
Definiert in Zeile 45 der Datei Action.class.php.
Wird benutzt von callSubAction(), forward() und IndexAction::logout().
| Action::$templateVars = Array() |
Definiert in Zeile 43 der Datei Action.class.php.
| Action::$writable |
Definiert in Zeile 48 der Datei Action.class.php.
1.5.8