Beispiel #1
0
 public function execute()
 {
     if ($this->user->isLogged() && !$this->submit) {
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         $ar->load($this->user->id);
         $values = $ar->getValuesAsArray();
         $values['user_password'] = '';
         __Request::setFromArray($values);
     }
 }
Beispiel #2
0
 function execute()
 {
     if (!$this->submit) {
         if (is_numeric($this->id)) {
             if ($this->id > 0) {
                 $this->ar = org_glizy_ObjectFactory::createModel($this->modelName);
                 $this->ar->load($this->id);
                 __Request::setFromArray($this->ar->getValuesAsArray());
             }
         } else {
             $this->changePage('link', array('pageId' => $this->pageId));
         }
     }
 }
Beispiel #3
0
 function process()
 {
     if ($this->getAttribute('readOnly')) {
         $this->applyReadOnlyToAllChild($this);
     }
     $dp = $this->getAttribute('dataProvider');
     if (is_object($dp)) {
         $it = $dp->loadQuery();
         if (is_object($it)) {
             $arC = $it->current();
             if (is_object($arC)) {
                 __Request::setFromArray($arC->getValuesAsArray());
             }
         }
     }
     $this->_command = org_glizy_Request::get($this->getId() . '_command', NULL);
     $this->processChilds();
 }
Beispiel #4
0
 public static function _parseUrl()
 {
     $newParser = __Config::get('glizy.routing.newParser');
     $scriptUrl = self::$requestUrl;
     $scriptUrl = preg_replace('/(.*)\\/?(\\&.*$)/Ui', '$1', $scriptUrl);
     $configArray =& org_glizy_Routing::_getValuesArray();
     $method = strtolower(@$_SERVER['REQUEST_METHOD']);
     foreach ($configArray as $k => $v) {
         if (!$v['parseUrl'] || $v['method'] != '' && $v['method'] != $method) {
             continue;
         }
         $urlPattern = $v['urlPattern'];
         if (preg_match($urlPattern, $scriptUrl, $matches)) {
             $staticValues = unserialize($v['staticValues']);
             $urlValues = unserialize($v['urlValues']);
             $keys = array_keys($urlValues);
             if ($newParser) {
                 // il codice della versione precedente
                 // da problemi quando il valore del match contiene /
                 // non ricordo il motivo percui viene fatto l'explode del valore
                 // quindi per non rompere la compatibilità ho aggiunto nel config
                 // glizy.routing.newParser per abilitare questo nuovo parsing
                 for ($i = 0; $i < count($keys); $i++) {
                     $urlValues[$keys[$i]] = $matches[$i + 1];
                 }
             } else {
                 for ($i = 0; $i < count($keys); $i++) {
                     $value = explode('/', $matches[$i + 1]);
                     if ($value[0] != "") {
                         $urlValues[$keys[$i]] = $value[0];
                     }
                     if (count($value) > 1) {
                         for ($j = 1; $j < count($value); $j++, $j++) {
                             if ($j + 1 < count($value)) {
                                 $urlValues[$value[$j]] = $value[$j + 1];
                             }
                         }
                     }
                 }
             }
             $urlValues['__params__'] = array_values($urlValues);
             $urlValues['__routingName__'] = $k;
             $urlValues['__routingPattern__'] = $urlPattern;
             __Request::setFromArray($urlValues);
             __Request::setFromArray($staticValues, GLZ_REQUEST_ROUTING);
             break;
         }
     }
 }