ProjectAction Klassenreferenz

Klassendiagramm für ProjectAction:

Inheritance graph
base refererrect $classAction.html 6,7 190,463

Aufstellung aller Elemente

Öffentliche Methoden

 ProjectAction ()
 save ()
 add ()
 addproject ()
 listing ()
 select ()
 edit ()
 remove ()
 delete ()
 maintenance ()
 export ()
 phpinfo ()

Öffentliche Attribute

 $project
 $defaultSubAction = 'listing'


Ausführliche Beschreibung

Definiert in Zeile 89 der Datei ProjectAction.class.php.


Dokumentation der Elementfunktionen

ProjectAction::add (  ) 

Definiert in Zeile 131 der Datei ProjectAction.class.php.

Benutzt Project::getAll() und Action::setTemplateVar().

00132      {
00133           $this->setTemplateVar( 'projects',Project::getAll() );
00134      }

ProjectAction::addproject (  ) 

Projekt hinzufuegen.

Definiert in Zeile 141 der Datei ProjectAction.class.php.

Benutzt Action::$db, $project, Action::addNotice(), Action::addValidationError(), Action::callSubAction(), db_connection(), Action::getRequestVar(), Action::hasRequestVar() und Http::serverError().

00142      {
00143           if   ( !$this->hasRequestVar('type') )
00144           {
00145                $this->addValidationError('type');
00146                $this->callSubAction('add');
00147                return;
00148           }
00149           else
00150           {
00151                switch( $this->getRequestVar('type') )
00152                {
00153                     case 'empty':
00154                          if   ( !$this->hasRequestVar('name') )
00155                          {
00156                               $this->addValidationError('name');
00157                               $this->callSubAction('add');
00158                               return;
00159                          }
00160                          $this->project = new Project();
00161                          $this->project->name = $this->getRequestVar('name');
00162                          $this->project->add();
00163                          break;
00164                     case 'copy':
00165                          $db = db_connection();
00166                          $project = new Project($this->getRequestVar('projectid'));
00167                          $project->load();
00168                          $project->export($db->id);
00169                          break;
00170                     default:
00171                          Http::serverError('Unknown type while adding project '.$this->getRequestVar('type') );
00172                }
00173                
00174                $this->addNotice('project',$this->project->name,'ADDED'); 
00175           }
00176      }

ProjectAction::delete (  ) 

Definiert in Zeile 243 der Datei ProjectAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction(), Action::getRequestVar() und Action::setTemplateVar().

00244      {
00245           if   ( $this->getRequestVar('delete') != '' )
00246           {
00247                // Gesamtes Projekt loeschen
00248                $this->project->delete();
00249 
00250                $this->setTemplateVar('tree_refresh',true);
00251                $this->addNotice('project',$this->project->name,'DELETED'); 
00252           }
00253           else
00254           {
00255                $this->addValidationError('delete');
00256                $this->callSubAction('remove');
00257           }
00258      }

ProjectAction::edit (  ) 

Definiert in Zeile 227 der Datei ProjectAction.class.php.

Benutzt Action::forward() und Action::setTemplateVars().

00228      {
00229           // Projekt laden
00230           $this->setTemplateVars( $this->project->getProperties() );
00231 
00232           $this->forward('project_edit');
00233 
00234      }

ProjectAction::export (  ) 

Projekt exportieren.

Definiert in Zeile 277 der Datei ProjectAction.class.php.

Benutzt $conf, Action::$db, Action::addNotice(), db_connection(), Action::getRequestVar(), Action::hasRequestVar() und Action::setTemplateVar().

00278      {
00279           $db = db_connection();
00280           $this->setTemplateVar( 'dbid',$db->id );
00281 
00282           global $conf;
00283           $dbids = array();
00284           
00285           foreach( $conf['database'] as $dbname=>$dbconf )
00286           {
00287                if   ( is_array($dbconf) && $dbconf['enabled'])
00288                     $dbids[$dbname] = $dbconf['comment'];
00289           }
00290           $this->setTemplateVar( 'dbids',$dbids );
00291           
00292           
00293           if   ( $this->hasRequestVar('ok') )
00294           {
00295                $this->project->export( $this->getRequestVar('dbid') );
00296                
00297                $this->addNotice('project',$this->project->name,'DONE');
00298                $this->setTemplateVar('done',true);
00299           }
00300      }

ProjectAction::listing (  ) 

Liste aller Projekte anzeigen.

Definiert in Zeile 183 der Datei ProjectAction.class.php.

