Exemple #1
0
 /**
  * Gets a tag representation instance
  *
  * @param CMS_XMLTag $tag The xml tag from which to build the representation
  * @param array(mixed) $args The arguments needed to build
  * @return object The module tag representation instance
  * @access public
  */
 function getTagRepresentation($tag, $args)
 {
     switch ($tag->getName()) {
         case "block":
             //try to guess the class to instanciate
             $class_name = "CMS_block_cms_forms";
             if (class_exists($class_name)) {
                 $instance = new $class_name();
             } else {
                 $this->raiseError("Unknown block type : CMS_block_cms_forms");
                 return false;
             }
             $instance->initializeFromTag($tag->getAttributes(), $tag->getInnerContent());
             return $instance;
             break;
         case "atm-clientspace":
             if ($tag->getAttribute("type")) {
                 $instance = new CMS_moduleClientspace($tag->getAttributes());
                 return $instance;
             } else {
                 return false;
             }
             break;
     }
 }
 /**
  * Gets a tag representation instance
  *
  * @param CMS_XMLTag $tag The xml tag from which to build the representation
  * @param array(mixed) $args The arguments needed to build
  * @return object The module tag representation instance
  * @access public
  */
 function getTagRepresentation($tag, $args)
 {
     switch ($tag->getName()) {
         case "atm-clientspace":
             if ($tag->getAttribute("type")) {
                 $clientSpaceClassName = 'CMS_moduleClientspace_' . $this->getCodename();
                 $instance = new $clientSpaceClassName($tag->getAttributes());
                 return $instance;
             } else {
                 return false;
             }
             break;
     }
 }
Exemple #3
0
 /**
  * Gets a tag representation instance
  *
  * @param CMS_XMLTag $tag The xml tag from which to build the representation
  * @param array(mixed) $args The arguments needed to build
  * @return object The module tag representation instance
  * @access public
  */
 function getTagRepresentation($tag, $args)
 {
     switch ($tag->getName()) {
         case "atm-clientspace":
             if ($args["template"] && $tag->getAttribute("id")) {
                 $args["editedMode"] = isset($args["editedMode"]) ? $args["editedMode"] : null;
                 $instance = new CMS_moduleClientspace_standard($args["template"], $tag->getAttribute("id"), $args["editedMode"]);
                 return $instance;
             } else {
                 return false;
             }
             break;
         case "block":
             if ($tag->getAttribute("type")) {
                 //try to guess the class to instanciate
                 $class_name = "CMS_block_" . $tag->getAttribute("type");
                 if (class_exists($class_name)) {
                     $instance = new $class_name();
                 } else {
                     //not found. Place here block types requiring special attention
                     switch ($tag->getAttribute("type")) {
                         default:
                             $this->raiseError("Unknown block type : " . $tag->getAttribute("type"));
                             return false;
                             break;
                     }
                 }
                 $instance->initializeFromTag($tag->getAttributes(), $tag->getInnerContent());
                 return $instance;
             } else {
                 return false;
             }
             break;
     }
 }