示例#1
0
**/
if (is_a($cogs_tag, 'JSimpleXMLElement') && count($cogs_tag->children())) {
    $cogs_sub_tags = $cogs_tag->children();
    reset($cogs_sub_tags);
    while (list($key, $value) = each($cogs_sub_tags)) {
        $cog =& $cogs_sub_tags[$key];
        $cogs[] = array('name' => $cog->attributes('name'), 'group' => $cog->attributes('group'), 'title' => $cog->data(), 'type' => strtolower($cog->name()), 'folder' => $this->parent->getPath('source') . DS . $cog->attributes('folder'), 'installer' => new RokInstaller(), 'status' => false, 'published' => $cog->attributes('published') != null ? strtolower($cog->attributes('published')) == 'true' ? true : false : false, 'core' => $cog->attributes('core') != null ? strtolower($cog->attributes('core')) == 'true' ? true : false : false, 'enabled' => $cog->attributes('enabled') != null ? strtolower($cog->attributes('enabled')) == 'true' ? true : false : false, 'access' => $cog->attributes('access') != null ? $cog->attributes('access') : 0, 'client' => $cog->attributes('client') != null ? $cog->attributes('client') : 0, 'position' => $cog->attributes('position') != null ? $cog->attributes('position') : 'left', 'moduletitle' => $cog->attributes('title'), 'showtitle' => $cog->attributes('showtitle') != null ? strtolower($cog->attributes('showtitle')) == 'true' ? true : false : true, 'ordering' => $cog->attributes('ordering') != null ? $cog->attributes('ordering') : 0, 'params' => $cog->attributes('params'));
    }
}
/**
	Run the installer for each sub component
**/
if (!empty($cogs)) {
    for ($i = 0; $i < count($cogs); $i++) {
        $cog =& $cogs[$i];
        if ($cog['installer']->install($cog['folder']) && ($cog['installer']->upgrade || !$cog['installer']->upgrade && _adjust_settings($db, $cog))) {
            $cog['status'] = true;
        } else {
            $err_status = true;
            break;
        }
    }
}
//update the bundle component to not enabled.
$query = 'UPDATE #__components set enabled = 0 where name =' . $db->Quote($bundle_name);
// query extension id and client id
$db->setQuery($query);
$db->query();
/**
	Rollback on error
**/
示例#2
0
**/
if (is_a($cogs_tag, 'JSimpleXMLElement') && count($cogs_tag->children())) {
    $cogs_sub_tags =& $cogs_tag->children();
    reset($cogs_sub_tags);
    while (list($key, $value) = each($cogs_sub_tags)) {
        $cog =& $cogs_sub_tags[$key];
        $cogs[] = array('name' => $cog->attributes('name'), 'group' => $cog->attributes('group'), 'title' => $cog->data(), 'type' => strtolower($cog->name()), 'folder' => $this->parent->getPath('source') . DS . $cog->attributes('folder'), 'installer' => new JInstaller(), 'status' => false, 'published' => $cog->attributes('published') != null ? strtolower($cog->attributes('published')) == 'true' ? true : false : false, 'core' => $cog->attributes('core') != null ? strtolower($cog->attributes('core')) == 'true' ? true : false : false, 'enabled' => $cog->attributes('enabled') != null ? strtolower($cog->attributes('enabled')) == 'true' ? true : false : false, 'access' => $cog->attributes('access') != null ? $cog->attributes('access') : 0);
    }
}
/**
	Run the installer for each sub component
**/
if (!empty($cogs)) {
    for ($i = 0; $i < count($cogs); $i++) {
        $cog =& $cogs[$i];
        if ($cog['installer']->install($cog['folder']) && _adjust_settings($db, $cog)) {
            $cog['status'] = true;
        } else {
            $err_status = true;
            break;
        }
    }
}
/**
 * Copy the html override for the admin template menu item form.
 */
$dest_dir = JPath::clean(JPATH_THEMES . DS . $mainframe->getTemplate() . '/html/com_menus');
$override_dir = JPath::clean($this->parent->getPath('extension_administrator') . '/overrides/com_menus');
if (!JFolder::copy($override_dir, $dest_dir, '', true)) {
    JError::raiseWarning(1, JText::_('Unable to copy menu template override to ' . $dest_dir . ' due to unknown error.'));
    $err_status = true;