예제 #1
0
 function run()
 {
     // load CSS
     $this->head($this->getCssSrcComponent(self::CSS_FILENAME));
     //decide what to do
     if (AnwEnv::_GET("refresh")) {
         $this->refreshComponentsList();
     } else {
         try {
             $this->oComponent = null;
             $this->sComponentName = strtolower(AnwEnv::_GET("c", AnwEnv::_POST("c")));
             $this->sComponentType = strtolower(AnwEnv::_GET("t", AnwEnv::_POST("t")));
             if ($this->sComponentName && $this->sComponentType) {
                 try {
                     $this->oComponent = AnwComponent::loadComponentGeneric($this->sComponentName, $this->sComponentType);
                 } catch (AnwException $e) {
                 }
             }
             if (!$this->oComponent) {
                 $this->oComponent = AnwComponent::loadComponentGeneric('global', 'global');
             }
             if (AnwEnv::_POST("publish")) {
                 $this->saveEdition();
             } else {
                 if (AnwEnv::_GET("js") == "addmultiplecontentfield") {
                     $sFieldName = AnwEnv::_GET("fieldname");
                     $sSuffix = AnwEnv::_GET("suffix");
                     $this->JS_AddMultipleContentField($sFieldName, $sSuffix);
                 } else {
                     $this->editForm();
                 }
             }
         } catch (AnwInvalidContentException $e) {
             $this->editForm($this->g_("err_contentinvalid"));
         }
     }
 }
 function getValuesFromPost($sSuffix)
 {
     $asFieldValues = parent::getValuesFromPost($sSuffix);
     try {
         // rebuild selectioned valid components list, with same indices as original values
         $aoComponents = array();
         foreach ($asFieldValues as $i => $sComponentName) {
             try {
                 $this->testContentFieldValueAtomic($sComponentName);
                 $aoComponents[$i] = AnwComponent::loadComponentGeneric($sComponentName, $this->mComponentType);
             } catch (Exception $e) {
                 // just ignore this erroneous value...
             }
         }
         // solve dependancies
         foreach ($aoComponents as $oComponent) {
             if ($oComponent instanceof AnwDependancyManageable) {
                 $aoDependancies = $oComponent->getComponentDependancies();
                 foreach ($aoDependancies as $oDependancy) {
                     $asFieldValues = $oDependancy->solveDependancies($aoComponents, $asFieldValues);
                 }
             }
         }
     } catch (Exception $e) {
         // if dependancies can't be solved, contentfield will appear as erroneous, but we can't throw exception here
     }
     return $asFieldValues;
 }
 protected function loadComponentToConfigure()
 {
     return AnwComponent::loadComponentGeneric(AnwComponent::globalCfgDriverSessions(), 'sessionsdriver');
 }
 protected function loadComponentToInitialize()
 {
     return AnwComponent::loadComponentGeneric(AnwComponent::globalCfgDriverStorage(), 'storagedriver');
 }
예제 #5
0
 protected function loadComponentToConfigure()
 {
     return AnwComponent::loadComponentGeneric('global', 'global');
 }
예제 #6
0
 protected function loadComponentToInitialize()
 {
     return AnwComponent::loadComponentGeneric(AnwComponent::globalCfgDriverUsers(), 'usersdriver');
 }