Skip to content

Commit

Permalink
Добавление начальных файлов
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Jun 29, 2019
1 parent 7ffcf2c commit 43093dd
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
39 changes: 39 additions & 0 deletions quantummanagericon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* @package Quantummanagericon
*
* @author Cymbal <[email protected]>
* @copyright Copyright (C) 2019 "Delo Design". All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link https://delo-design.ru
*/

defined('_JEXEC') or die('Restricted access');
?>

<?php

/**
* Class plgQuickiconQuantummanagericon
*/
class plgQuickiconQuantummanagericon extends JPlugin
{

public function onGetIcons($context)
{

if ($context !== $this->params->get('context', 'mod_quickicon') || !JFactory::getUser()->authorise('core.manage', 'com_quantummanager'))
{
return;
}

return array(
array(
'link' => 'index.php?option=com_quantummanager',
'image' => 'pictures',
'text' => 'Quantum Manager',
'id' => 'plg_quickicon_quantummanageicon',
)
);
}
}
27 changes: 27 additions & 0 deletions quantummanagericon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="quickicon">
<name>Quantum Manager Quick Icon</name>
<creationDate>30.06.2018</creationDate>
<version>1.0</version>
<author>Cymbal</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://delo-design.ru</authorUrl>
<copyright>Copyright (C) 2019 "Delo Design". All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<description>Quantum Manager Quick Icon</description>

<scriptfile>script.php</scriptfile>

<files>
<filename plugin="quantummanagericon">quantummanagericon.php</filename>
</files>

<config>
<fields name="params">
<fieldset name="basic">
<field name="context" type="text" default="mod_quickicon" description="QUICKICON_GROUP" label="GROUP" />
<field name="displayedtext" type="text" default="" description="ICON_LEGEND" label="ICON_LEGEND" />
</fieldset>
</fields>
</config>
</extension>
77 changes: 77 additions & 0 deletions script.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/**
* @package quantummanagermedia
*
* @author tsymb <[email protected]>
* @copyright A copyright
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @link http://your.url.com
*/

defined('_JEXEC') or die;

/**
* Quantummanagermedia script file.
*
* @package A package name
* @since 1.0
*/
class plgQuickiconQuantummanagericonInstallerScript
{
/**
* Constructor
*
* @param JAdapterInstance $adapter The object responsible for running this script
*/
public function __construct(JAdapterInstance $adapter) {}

/**
* Called before any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function preflight($route, JAdapterInstance $adapter) {}

/**
* Called after any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function postflight($route, JAdapterInstance $adapter) {
$db = JFactory::getDbo();
$query = $db->getQuery( true );
$query->update( '#__extensions' )->set( 'enabled=1' )->where( 'type=' . $db->q( 'plugin' ) )->where( 'element=' . $db->q( 'quantummanagericon' ) );
$db->setQuery( $query )->execute();
}

/**
* Called on installation
*
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $adapter) {}

/**
* Called on update
*
* @param JAdapterInstance $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function update(JAdapterInstance $adapter) {}

/**
* Called on uninstallation
*
* @param JAdapterInstance $adapter The object responsible for running this script
*/
public function uninstall(JAdapterInstance $adapter) {}
}

0 comments on commit 43093dd

Please sign in to comment.