Benutzt Action::forward(), Project::getAll(), Action::setTemplateVar() und Html::url().

00184      {
00185           global $conf_php;
00186 
00187           // Projekte ermitteln
00188           $list = array();
00189 
00190           foreach( Project::getAll() as $id=>$name )
00191           {
00192                $list[$id]             = array();
00193                $list[$id]['url'     ] = Html::url('main' ,'project',$id,array(REQ_PARAM_TARGETSUBACTION=>'edit'));
00194                $list[$id]['use_url' ] = Html::url('index','project',$id);
00195                $list[$id]['name'    ] = $name;
00196           }
00197           $this->setTemplateVar('el',$list);
00198      
00199           $this->forward('project_list');
00200      }

ProjectAction::maintenance (  ) 

Definiert in Zeile 262 der Datei ProjectAction.class.php.

Benutzt Action::addNotice(), Action::hasRequestVar() und Action::setTemplateVar().

00263      {
00264           if   ( $this->hasRequestVar('ok') )
00265           {
00266                $this->project->checkLostFiles();
00267                $this->addNotice('project',$this->project->name,'DONE');
00268                $this->setTemplateVar('done',true);
00269           }
00270      }

ProjectAction::phpinfo (  ) 

Ausgabe PHPINFO.

Definiert in Zeile 308 der Datei ProjectAction.class.php.

00309      {
00310           phpinfo();
00311      }

ProjectAction::ProjectAction (  ) 

Definiert in Zeile 95 der Datei ProjectAction.class.php.

Benutzt Action::getRequestId().

00096      {
00097           if   ( $this->getRequestId()!=0 )
00098           {
00099                $this->project = new Project( $this->getRequestId() );
00100                $this->project->load();
00101           }
00102           
00103           
00104      }

ProjectAction::remove (  ) 

Definiert in Zeile 237 der Datei ProjectAction.class.php.

Benutzt Action::setTemplateVar().

00238      {
00239           $this->setTemplateVar( 'name',$this->project->name );
00240      }

ProjectAction::save (  ) 

Definiert in Zeile 107 der Datei ProjectAction.class.php.

Benutzt Action::addNotice(), Action::addValidationError(), Action::callSubAction() und Action::getRequestVar().

00108      {
00109           if   ( $this->getRequestVar('name') != '')
00110           {
00111                $this->project->name                = $this->getRequestVar('name'               );
00112                $this->project->target_dir          = $this->getRequestVar('target_dir'         );
00113                $this->project->ftp_url             = $this->getRequestVar('ftp_url'            );
00114                $this->project->ftp_passive         = $this->getRequestVar('ftp_passive'        );
00115                $this->project->cmd_after_publish   = $this->getRequestVar('cmd_after_publish'  );
00116                $this->project->content_negotiation = $this->getRequestVar('content_negotiation');
00117                $this->project->cut_index           = $this->getRequestVar('cut_index'          );
00118      
00119                $this->addNotice('project',$this->project->name,'SAVED','ok');
00120                $this->project->save(); // speichern
00121           }
00122           else
00123           {
00124                $this->addValidationError('name');
00125                $this->callSubAction('edit');
00126           }
00127      }

ProjectAction::select (  ) 

Definiert in Zeile 203 der Datei ProjectAction.class.php.

Benutzt Action::forward(), Session::getUser(), lang(), Action::setTemplateVar() und Html::url().

00204      {
00205           $user     = Session::getUser();
00206           $projects = $user->projects;
00207 
00208           // Administrator sieht Administrationsbereich
00209           if   ( $user->isAdmin )
00210                $projects = array_merge( array("-1"=>lang('ADMINISTRATION')),$projects );
00211 
00212           // Projekte ermitteln
00213           $list = array();
00214 
00215           foreach( $projects as $id=>$name )
00216           {
00217                $list[$id]         = array();
00218                $list[$id]['url' ] = Html::url('index','project',$id);
00219                $list[$id]['name'] = $name;
00220           }
00221           $this->setTemplateVar('el',$list);
00222      
00223           $this->forward('project_select');
00224      }


Dokumentation der Datenelemente

ProjectAction::$defaultSubAction = 'listing'

Definiert in Zeile 92 der Datei ProjectAction.class.php.

ProjectAction::$project

Definiert in Zeile 91 der Datei ProjectAction.class.php.

Wird benutzt von addproject().


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:

Erzeugt am Thu May 14 00:55:50 2009 für OpenRat von  doxygen 1.5.8