Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update headers #54

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion admirorgallery.scriptfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/**
* @version 6.0.0
* @package Admiror Gallery (component)
* @author Igor Kekeljevic & Nikola Vasiljevski
* @author Igor Kekeljevic <igor@admiror.com>
* @author Nikola Vasiljevski <nikola83@gmail.com>
* @copyright Copyright (C) 2010 - 2021 https://www.admiror-design-studio.com All Rights Reserved.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand Down
4 changes: 2 additions & 2 deletions com_admirorgallery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<copyright>This extension in released under the GNU/GPL License - https://www.gnu.org/licenses/gpl-3.0.html</copyright>
<license>GNU/GPL</license>
<version>6.0.0</version>
<button_version>6.0.0</button_version>
<plugin_version>6.0.0</plugin_version>
<buttonVersion>6.0.0</buttonVersion>
<pluginVersion>6.0.0</pluginVersion>
<description>COM_ADMIRORGALLERY_DESCRIPTION</description>
<scriptfile>admirorgallery.scriptfile.php</scriptfile>
<updateservers>
Expand Down
89 changes: 55 additions & 34 deletions com_admirorgallery/admin/admirorgallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

/**
* @version 6.0.0
* @package Admiror Gallery (component)
* @author Igor Kekeljevic & Nikola Vasiljevski
* @package Admiror.Administrator
* @subpackage com_admirorgallery
* @author Igor Kekeljevic <igor@admiror.com>
* @author Nikola Vasiljevski <nikola83@gmail.com>
* @copyright Copyright (C) 2010 - 2021 https://www.admiror-design-studio.com All Rights Reserved.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
Expand All @@ -14,51 +16,70 @@
use Joomla\CMS\Language\Text as JText;
use Joomla\CMS\Uri\Uri as JURI;

$ag_template = "default"; // Set template to default
$input = JFactory::getApplication()->input;
// Set template to default
$template = "default";

if (JFactory::getApplication()->isClient('administrator')) {
if (!JFactory::getUser()->authorise('core.manage', 'com_admirorgallery')) {
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
try
{
$app = JFactory::getApplication();
$input = $app->input;
$user = JFactory::getUser();
$isAdmin = $app->isClient('administrator');
}
catch (Exception $e)
{
trigger_error($e, E_ERROR);

$input->set('AG_template', $ag_template);
return;
}

if ($isAdmin && !$user->authorise('core.manage', 'com_admirorgallery'))
{
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

if (JFactory::getApplication()->isClient('administrator')) {
$resources_path = JURI::root(true) . '/administrator/components/com_admirorgallery/';
$input->set('template', $template);

// Shared scripts for all views
$doc = JFactory::getDocument();
$doc->addScript(
JURI::root(true) . '/plugins/content/admirorgallery/admirorgallery/AG_jQuery.js'
);
$doc->addScript(
$resources_path . 'scripts/jquery.hotkeys-0.7.9.min.js'
);
$doc->addStyleSheet(
$resources_path . 'templates/' . $ag_template . '/css/template.css'
);
$doc->addStyleSheet(
$resources_path . 'templates/' . $ag_template . '/css/toolbar.css'
);
if ($isAdmin)
{
$resourcesPath = JURI::root(true) . '/administrator/components/com_admirorgallery/';

// Shared scripts for all views
$doc = JFactory::getDocument();
$doc->addScript(
JURI::root(true) . '/plugins/content/admirorgallery/admirorgallery/AG_jQuery.js'
);
$doc->addScript(
$resourcesPath . 'scripts/jquery.hotkeys-0.7.9.min.js'
);
$doc->addStyleSheet(
$resourcesPath . 'templates/' . $template . '/css/template.css'
);
$doc->addStyleSheet(
$resourcesPath . 'templates/' . $template . '/css/toolbar.css'
);
}

// Require the base controller
require_once(JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controller.php');
require_once JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controller.php';

// Require specific controller if requested
if ($controller = $input->getWord('controller')) {
$path = JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . $controller . '.php';
if (file_exists($path)) {
require_once $path;
} else {
$controller = '';
}
if ($controller = $input->getWord('controller'))
{
$path = JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . $controller . '.php';

if (file_exists($path))
{
require_once $path;
}
else
{
$controller = '';
}
}

// Create the controller
$classname = 'AdmirorgalleryController' . $controller;
$controller = new $classname();
$controller = new $classname;
$controller->execute($input->getWord('task'));
$controller->redirect();
110 changes: 69 additions & 41 deletions com_admirorgallery/admin/controller.php
Original file line number Diff line number Diff line change
@@ -1,61 +1,89 @@
<?php
/**
* @version 6.0.0
* @package Admiror Gallery (component)
* @author Igor Kekeljevic & Nikola Vasiljevski
* @package Admiror.Administrator
* @subpackage com_admirorgallery
* @author Igor Kekeljevic <igor@admiror.com>
* @author Nikola Vasiljevski <nikola83@gmail.com>
* @copyright Copyright (C) 2010 - 2021 https://www.admiror-design-studio.com All Rights Reserved.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

defined('_JEXEC') or die;
defined('_JEXEC') or die();

use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\Language\Text as JText;
use Joomla\CMS\MVC\Controller\BaseController as JControllerLegacy;
use Joomla\CMS\Toolbar\ToolbarHelper as JToolBarHelper;

/**
* AdmirorgalleryController
*
* @since 1.0.0
*/
class AdmirorgalleryController extends JControllerLegacy
{
function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/admirorgallery.php';
if (!is_dir(JPATH_SITE . '/plugins/content/admirorgallery/')) {
JFactory::getApplication()->enqueueMessage(
JText::_('COM_PLUGIN_NOT_INSTALLED'), 'warning');
}
AdmirorGalleryHelper::addSubmenu(
$this->input->get('view', 'control_panel'), $this->input->get('AG_resourceType', ''));

$doc = JFactory::getDocument();
$viewType = $doc->getType();
$viewName = $this->input->get('view', $this->default_view);
$viewLayout = $this->input->get('layout', 'default', 'string');

$view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));

