Skip to content

Commit

Permalink
Added @REQUIRED_VERSION@ as a replacement tag for the module builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmakaay committed Jul 25, 2011
1 parent e520f8b commit fcfa132
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
14 changes: 10 additions & 4 deletions lib/Phorum/ModuleBuilder.php
Expand Up @@ -95,12 +95,18 @@ protected function _getBuildPackageDir()

protected function _substituteTags($data)
{
$data = str_replace('@TITLE@', $this->_module_info->getTitle(), $data);
$data = str_replace('@MODULE_ID@', $this->_module_info->getId(), $data);
$data = str_replace(
'@TITLE@', $this->_module_info->getTitle(), $data);

$data = str_replace(
'@MODULE_ID@', $this->_module_info->getId(), $data);

$data = str_replace(
'@REQUIRED_VERSION@',
$this->_module_info->getRequiredVersion(), $data);

$description = wordwrap(
strip_tags($this->_module_info->getDescription()), 72
);
strip_tags($this->_module_info->getDescription()), 72);
$data = str_replace('@DESCRIPTION@', $description, $data);

return parent::_substituteTags($data);
Expand Down
12 changes: 11 additions & 1 deletion lib/Phorum/ModuleInfo.php
Expand Up @@ -193,7 +193,7 @@ public function load($info_file)

case "require_version":
case "required_version":
$this->required_version = $value;
$this->_required_version = $value;
break;

case "category":
Expand Down Expand Up @@ -353,6 +353,16 @@ public function getVersion()
return $this->_version;
}

/**
* Retrieve the required Phorum version.
*
* @return string
*/
public function getRequiredVersion()
{
return $this->_required_version;
}

/**
* Retrieve the module title.
*
Expand Down

0 comments on commit fcfa132

Please sign in to comment.