Beispiel #1
0
 public function process(Mongular $mongular)
 {
     $messages = $this->get();
     if ($messages && !Reload::get() && !Redirect::get()) {
         if (!$mongular->return) {
             $mongular->return = array();
         }
         $mongular->return['mongular_messages'] = $messages;
         $this->reset();
     }
 }
 /**
  * Implements getValues.
  *
  * @return array
  */
 public function getValues()
 {
     $content = $this->element_query->getElementById($this->parameters->values[0]);
     //Validate that this class is assigned to this element.
     if (self::getRoute() === $content['controller']) {
         $url_part = explode(',', $this->parameters->query_parameters);
         $file = $this->getFileFromArray($url_part[0], $content['controller_values']['markdown_paths']);
         if ($file) {
             return array('md_file' => $file);
         } else {
             Redirect::set($this->config->FourOFour);
             return array();
         }
     } else {
         return array();
     }
 }
Beispiel #3
0
 /**
  * Implements getValues.
  *
  * @return array
  */
 public function getValues()
 {
     $id = $this->parameters->values[0];
     $content = $this->element_query->getElementById($id);
     //Validate that this class is assigned to this element.
     if (self::getRoute() === $content['controller']) {
         $url_part = explode(',', $this->parameters->query_parameters);
         $blog = $this->blog_query->getBlog($url_part[0], $id, TRUE);
         if ($blog) {
             return $blog['blog_values'];
         }
         if (isset($this->config->FourOFour)) {
             Redirect::set($this->config->FourOFour);
         }
         return array();
     } else {
         return array();
     }
 }
Beispiel #4
0
 /**
  * Implements getValues.
  *
  * @return array
  */
 public function getValues()
 {
     $wildcard = FALSE;
     $full_path = Headers::get('CurrentPath');
     $path = explode('/', $full_path);
     if ($path_cache = Cache::get(self::PATH_CACHE . $full_path)) {
         $path_values = $this->path_query->getPathDataById($path_cache['id']);
         return $this->setupPathValues($path_values, $path_cache['query_parameters']);
     }
     $host = Headers::get('Host');
     if ($path[0] == "") {
         array_shift($path);
     }
     $query_parameters = array();
     while (count($path)) {
         $path_query = implode('/', $path);
         $path_values = $this->path_query->getPathDataFromPath($path_query, $host, $wildcard, true);
         if ($path_values) {
             $cache = array('id' => $path_values['_id']->{'$id'}, 'query_parameters' => $query_parameters);
             Cache::set(self::PATH_CACHE . $full_path, $cache);
             return $this->setupPathValues($path_values, $query_parameters);
         }
         if ($wildcard == TRUE) {
             $query_parameters[] = array_pop($path);
         }
         $wildcard = TRUE;
     }
     // We did not find a match send to the 404, if available.
     if (isset($this->config->FourOFour)) {
         if ($this->config->FourOFour === Headers::get('CurrentPath')) {
             Messages::set('Page Error', 'Error');
         } else {
             Redirect::set($this->config->FourOFour);
         }
     }
     return;
 }