ModelAction Klassenreferenz

Klassendiagramm für ModelAction:

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

Aufstellung aller Elemente

Öffentliche Methoden

 ModelAction ()
 add ()
 addmodel ()
 remove ()
 delete ()
 save ()
 setdefault ()
 listing ()
 edit ()
 checkmenu ($menu)

Öffentliche Attribute

 $defaultSubAction = 'listing'
 $model


Ausführliche Beschreibung

Definiert in Zeile 62 der Datei ModelAction.class.php.


Dokumentation der Elementfunktionen

ModelAction::add (  ) 

Definiert in Zeile 80 der Datei ModelAction.class.php.

00081      {
00082      }

ModelAction::addmodel (  ) 

Definiert in Zeile 85 der Datei ModelAction.class.php.

Benutzt $model, Action::getRequestVar() und lang().

00086      {
00087           $model = new Model();
00088           $model->projectid = $this->project->projectid;
00089           $model->name      = $this->getRequestVar('name');
00090           $model->add();
00091           
00092           // Wenn kein Namen eingegeben, dann einen setzen.
00093           if   ( empty($model->name) )
00094           {
00095                // Name ist "Variante <id>"
00096                $model->name = lang('GLOBAL_MODEL').' '.$model->modelid;
00097                $model->save();
00098           }
00099      }

ModelAction::checkmenu ( menu  ) 

Definiert in Zeile 198 der Datei ModelAction.class.php.

Benutzt Session::getProjectModel() und Action::userIsAdmin().

00199      {
00200           switch( $menu )
00201           {
00202                case 'remove':
00203                     $actModel = Session::getProjectModel();
00204                     return
00205                          $this->userIsAdmin()                 &&
00206                          count( $this->model->getAll() ) >= 2 &&
00207                          $actModel->modelid != $this->model->modelid;
00208                     
00209                case 'add':
00210                     return
00211                          $this->userIsAdmin();
00212                
00213                default:
00214                     return true;
00215           }
00216      }

ModelAction::delete (  ) 

Definiert in Zeile 115 der Datei ModelAction.class.php.

Benutzt Action::getRequestVar().

00116      {
00117           if   ( $this->getRequestVar('confirm') == '1' )
00118           {
00119                $this->model->delete();
00120           }
00121      }

ModelAction::edit (  ) 

Bearbeiten der Variante. Ermitteln aller Eigenschaften der Variante.

Definiert in Zeile 190 der Datei ModelAction.class.php.

Benutzt Action::setTemplateVars().

00191      {
00192           $this->model->load();
00193      
00194           $this->setTemplateVars( $this->model->getProperties() );
00195      }

ModelAction::listing (  ) 

Definiert in Zeile 154 der Datei ModelAction.class.php.

Benutzt Action::forward(), Session::getProjectModel(), Action::setTemplateVar(), Html::url() und Action::userIsAdmin().

00155      {
00156           global $conf_php;
00157           $actModel = Session::getProjectModel();
00158 
00159 //        $var['act_modelid'] = $this->getSessionVar('modelid');
00160      
00161           $list = array();
00162           foreach( $this->project->getModelIds() as $id )
00163           {
00164                $m = new Model( $id );
00165                $m->load();
00166 
00167                $list[$id]['name'] = $m->name;
00168                
00169                if   ( $this->userIsAdmin() )
00170                     $list[$id]['url' ] = Html::url('main','model',$id,
00171                                                    array(REQ_PARAM_TARGETSUBACTION=>'edit') );
00172 
00173                if   ( ! $m->isDefault && $this->userIsAdmin() )
00174                     $list[$id]['default_url'] = Html::url('model','setdefault',$id);
00175 
00176                if   ( $actModel->modelid != $m->modelid )
00177                     $list[$id]['select_url' ] = Html::url('index','model',$id);
00178           }
00179           $this->setTemplateVar( 'el',$list );
00180           $this->setTemplateVar( 'add',$this->userIsAdmin() );
00181      
00182           $this->forward('model_list');
00183      }

ModelAction::ModelAction (  ) 

Definiert in Zeile 68 der Datei ModelAction.class.php.

Benutzt Session::getProject() und Action::getRequestId().

00069      {
00070           if   ( $this->getRequestId() != 0 )
00071           {
00072                $this->model = new Model( $this->getRequestId() );
00073                $this->model->load();
00074           }
00075           
00076           $this->project = Session::getProject();
00077      }

ModelAction::remove (  ) 

Entfernen der Variante.
Es wird ein Bestätigungsdialog angezeigt.

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

Benutzt Action::setTemplateVar().

00108      {
00109           $this->model->load();
00110 
00111           $this->setTemplateVar( 'name',$this->model->name );
00112      }

ModelAction::save (  ) 

Definiert in Zeile 126 der Datei ModelAction.class.php.

Benutzt Action::addNotice() und Action::getRequestVar().

00127      {
00128           if   ( $this->getRequestVar('name') != '' )
00129           {
00130                $this->model->name = $this->getRequestVar('name');
00131                $this->model->save();
00132                $this->addNotice('model',$this->model->name,'SAVED','ok');
00133           }
00134           else
00135           {
00136                $this->addNotice('model',$this->model->name,'NOT_SAVED','error');
00137           }
00138      
00139           // Baum aktualisieren
00140 //        $this->setTemplateVar('tree_refresh',true);
00141      }

ModelAction::setdefault (  ) 

Definiert in Zeile 144 der Datei ModelAction.class.php.

Benutzt Action::callSubAction() und Action::userIsAdmin().

00145      {
00146           if   ( !$this->userIsAdmin() ) exit();
00147 
00148           $this->model->setDefault();
00149      
00150           $this->callSubAction('listing');
00151      }


Dokumentation der Datenelemente

ModelAction::$defaultSubAction = 'listing'

Definiert in Zeile 64 der Datei ModelAction.class.php.

ModelAction::$model

Definiert in Zeile 65 der Datei ModelAction.class.php.

Wird benutzt von addmodel().


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