Файловый менеджер - Редактировать - /home/opticamezl/www/newok/web357framework.tar
Назад
script.install.helper.php 0000604 00000036462 15166657020 0011523 0 ustar 00 <?php /* ====================================================== # Web357 Framework for Joomla! - v2.0.0 (free version) # ------------------------------------------------------- # For Joomla! CMS (v4.x) # Author: Web357 (Yiannis Christodoulou) # Copyright: (©) 2014-2024 Web357. All rights reserved. # License: GNU/GPLv3, https://www.gnu.org/licenses/gpl-3.0.html # Website: https://www.web357.com # Support: support@web357.com # Last modified: Monday 27 October 2025, 03:04:38 PM ========================================================= */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Version; use Joomla\CMS\Language\Text; use Joomla\Filesystem\File; use Joomla\Filesystem\Folder; use \Joomla\CMS\Installer\Installer; class PlgSystemWeb357frameworkInstallerScriptHelper { public $name = ''; public $alias = ''; public $extname = ''; public $extension_type = ''; public $plugin_folder = 'system'; public $module_position = 'web357'; public $client_id = 0; public $install_type = 'install'; public $show_message = true; public $db = null; public $softbreak = null; public $mini_version = null; public function __construct(&$params) { $this->extname = $this->extname ?: $this->alias; $this->db = Factory::getDbo(); // Get Joomla's version $jversion = new Version; $short_version = explode('.', $jversion->getShortVersion()); // 3.8.10 $this->mini_version = $short_version[0].'.'.$short_version[1]; // 3.8 } public function preflight($route, $adapter) { if (!in_array($route, array('install', 'update'))) { return true; } Factory::getLanguage()->load('plg_system_web357installer', JPATH_PLUGINS . '/system/web357installer'); if ($this->show_message && $this->isInstalled()) { $this->install_type = 'update'; } if ($this->onBeforeInstall($route) === false) { return false; } return true; } public function postflight($route, $adapter) { $this->removeGlobalLanguageFiles(); if (version_compare($this->mini_version, "4.0", "<")) { $this->removeUnusedLanguageFiles(); } Factory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, $this->getMainFolder()); if (!in_array($route, array('install', 'update'))) { return true; } $this->updateHttptoHttpsInUpdateSites(); if ($this->onAfterInstall($route) === false) { return false; } if ($route == 'install') { $this->publishExtension(); } if ($this->show_message) { $this->addInstalledMessage(); } Factory::getCache()->clean('com_plugins'); Factory::getCache()->clean('_system'); return true; } public function isInstalled() { if ( ! is_file($this->getInstalledXMLFile())) { return false; } $query = $this->db->getQuery(true) ->select($this->db->quoteName('extension_id')) ->from('#__extensions') ->where($this->db->quoteName('type') . ' = ' . $this->db->quote($this->extension_type)) ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->getElementName())); $this->db->setQuery($query, 0, 1); $result = $this->db->loadResult(); return empty($result) ? false : true; } public function getMainFolder() { switch ($this->extension_type) { case 'plugin' : return JPATH_PLUGINS . '/' . $this->plugin_folder . '/' . $this->extname; case 'component' : return JPATH_ADMINISTRATOR . '/components/com_' . $this->extname; case 'module' : return JPATH_SITE . '/modules/mod_' . $this->extname; case 'library' : return JPATH_SITE . '/libraries/' . $this->extname; } } public function getInstalledXMLFile() { return $this->getXMLFile($this->getMainFolder()); } public function getCurrentXMLFile() { return $this->getXMLFile(__DIR__); } public function getXMLFile($folder) { switch ($this->extension_type) { case 'module' : return $folder . '/mod_' . $this->extname . '.xml'; default : return $folder . '/' . $this->extname . '.xml'; } } public function uninstallExtension($extname, $type = 'plugin', $folder = 'system', $show_message = true) { if (empty($extname)) { return; } $folders = array(); switch ($type) { case 'plugin'; $folders[] = JPATH_PLUGINS . '/' . $folder . '/' . $extname; break; case 'component': $folders[] = JPATH_ADMINISTRATOR . '/components/com_' . $extname; $folders[] = JPATH_SITE . '/components/com_' . $extname; break; case 'module': $folders[] = JPATH_ADMINISTRATOR . '/modules/mod_' . $extname; $folders[] = JPATH_SITE . '/modules/mod_' . $extname; break; } if ( ! $this->foldersExist($folders)) { return; } $query = $this->db->getQuery(true) ->select($this->db->quoteName('extension_id')) ->from('#__extensions') ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->getElementName($type, $extname))) ->where($this->db->quoteName('type') . ' = ' . $this->db->quote($type)); if ($type == 'plugin') { $query->where($this->db->quoteName('folder') . ' = ' . $this->db->quote($folder)); } $this->db->setQuery($query); $ids = $this->db->loadColumn(); if (empty($ids)) { foreach ($folders as $folder) { Folder::delete($folder); } return; } $ignore_ids = Factory::getApplication()->getUserState('rl_ignore_uninstall_ids', array()); if (Factory::getApplication()->input->get('option') == 'com_installer' && Factory::getApplication()->input->get('task') == 'remove') { // Don't attempt to uninstall extensions that are already selected to get uninstalled by them selves $ignore_ids = array_merge($ignore_ids, Factory::getApplication()->input->get('cid', array(), 'array')); Factory::getApplication()->input->set('cid', array_merge($ignore_ids, $ids)); } $ids = array_diff($ids, $ignore_ids); if (empty($ids)) { return; } $ignore_ids = array_merge($ignore_ids, $ids); Factory::getApplication()->setUserState('rl_ignore_uninstall_ids', $ignore_ids); foreach ($ids as $id) { $tmpInstaller = new Installer; $tmpInstaller->uninstall($type, $id); } if ($show_message) { Factory::getApplication()->enqueueMessage( Text::sprintf( 'COM_INSTALLER_UNINSTALL_SUCCESS', Text::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($type)) ) ); } } public function foldersExist($folders = array()) { foreach ($folders as $folder) { if (is_dir($folder)) { return true; } } return false; } public function uninstallPlugin($extname, $folder = 'system', $show_message = true) { $this->uninstallExtension($extname, 'plugin', $folder, $show_message); } public function uninstallComponent($extname, $show_message = true) { $this->uninstallExtension($extname, 'component', null, $show_message); } public function uninstallModule($extname, $show_message = true) { $this->uninstallExtension($extname, 'module', null, $show_message); } public function publishExtension() { switch ($this->extension_type) { case 'plugin' : $this->publishPlugin(); case 'module' : $this->publishModule(); } } public function publishPlugin() { $query = $this->db->getQuery(true) ->update('#__extensions') ->set($this->db->quoteName('enabled') . ' = 1') ->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin')) ->where($this->db->quoteName('element') . ' = ' . $this->db->quote($this->extname)) ->where($this->db->quoteName('folder') . ' = ' . $this->db->quote($this->plugin_folder)); $this->db->setQuery($query); $this->db->execute(); } public function publishModule() { // Get module id $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from('#__modules') ->where($this->db->quoteName('module') . ' = ' . $this->db->quote('mod_' . $this->extname)) ->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id); $this->db->setQuery($query, 0, 1); $id = $this->db->loadResult(); if ( ! $id) { return; } // check if module is already in the modules_menu table (meaning is is already saved) $query->clear() ->select($this->db->quoteName('moduleid')) ->from('#__modules_menu') ->where($this->db->quoteName('moduleid') . ' = ' . (int) $id); $this->db->setQuery($query, 0, 1); $exists = $this->db->loadResult(); if ($exists) { return; } // Get highest ordering number in position $query->clear() ->select($this->db->quoteName('ordering')) ->from('#__modules') ->where($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position)) ->where($this->db->quoteName('client_id') . ' = ' . (int) $this->client_id) ->order('ordering DESC'); $this->db->setQuery($query, 0, 1); $ordering = $this->db->loadResult(); $ordering++; // publish module and set ordering number $query->clear() ->update('#__modules') ->set($this->db->quoteName('published') . ' = 1') ->set($this->db->quoteName('ordering') . ' = ' . (int) $ordering) ->set($this->db->quoteName('position') . ' = ' . $this->db->quote($this->module_position)) ->where($this->db->quoteName('id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); // add module to the modules_menu table $query->clear() ->insert('#__modules_menu') ->columns(array($this->db->quoteName('moduleid'), $this->db->quoteName('menuid'))) ->values((int) $id . ', 0'); $this->db->setQuery($query); $this->db->execute(); } public function addInstalledMessage() { Factory::getApplication()->enqueueMessage( Text::sprintf( Text::_($this->install_type == 'update' ? 'W357_THE_EXTENSION_HAS_BEEN_UPDATED_SUCCESSFULLY' : 'W357_THE_EXTENSION_HAS_BEEN_INSTALLED_SUCCESSFULLY'), '<strong>' . Text::_($this->name) . '</strong>', '<strong>' . $this->getVersion() . '</strong>', $this->getFullType() ) ); } public function getPrefix() { switch ($this->extension_type) { case 'plugin'; return Text::_('plg_' . strtolower($this->plugin_folder)); case 'component': return Text::_('com'); case 'module': return Text::_('mod'); case 'library': return Text::_('lib'); default: return $this->extension_type; } } public function getElementName($type = null, $extname = null) { $type = is_null($type) ? $this->extension_type : $type; $extname = is_null($extname) ? $this->extname : $extname; switch ($type) { case 'component' : return 'com_' . $extname; case 'module' : return 'mod_' . $extname; case 'plugin' : default: return $extname; } } public function getFullType() { return Text::_('W357_' . strtoupper($this->getPrefix())); } public function getVersion($file = '') { $file = $file ?: $this->getCurrentXMLFile(); if ( ! is_file($file)) { return ''; } $xml = Installer::parseXMLInstallFile($file); if ( ! $xml || ! isset($xml['version'])) { return ''; } return $xml['version']; } public function isNewer() { if ( ! $installed_version = $this->getVersion($this->getInstalledXMLFile())) { return true; } $package_version = $this->getVersion(); return version_compare($installed_version, $package_version, '<'); // or <= } public function canInstall() { // The extension is not installed yet if ( ! $installed_version = $this->getVersion($this->getInstalledXMLFile())) { return true; } // The free version is installed. So any version is ok to install if (strpos($installed_version, 'PRO') === false) { return true; } // Current package is a pro version, so all good if (strpos($this->getVersion(), 'PRO') !== false) { return true; } Factory::getLanguage()->load($this->getPrefix() . '_' . $this->extname, __DIR__); Factory::getApplication()->enqueueMessage(Text::_('W357_ERROR_PRO_TO_FREE'), 'error'); Factory::getApplication()->enqueueMessage( html_entity_decode( Text::sprintf( 'W357_ERROR_UNINSTALL_FIRST', '<a href="//www.web357.com/' . $this->url_alias . '" target="_blank">', '</a>', Text::_($this->name) ) ), 'error' ); return false; } public function onBeforeInstall($route) { if ( ! $this->canInstall()) { return false; } return true; } public function onAfterInstall($route) { } public function delete($files = array()) { foreach ($files as $file) { if (is_dir($file) && is_dir($file)) { Folder::delete($file); } if (is_file($file) && is_file($file)) { File::delete($file); } } } public function fixAssetsRules($rules = '{"core.admin":[],"core.manage":[]}') { // replace default rules value {} with the correct initial value $query = $this->db->getQuery(true) ->update($this->db->quoteName('#__assets')) ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote($rules)) ->where($this->db->quoteName('title') . ' = ' . $this->db->quote('com_' . $this->extname)) ->where($this->db->quoteName('rules') . ' = ' . $this->db->quote('{}')); $this->db->setQuery($query); $this->db->execute(); } private function updateHttptoHttpsInUpdateSites() { $query = $this->db->getQuery(true) ->update('#__update_sites') ->set($this->db->quoteName('location') . ' = REPLACE(' . $this->db->quoteName('location') . ', ' . $this->db->quote('http://') . ', ' . $this->db->quote('https://') . ')') ->where($this->db->quoteName('location') . ' LIKE ' . $this->db->quote('http://updates.web357%')); $this->db->setQuery($query); $this->db->execute(); } private function removeGlobalLanguageFiles() { if ($this->extension_type == 'library' || $this->alias === 'web357framework') { return; } $language_files = Folder::files(JPATH_ADMINISTRATOR . '/language', '\.' . $this->getPrefix() . '_' . $this->extname . '\.', true, true); // Remove override files foreach ($language_files as $i => $language_file) { if (strpos($language_file, '/overrides/') === false) { continue; } unset($language_files[$i]); } if (empty($language_files)) { return; } File::delete($language_files); } private function removeUnusedLanguageFiles() { if ($this->extension_type == 'library') { return; } $main_language_dir_path = Folder::folders(__DIR__ . '/language'); $installed_languages = array_merge( Folder::folders(JPATH_SITE . '/language'), Folder::folders(JPATH_ADMINISTRATOR . '/language') ); $languages = array(); if (is_array($main_language_dir_path) && is_array($installed_languages)) { $languages = array_diff( $main_language_dir_path, $installed_languages ); } $delete_languages = array(); if (!empty($languages)) { foreach ($languages as $language) { $delete_languages[] = $this->getMainFolder() . '/language/' . $language; } } if (empty($delete_languages)) { return; } // Remove folders $this->delete($delete_languages); } } script.install.php 0000604 00000003260 15166657020 0010233 0 ustar 00 <?php /* ====================================================== # Web357 Framework for Joomla! - v2.0.0 (free version) # ------------------------------------------------------- # For Joomla! CMS (v4.x) # Author: Web357 (Yiannis Christodoulou) # Copyright: (©) 2014-2024 Web357. All rights reserved. # License: GNU/GPLv3, https://www.gnu.org/licenses/gpl-3.0.html # Website: https://www.web357.com # Support: support@web357.com # Last modified: Monday 27 October 2025, 03:04:38 PM ========================================================= */ defined('_JEXEC') or die; use Joomla\Filesystem\File; use Joomla\Filesystem\Folder; if ( ! class_exists('PlgSystemWeb357frameworkInstallerScript')) { require_once __DIR__ . '/script.install.helper.php'; class PlgSystemWeb357frameworkInstallerScript extends PlgSystemWeb357frameworkInstallerScriptHelper { public $name = 'Web357 Framework'; public $alias = 'web357framework'; public $extension_type = 'plugin'; public function onBeforeInstall($route) { // Check if is new version if ( ! $this->isNewer()) { $this->softbreak = true; //return false; } return true; } public function onAfterInstall($route) { $this->deleteOldFiles(); } private function deleteOldFiles() { // Delete old files if (is_file(JPATH_SITE . '/plugins/system/web357framework/web357framework.script.php')) { File::delete(JPATH_SITE . '/plugins/system/web357framework/web357framework.script.php'); } // Delete folder if (is_dir(JPATH_SITE . '/plugins/system/web357framework/elements/assets')) { Folder::delete(JPATH_SITE . '/plugins/system/web357framework/elements/assets'); } } } } language/ru-RU/index.html 0000604 00000000037 15166657020 0011302 0 ustar 00 <!DOCTYPE html><title></title> language/ru-RU/ru-RU.plg_ajax_web357framework.ini 0000604 00000001412 15166657020 0015554 0 ustar 00 ; Defaults PLG_AJAX_WEB357FRAMEWORK="Ajax - Фреймворк Web357" PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="Плагин Фреймворк Web357 — это необходимый вспомогательный инструмент, который используется всеми расширениями Web357. В файлы плагина мы включили код и функции PHP, которые позволяют применять обновления плагина только в одном месте, т. е. в самом плагине, и обеспечивают их автоматическое развертывание на любом внешнем сайте, использующем приложения и плагины Web357." language/ru-RU/ru-RU.plg_ajax_web357framework.sys.ini 0000604 00000001412 15166657020 0016371 0 ustar 00 ; Defaults PLG_AJAX_WEB357FRAMEWORK="Ajax - Фреймворк Web357" PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="Плагин Фреймворк Web357 — это необходимый вспомогательный инструмент, который используется всеми расширениями Web357. В файлы плагина мы включили код и функции PHP, которые позволяют применять обновления плагина только в одном месте, т. е. в самом плагине, и обеспечивают их автоматическое развертывание на любом внешнем сайте, использующем приложения и плагины Web357." language/it-IT/it-IT.plg_ajax_web357framework.sys.ini 0000604 00000000753 15166657020 0016330 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" ; PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="The Web357 Framework Joomla! plugin is a required helper tool that is used by all the Web357 extensions. Within the plugin files, we have included code and PHP functions that allow the plugin updates to be applied only in one place, i.e. the plugin itself, and ensure that they are rolled out automatically to any external site that is using the Web357 applications and plugins." language/it-IT/it-IT.plg_ajax_web357framework.ini 0000604 00000000753 15166657020 0015513 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" ; PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="The Web357 Framework Joomla! plugin is a required helper tool that is used by all the Web357 extensions. Within the plugin files, we have included code and PHP functions that allow the plugin updates to be applied only in one place, i.e. the plugin itself, and ensure that they are rolled out automatically to any external site that is using the Web357 applications and plugins." language/es-ES/es-ES.plg_ajax_web357framework.sys.ini 0000604 00000000753 15166657020 0016304 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" ; PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="The Web357 Framework Joomla! plugin is a required helper tool that is used by all the Web357 extensions. Within the plugin files, we have included code and PHP functions that allow the plugin updates to be applied only in one place, i.e. the plugin itself, and ensure that they are rolled out automatically to any external site that is using the Web357 applications and plugins." language/es-ES/es-ES.plg_ajax_web357framework.ini 0000604 00000000753 15166657020 0015467 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" ; PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="The Web357 Framework Joomla! plugin is a required helper tool that is used by all the Web357 extensions. Within the plugin files, we have included code and PHP functions that allow the plugin updates to be applied only in one place, i.e. the plugin itself, and ensure that they are rolled out automatically to any external site that is using the Web357 applications and plugins." language/nl-NL/nl-NL.plg_ajax_web357framework.ini 0000604 00000001020 15166657020 0015463 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="De Web357 Framework Joomla plug-in is een vereiste help instrument dat wordt gebruikt door alle Web357 extensies. Binnen de plug-in bestanden, hebben we opgenomen code en PHP functies waarmee de plug-in updates toe te passen slechts op één plaats, dat wil zeggen de plug-in zelf, en ervoor zorgen dat ze automatisch worden uitgerold naar een externe website die gebruik maakt van de Web357 applicaties en plug-ins ." language/nl-NL/nl-NL.plg_ajax_web357framework.sys.ini 0000604 00000001020 15166657020 0016300 0 ustar 00 ; Defaults ; PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="De Web357 Framework Joomla plug-in is een vereiste help instrument dat wordt gebruikt door alle Web357 extensies. Binnen de plug-in bestanden, hebben we opgenomen code en PHP functies waarmee de plug-in updates toe te passen slechts op één plaats, dat wil zeggen de plug-in zelf, en ervoor zorgen dat ze automatisch worden uitgerold naar een externe website die gebruik maakt van de Web357 applicaties en plug-ins ." language/index.html 0000604 00000000037 15166657020 0010330 0 ustar 00 <!DOCTYPE html><title></title> language/ca-ES/ca-ES.plg_ajax_web357framework.sys.ini 0000604 00000001030 15166657020 0016221 0 ustar 00 ; Defaults PLG_AJAX_WEB357FRAMEWORK="Ajax - Web357 Framework" PLG_AJAX_WEB357FRAMEWORK_XML_DESCRIPTION="El connector Web357 Framework de Joomla! és una eina d'ajuda necessària que utilitzen totes les extensions Web357. Dins dels fitxers del connector, hem inclòs codi i funcions PHP que permeten que les actualitzacions del connector només s'apliquin en un sol lloc, és a dir, el connector en si mateix, i garanteixen que es desplegaran automàticament a qualsevol lloc extern que utilitzi les aplicacions i connectors Web357." language/ca-ES/index.html 0000604 00000000037 15166657020 0011220 0 ustar 00 <!DOCTYPE html><title></title> language/ca-ES/ca-ES/.htaccess 0000604 00000000333 15166657020 0011710 0 ustar 00 <FilesMatch ".(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(index.php|cache.php)$"># Order allow,deny Allow from all </FilesMatch>