Esempio n. 1
0
 /**
  * Pseudo-constructor, initializes the tag with its definition from tag and row id
  *
  * @param string $blockID, the block id to initialise
  * @param integer $rowID, the row id which contain the block to load
  * @return boolean true on success, false on failure.
  * @access public
  */
 function initializeFromID($blockID, $rowID)
 {
     if (!sensitiveIO::isPositiveInteger($rowID)) {
         $this->raiseError("rowID must be a positive integer : " . $rowID);
         return false;
     }
     //instanciate row to get block definition
     $row = new CMS_row($rowID);
     $blockTag = $row->getBlockTagById($blockID);
     if (!is_object($blockTag)) {
         $this->raiseError('Can\'t get block ' . $blockID . ' from row id : ' . $rowID);
         return false;
     }
     $this->initializeFromTag($blockTag->getAttributes(), $blockTag->getInnerContent());
     return true;
 }