-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.k2additionalcategories.php
More file actions
59 lines (48 loc) · 2.34 KB
/
install.k2additionalcategories.php
File metadata and controls
59 lines (48 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @version 1.0.1
* @package Additional Categories for K2
* @author Thodoris Bgenopoulos <teobgeno@netpin.gr>
* @link http://www.netpin.gr
* @copyright Copyright (c) 2012 netpin.gr
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.installer.installer');
$status = new JObject();
$status->plugins = array();
$src = $this->parent->getPath('source');
if (version_compare(JVERSION, '1.6.0', '<'))
{
$plugins = &$this->manifest->getElementByPath('plugins');
if (is_a($plugins, 'JSimpleXMLElement') && count($plugins->children())) {
foreach ($plugins->children() as $plugin) {
$pname = $plugin->attributes('plugin');
$pgroup = $plugin->attributes('group');
$path = $src.DS.'plugins'.DS.$pgroup;
$installer = new JInstaller;
$result = $installer->install($path);
$status->plugins[] = array('name'=>$pname,'group'=>$pgroup, 'result'=>$result);
$query = "UPDATE #__plugins SET published=1 WHERE element=".$db->Quote($pname)." AND folder=".$db->Quote($pgroup);
$db->setQuery($query);
$db->query();
}
}
}
?>
<?php if (version_compare(JVERSION, '1.6.0', '<')): ?>
<h2><a target='_blank' href='http://www.netpin.gr/'>Additional Categories for K2 Plugin v1.0.1</a></h2>
<a target='_blank' href='http://www.netpin.gr/'>
<img style='float:left;background:#fff;padding:2px;margin:0 0 8px 0px;' src='../media/k2additonalcategories/addcat_logo_219x125_24.png' border='0' alt='Additional Categories for K2'/>
</a>
<b>Additional Categories for K2</b> allows you to assign a K2 item to more than one K2 category.<br/><br/>You may also want to check out the following resources:
<ul>
<li>
<a target='_blank' href='http://www.netpin.gr/documentation/item/2-k2-additional-categories'>Additional Categories for K2 documentation</a>.
</li>
</ul>
<b>Additional Categories for K2</b> is a <a target='_blank' href='http://getk2.org/'>K2</a> plugin developed by <a target='_blank' title='netpin.gr' href='http://www.netpin.gr'>Thodoris Bgenopoulos</a>, released under the <a target='_blank' title='GNU General Public License' href='http://www.gnu.org/copyleft/gpl.html'>GNU General Public License</a>.<br/><br/>Copyright © 2012 netpin.gr. All rights reserved.<br/><br/><i>(Last update: April 5th, 2013 - Version 1.0.1)</i>
<br />
<br />
<?php endif; ?>