Exemplo n.º 1
0
 public function configRouter($name, $array, $object)
 {
     $data = $array["attr"];
     if (!isset($data["type"]) || !in_array($data["type"], array("xml", "database"))) {
         $data["type"] = "xml";
     }
     switch ($data["type"]) {
         case "xml":
             //	NOTE: is it possible in the future to ask the router to add a parameter by default to each route
             //	NOTE: if it was, I wouldn't have to add all the time the plugin to the routes that belong to this configuration
             //	NOTE: which would solve a silly problem which has happened for a long time, but only really happens
             //			in situations like the power panel, where the route has to know which plugin was responsible
             //	NOTE: however, this is not true JUST of the power panel, it would matter for ANY plugin based architecture
             //			where the system would render a plugin, based on a route, you'd obviously need to know the relationship
             //	NOTE: this obviously won't work if you try to use a database configuration object
             $config = $this->source->getValue("filename");
             break;
         case "database":
             //	NOTE: actually the problem of knowing which route belongs to which plugin is a problem stopping me
             //			from implementing this router in full, right now I have a half-way-point version which
             //			is not possible to use in the same way as the XML router is now.
             $config = Amslib_Array::reindexByKeyValue($array["child"], "tag", "value");
             break;
     }
     Amslib_Router::load($config, $data["type"], $this->getName());
 }