Skip to content

Commit

Permalink
fixes #187: create method to import module manifest file
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Jun 14, 2014
1 parent 197c965 commit 1671759
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions vtlib/Vtiger/PackageImport.php
Expand Up @@ -373,6 +373,34 @@ function import($zipfile, $overwrite=false) {
}
}

/**
* Import Module from manifest.xml file. Other files should already be in place
* @param String manifest.xml file path
*/
function importManifest($manifestfile) {
global $adb,$log;
if (!file_exists($manifestfile))
$manifestfile .= $manifestfile.'/manifest.xml'; // in case they just give us the path
if (!file_exists($manifestfile))
return false;
$this->_modulexml = simplexml_load_file($manifestfile);
$module = (string) $this->_modulexml->name;
if($module != null) {
if ($this->isLanguageType()) {
require_once('vtlib/Vtiger/Language.php');
$languagePack = new Vtiger_Language();
@$languagePack->register((string) $this->_modulexml->prefix,(string) $this->_modulexml->label,$module);
} else {
$sql = "select tabid from vtiger_tab where name=?";
$result = $adb->pquery($sql, array($module));
if ($result and $adb->num_rows($result) > 0) {
return false; // module already installed
}
$this->import_Module();
}
}
return true;
}

/**
* Import Module
Expand Down

0 comments on commit 1671759

Please sign in to comment.