function __construct() { // remove obsolete files jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); $removeFiles = array(); $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery-1.4.2.min.js'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'js' . DS . 'jquery.clockpick.1.2.7.min.js'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'css' . DS . 'jquery.clockpick.1.2.7.css'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'ol_bg.jpg'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'archive.php'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'archive.php'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'models' . DS . 'suppression.php'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'controllers' . DS . 'suppression.php'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'helpers' . DS . 'cache.php'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'templateEditor.png'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'clearPosition.png'; $removeFiles[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'images' . DS . 'apply.png'; foreach ($removeFiles as $rf) { if (JFile::exists($rf)) { JFile::Delete($rf); } } // remove obsolete folders $removeFolders = array(); $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'assets' . DS . 'scripts'; $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'archive'; $removeFolders[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomailermailchimpintegration' . DS . 'views' . DS . 'suppression'; foreach ($removeFolders as $rf) { if (JFolder::exists($rf)) { JFolder::Delete($rf); } } parent::__construct(); $this->registerTask('install', 'install'); $this->registerTask('upgrade', 'upgrade'); }
private function onDataError($params) { if (empty($params['data'])) { JFile::Delete($params['file']); $this->setError('Cann\'t get any slider data to generate slide in module "' . $this->module_name . '". <br>Solution: Please insert data at parameter "Setting Item", introduction below. <br>   1. Field [Title] is require, please insert data here. <br>   2. After fill info, ==> You must "Save" in this tag "Setting Item" before click [save] of joomla button. <br>Many thanks!'); } }
private function onLocationError($params) { $data = json_decode($params['data'], true); if (is_null($data['query']['results'])) { JFile::Delete($params['file']); $this->setError('Cannot get "' . $this->params->get('location') . '" location id in module "' . $this->moduledir . '".'); } }
public function resizeUserAvatar($limitStart, $limit) { $db = JFactory::getDbo(); $query = "SELECT avatar FROM #__judirectory_users WHERE avatar != '' LIMIT {$limitStart}, {$limit}"; $db->setQuery($query); $images = $db->loadObjectList(); if (count($images)) { foreach ($images as $image) { $ori_image_path = JPATH_ROOT . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/images/avatar/") . 'original/' . $image->avatar; if (JFile::exists($ori_image_path)) { $image_path = JPATH_ROOT . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/images/avatar/") . $image->avatar; if (JFile::exists($image_path)) { JFile::Delete($image_path); } JUDirectoryHelper::renderImages($ori_image_path, $image_path, 'avatar'); } } } }
public function onError($params) { $data = json_decode($params['data'], true); if (isset($data['errors']) or isset($data['error'])) { JFile::Delete($params['file']); } }
private function onDataError($params) { if (empty($params['data'])) { JFile::Delete($params['file']); $this->setError('Cann\'t get any slider data to generate slide in module "' . $this->module_name . '".'); } }