JToolBarHelper::help("", false, "https://www.admiror-design-studio.com/admiror-joomla-extensions/admiror-gallery/user-manuals");

if (JFactory::getUser()->authorise('core.admin', 'com_admirorgallery')) {
JToolbarHelper::preferences('com_admirorgallery');
if ($viewName == 'resourcemanager') {
JToolbarHelper::custom('ag_install', 'ag_install', 'ag_install', 'JTOOLBAR_INSTALL', false, false);
JToolbarHelper::deleteList('COM_ADMIRORGALLERY_ARE_YOU_SURE', 'ag_uninstall', 'JTOOLBAR_UNINSTALL');
} else {
JToolbarHelper::custom('AG_apply', 'publish', 'publish', 'COM_ADMIRORGALLERY_APPLY_DESC', false, false);
JToolbarHelper::custom('AG_reset', 'unpublish', 'unpublish', 'COM_ADMIRORGALLERY_RESET_DESC', false, false);
}
}
$view->sidebar = JHtmlSidebar::render();
$doc->addScriptDeclaration('
/**
* display
*
* @param mixed $cachable Can content be cached
* @param mixed $urlparams Url parameters
*
* @return void
*
* @since 1.0.0
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/admirorgallery.php';

if (!is_dir(JPATH_SITE . '/plugins/content/admirorgallery/'))
{
JFactory::getApplication()->enqueueMessage(
JText::_('COM_PLUGIN_NOT_INSTALLED'), 'warning'
);
}

AdmirorGalleryHelper::addSubmenu(
$this->input->get('view', 'control_panel'), $this->input->get('resourceType', '')
);

$doc = JFactory::getDocument();
$viewType = $doc->getType();
$viewName = $this->input->get('view', $this->name);
$viewLayout = $this->input->get('layout', 'default', 'string');

$view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));

JToolBarHelper::help("", false, "https://www.admiror-design-studio.com/admiror-joomla-extensions/admiror-gallery/user-manuals");

if (JFactory::getUser()->authorise('core.admin', 'com_admirorgallery'))
{
JToolbarHelper::preferences('com_admirorgallery');

if ($viewName == 'resourcemanager')
{
JToolbarHelper::custom('installResource', 'installResource', 'installResource', 'JTOOLBAR_INSTALL', false, false);
JToolbarHelper::deleteList('COM_ADMIRORGALLERY_ARE_YOU_SURE', 'uninstallResource', 'JTOOLBAR_UNINSTALL');
}
else
{
JToolbarHelper::custom('agApply', 'publish', 'publish', 'COM_ADMIRORGALLERY_APPLY_DESC', false, false);
JToolbarHelper::custom('agReset', 'unpublish', 'unpublish', 'COM_ADMIRORGALLERY_RESET_DESC', false, false);
}
}

$view->sidebar = JHtmlSidebar::render();
$doc->addScriptDeclaration('
AG_jQuery(function(){

// SET SHORCUTS
AG_jQuery(document).bind("keydown", "ctrl+return", function (){submitbutton("AG_apply");return false;});
AG_jQuery(document).bind("keydown", "ctrl+backspace", function (){submitbutton("AG_reset");return false;});
// SET SHORTCUTS
AG_jQuery(document).bind("keydown", "ctrl+return", function (){submitbutton("agApply");return false;});
AG_jQuery(document).bind("keydown", "ctrl+backspace", function (){submitbutton("agReset");return false;});

});//AG_jQuery(function()
');
parent::display();
}

'
);
parent::display();
}
}
67 changes: 47 additions & 20 deletions com_admirorgallery/admin/controllers/admirorgallery.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,66 @@
<?php
/**
* @version 6.0.0
* @package Admiror Gallery (component)
* @author Igor Kekeljevic & Nikola Vasiljevski
* @package Admiror.Administrator
* @subpackage com_admirorgallery
* @author Igor Kekeljevic <igor@admiror.com>
* @author Nikola Vasiljevski <nikola83@gmail.com>
* @copyright Copyright (C) 2010 - 2021 https://www.admiror-design-studio.com All Rights Reserved.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

defined('_JEXEC') or die();


/**
* AdmirorgalleryControllerAdmirorgallery
*
* @since 1.0.0
*/
class AdmirorgalleryControllerAdmirorgallery extends AdmirorgalleryController
{
function __construct()
{
parent::__construct();
/**
* __construct
*
* @since 1.0.0
*/
public function __construct()
{
parent::__construct();

// Register Extra tasks
$this->registerTask('AG_apply', 'AG_apply');
$this->registerTask('AG_reset', 'AG_reset');
}
// Register Extra tasks
$this->registerTask('agApply', 'agApply');
$this->registerTask('agReset', 'agReset');
}

function AG_apply()
{
$model = $this->getModel('admirorgallery');
/**
* agApply
*
* @return void
*
* @since 1.0.0
*/
public function agApply(): void
{
$model = $this->getModel('admirorgallery');

// UPDATE
$model->_update();
// UPDATE
$model->update();

parent::display();
}
parent::display();
}

function AG_reset()
{
parent::display();
}
/**
* agReset
*
* @return void
*
* @since 1.0.0
*/
public function agReset(): void
{
parent::display();
}


}
15 changes: 9 additions & 6 deletions com_admirorgallery/admin/controllers/button.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<?php
/**
* @version 6.0.0
* @package Admiror Gallery (component)
* @author Igor Kekeljevic & Nikola Vasiljevski
* @package Admiror.Administrator
* @subpackage com_admirorgallery
* @author Igor Kekeljevic <igor@admiror.com>
* @author Nikola Vasiljevski <nikola83@gmail.com>
* @copyright Copyright (C) 2010 - 2021 https://www.admiror-design-studio.com All Rights Reserved.
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

defined('_JEXEC') or die();

/**
* AdmirorgalleryControllerButton
*
* @since 1.0.0
*/
class AdmirorgalleryControllerButton extends AdmirorgalleryController
{
function __construct()
{
parent::__construct();
}
}
Loading