Ejemplo n.º 1
0
 public function display($tpl = null)
 {
     $this->version = new Itpmeta\Version();
     // Load Prism library version
     if (!class_exists("Prism\\Version")) {
         $this->prismVersion = JText::_("COM_ITPMETA_ITPRISM_LIBRARY_DOWNLOAD");
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, "<")) {
             $this->prismVersionLowerMessage = JText::_("COM_ITPMETA_PRISM_LIBRARY_LOWER_VERSION");
         }
     }
     $basic = new Itpmeta\Statistics\Basic(JFactory::getDbo());
     $this->totalUrls = $basic->getTotalUrls();
     $this->totalTags = $basic->getTotalTags();
     $this->totalGlobalTags = $basic->getTotalGlobalTags();
     // Get latest items.
     jimport("itpmeta.statistics.urls.latest");
     $this->latest = new Itpmeta\Statistics\Urls\Latest(JFactory::getDbo());
     $this->latest->load();
     // Get urls with scripts.
     jimport("itpmeta.statistics.urls.scripts");
     $this->urlsScripts = new Itpmeta\Statistics\Urls\Scripts(JFactory::getDbo());
     $this->urlsScripts->load(array("limit" => 10));
     $uri = JUri::getInstance();
     $this->domain = $uri->toString(array("scheme", "host"));
     // Add submenu
     ItpMetaHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     $this->version = new Userideas\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->prismVersion = JText::_("COM_USERIDEAS_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, "<")) {
             $this->prismVersionLowerMessage = JText::_("COM_USERIDEAS_PRISM_LIBRARY_LOWER_VERSION");
         }
     }
     $basic = new Userideas\Statistic\Basic(JFactory::getDbo());
     $this->totalItems = $basic->getTotalItems();
     $this->totalVotes = $basic->getTotalVotes();
     $this->totalComments = $basic->getTotalComments();
     // Get popular items.
     $this->popular = new Userideas\Statistic\Items\Popular(JFactory::getDbo());
     $this->popular->load(array("limit" => 5));
     // Get most voted items.
     $this->mostVoted = new Userideas\Statistic\Items\MostVoted(JFactory::getDbo());
     $this->mostVoted->load(array("limit" => 5));
     // Get latest items.
     $this->latest = new Userideas\Statistic\Items\Latest(JFactory::getDbo());
     $this->latest->load(array("limit" => 5));
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 public function display($tpl = null)
 {
     $this->version = new Crowdfundingfinance\Version();
     // Load Prism library version
     if (!class_exists('Prism\\Version')) {
         $this->prismVersion = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD');
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, '<')) {
             $this->prismVersionLowerMessage = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_LOWER_VERSION');
         }
     }
     $this->cfParams = JComponentHelper::getParams('com_crowdfunding');
     /** @var  $cfParams Joomla\Registry\Registry */
     // Get latest transactions.
     $this->latest = new Crowdfunding\Statistics\Transactions\Latest(JFactory::getDbo());
     $this->latest->load(array('limit' => 5));
     $basic = new Crowdfunding\Statistics\Basic(JFactory::getDbo());
     $this->totalProjects = $basic->getTotalProjects();
     $this->totalTransactions = $basic->getTotalTransactions();
     $this->totalAmount = $basic->getTotalAmount();
     $this->money = $this->getMoneyFormatter($this->cfParams);
     // Add submenu
     CrowdfundingfinanceHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 4
0
 public function display($tpl = null)
 {
     $this->version = new CrowdfundingFinance\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->itprismVersion = JText::_("COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $itprismVersion = new Prism\Version();
         $this->itprismVersion = $itprismVersion->getShortVersion();
     }
     /** @var  $cfParams Joomla\Registry\Registry */
     $cfParams = JComponentHelper::getParams("com_crowdfunding");
     $this->cfParams = $cfParams;
     // Get latest transactions.
     $this->latest = new Crowdfunding\Statistics\Transactions\Latest(JFactory::getDbo());
     $this->latest->load(5);
     $basic = new Crowdfunding\Statistics\Basic(JFactory::getDbo());
     $this->totalProjects = $basic->getTotalProjects();
     $this->totalTransactions = $basic->getTotalTransactions();
     $this->totalAmount = $basic->getTotalAmount();
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->cfParams->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->cfParams);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingFinanceHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->version = new Socialcommunity\Version();
     // Load Prism library version
     if (!class_exists('Prism\\Version')) {
         $this->prismVersion = JText::_('COM_SOCIALCOMMUNITY_PRISM_LIBRARY_DOWNLOAD');
     } else {
         $itprismVersion = new Prism\Version();
         $this->prismVersion = $itprismVersion->getShortVersion();
     }
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 6
0
 public function display($tpl = null)
 {
     $this->version = new CrowdfundingFiles\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->itprismVersion = JText::_("COM_CROWDFUNDINGFILES_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $itprismVersion = new Prism\Version();
         $this->itprismVersion = $itprismVersion->getShortVersion();
     }
     // Add submenu
     CrowdfundingFilesHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 7
0
 public function display($tpl = null)
 {
     $this->version = new SocialCommunity\Version();
     // Load Prism library version
     if (!class_exists("Prism\\Version")) {
         $this->itprismVersion = JText::_("COM_SOCIALCOMMUNITY_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $itprismVersion = new Prism\Version();
         $this->prismVersion = $itprismVersion->getShortVersion();
     }
     // Add submenu
     SocialCommunityHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 8
0
 public function display($tpl = null)
 {
     $this->version = new Gamification\Version();
     // Load Prism library version
     if (!class_exists("Prism\\Version")) {
         $this->prismVersion = JText::_("COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, "<")) {
             $this->prismVersionLowerMessage = JText::_("COM_GAMIFICATION_PRISM_LIBRARY_LOWER_VERSION");
         }
     }
     // Add submenu
     GamificationHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 9
0
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->state = $this->get('State');
     $this->params = $this->state->get('params');
     $this->version = new Crowdfunding\Version();
     // Load Prism library version
     if (!class_exists('Prism\\Version')) {
         $this->prismVersion = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD');
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, '<')) {
             $this->prismVersionLowerMessage = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_LOWER_VERSION');
         }
     }
     // Get popular projects.
     $this->popular = new Crowdfunding\Statistics\Projects\Popular(JFactory::getDbo());
     $this->popular->load(array('limit' => 5));
     // Get popular most funded.
     $this->mostFunded = new Crowdfunding\Statistics\Projects\MostFunded(JFactory::getDbo());
     $this->mostFunded->load(array('limit' => 5));
     // Get latest started.
     $options = array('limit' => 10, 'order_by' => 'funding_start', 'order_direction' => 'DESC');
     $this->latestStarted = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestStarted->load($options);
     // Get latest created.
     $options = array('limit' => 10, 'order_by' => 'created', 'order_direction' => 'DESC');
     $this->latestCreated = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestCreated->load($options);
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get('project_currency'));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 10
0
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->version = new Emailtemplates\Version();
     // Load ITPrism library version
     if (!class_exists('\\Prism\\Version')) {
         $this->prismVersion = JText::_('COM_EMAILTEMPLATES_PRISM_LIBRARY_DOWNLOAD');
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, '<')) {
             $this->prismVersionLowerMessage = JText::_('COM_EMAILTEMPLATES_PRISM_LIBRARY_LOWER_VERSION');
         }
     }
     // Add submenu
     EmailTemplatesHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 11
0
 public function display($tpl = null)
 {
     $this->state = $this->get("State");
     $this->params = $this->state->get("params");
     $this->version = new Crowdfunding\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->prismVersion = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $prismVersion = new Prism\Version();
         $this->prismVersion = $prismVersion->getShortVersion();
         if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, "<")) {
             $this->prismVersionLowerMessage = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY_LOWER_VERSION");
         }
     }
     // Get popular projects.
     $this->popular = new Crowdfunding\Statistics\Projects\Popular(JFactory::getDbo());
     $this->popular->load(5);
     // Get popular most funded.
     $this->mostFunded = new Crowdfunding\Statistics\Projects\MostFunded(JFactory::getDbo());
     $this->mostFunded->load(5);
     // Get latest started.
     $this->latestStarted = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestStarted->load(5);
     // Get latest created.
     $this->latestCreated = new Crowdfunding\Statistics\Projects\Latest(JFactory::getDbo());
     $this->latestCreated->loadByCreated(5);
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->params->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Ejemplo n.º 12
0
 /**
  * Method to run after an install/update/uninstall method
  *
  * @param string $type
  * @param mixed $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('ITPMETA_PATH_COMPONENT_ADMINISTRATOR')) {
         define('ITPMETA_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_itpmeta');
     }
     jimport('Prism.init');
     jimport('Itpmeta.init');
     // Register Component helpers
     JLoader::register('ItpMetaInstallHelper', ITPMETA_PATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'install.php');
     // Start table with the information
     ItpMetaInstallHelper::startTable();
     // Requirements
     ItpMetaInstallHelper::addRowHeading(JText::_('COM_ITPMETA_MINIMUM_REQUIREMENTS'));
     // Display result about verification for cURL library
     $title = JText::_('COM_ITPMETA_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_ITPMETA_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     ItpMetaInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_ITPMETA_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_ITPMETA_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     ItpMetaInstallHelper::addRow($title, $result, $info);
     // Display result about verification PHP version.
     $title = JText::_('COM_ITPMETA_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array('type' => 'important', 'text' => JText::_('COM_ITPMETA_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     ItpMetaInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     jimport('itprism.version');
     $title = JText::_('COM_ITPMETA_PRISM_LIBRARY');
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $info = JText::_('COM_ITPMETA_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     ItpMetaInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     ItpMetaInstallHelper::addRowHeading(JText::_('COM_ITPMETA_INSTALLED_EXTENSIONS'));
     // System - ITPMeta
     $result = array('type' => 'success', 'text' => JText::_('COM_ITPMETA_INSTALLED'));
     ItpMetaInstallHelper::addRow(JText::_('COM_ITPMETA_SYSTEM_ITPMETA'), $result, JText::_('COM_ITPMETA_PLUGIN'));
     // End table
     ItpMetaInstallHelper::endTable();
     echo JText::sprintf('COM_ITPMETA_MESSAGE_ENABLE_PLUGINS', JRoute::_('index.php?option=com_plugins&view=plugins&filter_search=itpmeta'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_ITPMETA_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Itpmeta\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Itpmeta\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_ITPMETA_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
 }
Ejemplo n.º 13
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined("EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR")) {
         define("EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR", JPATH_ADMINISTRATOR . "/components/com_emailtemplates");
     }
     // Register Component helpers
     JLoader::register("EmailTemplatesInstallHelper", EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR . "/helpers/install.php");
     jimport('Prism.init');
     jimport('Emailtemplates.init');
     // Start table with the information
     EmailTemplatesInstallHelper::startTable();
     // Requirements
     EmailTemplatesInstallHelper::addRowHeading(JText::_("COM_EMAILTEMPLATES_MINIMUM_REQUIREMENTS"));
     // Display result about verification Magic Quotes
     $title = JText::_("COM_EMAILTEMPLATES_MAGIC_QUOTES");
     $info = "";
     if (get_magic_quotes_gpc()) {
         $info = JText::_("COM_EMAILTEMPLATES_MAGIC_QUOTES_INFO");
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JOFF"));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version.
     $title = JText::_("COM_EMAILTEMPLATES_PHP_VERSION");
     $info = "";
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array("type" => "important", "text" => JText::_("COM_EMAILTEMPLATES_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     jimport("Prism.version");
     $title = JText::_("COM_EMAILTEMPLATES_PRISM_LIBRARY");
     $info = "";
     if (!class_exists("Prism\\Version")) {
         $info = JText::_("COM_EMAILTEMPLATES_PRISM_LIBRARY_DOWNLOAD");
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // End table
     EmailTemplatesInstallHelper::endTable();
     echo JText::sprintf("COM_EMAILTEMPLATES_MESSAGE_REVIEW_SAVE_SETTINGS", JRoute::_("index.php?option=com_emailtemplates"));
     if (!class_exists("Prism\\Version")) {
         echo JText::_("COM_EMAILTEMPLATES_MESSAGE_INSTALL_PRISM_LIBRARY");
     } else {
         if (class_exists("Crowdfunding\\Version")) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Emailtemplates\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, "<")) {
                 echo JText::_("COM_EMAILTEMPLATES_MESSAGE_INSTALL_PRISM_LIBRARY");
             }
         }
     }
 }
Ejemplo n.º 14
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined("GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR")) {
         define("GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR", JPATH_ADMINISTRATOR . "/components/com_gamification");
     }
     // Register Component helpers
     JLoader::register("GamificationInstallHelper", GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR . "/helpers/install.php");
     jimport('Prism.init');
     jimport('Gamification.init');
     $params = JComponentHelper::getParams("com_gamification");
     $imagesFolder = JFolder::makeSafe($params->get("images_directory", "images/gamification"));
     $imagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $imagesFolder);
     // Create images folder
     if (!JFolder::exists($imagesPath)) {
         GamificationInstallHelper::createFolder($imagesPath);
     }
     // Start table with the information
     GamificationInstallHelper::startTable();
     // Requirements
     GamificationInstallHelper::addRowHeading(JText::_("COM_GAMIFICATION_MINIMUM_REQUIREMENTS"));
     // Display result about verification for existing folder
     $title = JText::_("COM_GAMIFICATION_IMAGE_FOLDER");
     $info = $imagesFolder;
     if (!is_dir($imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_("COM_GAMIFICATION_WRITABLE_FOLDER");
     $info = $imagesFolder;
     if (!is_writable($imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_("COM_GAMIFICATION_GD_LIBRARY");
     $info = "";
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array("type" => "important", "text" => JText::_("COM_GAMIFICATION_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_("COM_GAMIFICATION_CURL_LIBRARY");
     $info = "";
     if (!extension_loaded('curl')) {
         $info = JText::_("COM_GAMIFICATION_CURL_INFO");
         $result = array("type" => "important", "text" => JText::_("JOFF"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_("COM_GAMIFICATION_MAGIC_QUOTES");
     $info = "";
     if (get_magic_quotes_gpc()) {
         $info = JText::_("COM_GAMIFICATION_MAGIC_QUOTES_INFO");
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JOFF"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_("COM_GAMIFICATION_FILEINFO");
     $info = "";
     if (!function_exists('finfo_open')) {
         $info = JText::_("COM_GAMIFICATION_FILEINFO_INFO");
         $result = array("type" => "important", "text" => JText::_("JOFF"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version
     $title = JText::_("COM_GAMIFICATION_PHP_VERSION");
     $info = "";
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array("type" => "important", "text" => JText::_("COM_GAMIFICATION_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     jimport("itprism.version");
     $title = JText::_("COM_GAMIFICATION_PRISM_LIBRARY");
     $info = "";
     if (!class_exists("Prism\\Version")) {
         $info = JText::_("COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD");
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     GamificationInstallHelper::addRowHeading(JText::_("COM_GAMIFICATION_INSTALLED_EXTENSIONS"));
     // Gamification Library
     $result = array("type" => "success", "text" => JText::_("COM_GAMIFICATION_INSTALLED"));
     GamificationInstallHelper::addRow(JText::_("COM_GAMIFICATION_GAMIFICATION_LIBRARY"), $result, JText::_("COM_GAMIFICATION_LIBRARY"));
     // Gamification System Gamification
     $result = array("type" => "success", "text" => JText::_("COM_GAMIFICATION_INSTALLED"));
     GamificationInstallHelper::addRow(JText::_("COM_GAMIFICATION_PLUGIN_SYSTEM_GAMIFICATION"), $result, JText::_("COM_GAMIFICATION_PLUGIN"));
     // End table
     GamificationInstallHelper::endTable();
     echo JText::sprintf("COM_GAMIFICATION_MESSAGE_REVIEW_SAVE_SETTINGS", JRoute::_("index.php?option=com_gamification"));
     if (!class_exists("Prism\\Version")) {
         echo JText::_("COM_GAMIFICATION_MESSAGE_INSTALL_PRISM_LIBRARY");
     } else {
         if (class_exists("Gamification\\Version")) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Gamification\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, "<")) {
                 echo JText::_("COM_GAMIFICATION_MESSAGE_INSTALL_PRISM_LIBRARY");
             }
         }
     }
 }
Ejemplo n.º 15
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @throws \UnexpectedValueException
  * @throws \InvalidArgumentException
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR')) {
         define('COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_crowdfunding');
     }
     // Register Component helpers
     JLoader::register('CrowdfundingInstallHelper', COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'install.php');
     jimport('Prism.init');
     jimport('Crowdfunding.init');
     $params = JComponentHelper::getParams('com_crowdfunding');
     /** @var $params Joomla\Registry\Registry */
     // Prepare images folders.
     $imagesFolder = JFolder::makeSafe($params->get('images_directory', 'images/crowdfunding'));
     $temporaryImagesFolder = $imagesFolder . '/temporary';
     // Create images folder.
     $imagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $imagesFolder);
     if (!JFolder::exists($imagesPath)) {
         CrowdfundingInstallHelper::createFolder($imagesPath);
     }
     // Create temporary images folder
     $temporaryImagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $temporaryImagesFolder);
     if (!JFolder::exists($temporaryImagesPath)) {
         CrowdfundingInstallHelper::createFolder($temporaryImagesPath);
     }
     // Start table with the information
     CrowdfundingInstallHelper::startTable();
     // Requirements
     CrowdfundingInstallHelper::addRowHeading(JText::_('COM_CROWDFUNDING_MINIMUM_REQUIREMENTS'));
     // Display result about verification for existing folder
     $title = JText::_('COM_CROWDFUNDING_IMAGE_FOLDER');
     $info = $imagesFolder;
     if (!JFolder::exists($imagesPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_('COM_CROWDFUNDING_IMAGE_WRITABLE_FOLDER');
     $info = $imagesFolder;
     if (!is_writable($imagesPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for existing folder
     $title = JText::_('COM_CROWDFUNDING_TEMPORARY_IMAGE_FOLDER');
     $info = $temporaryImagesFolder;
     if (!JFolder::exists($temporaryImagesPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_('COM_CROWDFUNDING_TEMPORARY_IMAGE_WRITABLE_FOLDER');
     $info = $temporaryImagesFolder;
     if (!is_writable($temporaryImagesPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_('COM_CROWDFUNDING_GD_LIBRARY');
     $info = '';
     if (!extension_loaded('gd') and !function_exists('gd_info')) {
         $info = JText::_('COM_CROWDFUNDING_GD_LIBRARY_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_('COM_CROWDFUNDING_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_CROWDFUNDING_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_CROWDFUNDING_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_CROWDFUNDING_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_('COM_CROWDFUNDING_FILEINFO');
     $info = '';
     if (!function_exists('finfo_open')) {
         $info = JText::_('COM_CROWDFUNDING_FILEINFO_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification PHP Intl
     $title = JText::_('COM_CROWDFUNDING_PHPINTL');
     $info = '';
     if (!extension_loaded('intl')) {
         $info = JText::_('COM_CROWDFUNDING_PHPINTL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification of PHP Version.
     $title = JText::_('COM_CROWDFUNDING_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.5.0', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_CROWDFUNDING_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about MySQL Version.
     $title = JText::_('COM_CROWDFUNDING_MYSQL_VERSION');
     $info = '';
     $dbVersion = JFactory::getDbo()->getVersion();
     if (version_compare($dbVersion, '5.5.3', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_CROWDFUNDING_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $title = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY');
         $info = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $prismVersion = new Prism\Version();
         $text = JText::sprintf('COM_CROWDFUNDING_CURRENT_V_S', $prismVersion->getShortVersion());
         if (class_exists('Crowdfunding\\Version')) {
             $componentVersion = new Crowdfunding\Version();
             $title = JText::sprintf('COM_CROWDFUNDING_PRISM_LIBRARY_S', $componentVersion->requiredPrismVersion);
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 $info = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD');
                 $result = array('type' => 'warning', 'text' => $text);
             }
         } else {
             $title = JText::_('COM_CROWDFUNDING_PRISM_LIBRARY');
             $result = array('type' => 'success', 'text' => $text);
         }
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     CrowdfundingInstallHelper::addRowHeading(JText::_('COM_CROWDFUNDING_INSTALLED_EXTENSIONS'));
     // Crowdfunding Library
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CROWDFUNDING_LIBRARY'), $result, JText::_('COM_CROWDFUNDING_LIBRARY'));
     // Plugins
     // Content - Crowdfunding - Navigation
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CONTENT_CROWDFUNDING_NAVIGATION'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Content - Crowdfunding - Share
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CONTENT_CROWDFUNDING_SHARE'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Content - Crowdfunding - Admin Mail
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CONTENT_CROWDFUNDING_ADMIN_MAIL'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Content - Crowdfunding - User Mail
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CONTENT_CROWDFUNDING_USER_MAIL'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Content - Crowdfunding - Validator
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CONTENT_CROWDFUNDING_VALIDATOR'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // System - Crowdfunding - Modules
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_SYSTEM_CROWDFUNDINGMODULES'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Crowdfunding Payment - PayPal
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CROWDFUNDINGPAYMENT_PAYPAL'), $result, JText::_('COM_CROWDFUNDING_PLUGIN'));
     // Modules
     // Crowdfunding Info
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CROWDFUNDING_MODULE_INFO'), $result, JText::_('COM_CROWDFUNDING_MODULE'));
     // Crowdfunding Details
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CROWDFUNDING_MODULE_DETAILS'), $result, JText::_('COM_CROWDFUNDING_MODULE'));
     // Crowdfunding Rewards
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDING_INSTALLED'));
     CrowdfundingInstallHelper::addRow(JText::_('COM_CROWDFUNDING_CROWDFUNDING_MODULE_REWARDS'), $result, JText::_('COM_CROWDFUNDING_MODULE'));
     // End table
     CrowdfundingInstallHelper::endTable();
     echo JText::sprintf('COM_CROWDFUNDING_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_crowdfunding'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_CROWDFUNDING_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Crowdfunding\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Crowdfunding\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_CROWDFUNDING_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
     // Delete the files that the system does not use anymore.
     $this->deleteFiles();
 }
Ejemplo n.º 16
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('COM_USERIDEAS_PATH_COMPONENT_ADMINISTRATOR')) {
         define('COM_USERIDEAS_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_userideas');
     }
     jimport('Prism.init');
     jimport('Userideas.init');
     // Register Component helpers
     JLoader::register('UserIdeasInstallHelper', COM_USERIDEAS_PATH_COMPONENT_ADMINISTRATOR . '/helpers/install.php');
     // Start table with the information
     UserIdeasInstallHelper::startTable();
     // Requirements
     UserIdeasInstallHelper::addRowHeading(JText::_('COM_USERIDEAS_MINIMUM_REQUIREMENTS'));
     // Display result about verification for GD library
     $title = JText::_('COM_USERIDEAS_GD_LIBRARY');
     $info = '';
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_USERIDEAS_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     UserIdeasInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_('COM_USERIDEAS_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_USERIDEAS_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     UserIdeasInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_USERIDEAS_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_USERIDEAS_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     UserIdeasInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version.
     $title = JText::_('COM_USERIDEAS_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array('type' => 'important', 'text' => JText::_('COM_USERIDEAS_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     UserIdeasInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $title = JText::_('COM_USERIDEAS_PRISM_LIBRARY');
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $info = JText::_('COM_USERIDEAS_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     UserIdeasInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     UserIdeasInstallHelper::addRowHeading(JText::_('COM_USERIDEAS_INSTALLED_EXTENSIONS'));
     // UserIdeas Library
     $result = array('type' => 'success', 'text' => JText::_('COM_USERIDEAS_INSTALLED'));
     UserIdeasInstallHelper::addRow(JText::_('COM_USERIDEAS_USERIDEAS_LIBRARY'), $result, JText::_('COM_USERIDEAS_LIBRARY'));
     // System - UserIdeasVote
     $result = array('type' => 'success', 'text' => JText::_('COM_USERIDEAS_INSTALLED'));
     UserIdeasInstallHelper::addRow(JText::_('COM_USERIDEAS_SYSTEM_USERIDEASVOTE'), $result, JText::_('COM_USERIDEAS_PLUGIN'));
     // UserIdeas - Vote
     $result = array('type' => 'success', 'text' => JText::_('COM_USERIDEAS_INSTALLED'));
     UserIdeasInstallHelper::addRow(JText::_('COM_USERIDEAS_USERIDEAS_VOTE'), $result, JText::_('COM_USERIDEAS_PLUGIN'));
     // Content - User Ideas - Admin Mail
     $result = array('type' => 'success', 'text' => JText::_('COM_USERIDEAS_INSTALLED'));
     UserIdeasInstallHelper::addRow(JText::_('COM_USERIDEAS_USERIDEAS_ADMIN_MAIL'), $result, JText::_('COM_USERIDEAS_PLUGIN'));
     // End table
     UserIdeasInstallHelper::endTable();
     echo JText::sprintf('COM_USERIDEAS_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_userideas'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_USERIDEAS_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Userideas\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Userideas\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_USERIDEAS_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
     // Create content type for used by tags.
     UserIdeasInstallHelper::createContentType();
 }
Ejemplo n.º 17
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR')) {
         define('GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_gamification');
     }
     // Register Component helpers
     JLoader::register('GamificationInstallHelper', GAMIFICATION_PATH_COMPONENT_ADMINISTRATOR . '/helpers/install.php');
     jimport('Prism.init');
     jimport('Gamification.init');
     $params = JComponentHelper::getParams('com_gamification');
     $mediaFolder = JFolder::makeSafe($params->get('local_media_folder', 'media/gamification'));
     $mediaPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $mediaFolder);
     // Create images folder
     if (!JFolder::exists($mediaPath)) {
         GamificationInstallHelper::createFolder($mediaPath);
     }
     // Start table with the information
     GamificationInstallHelper::startTable();
     // Requirements
     GamificationInstallHelper::addRowHeading(JText::_('COM_GAMIFICATION_MINIMUM_REQUIREMENTS'));
     // Display result about verification for existing folder
     $title = JText::_('COM_GAMIFICATION_MEDIA_FOLDER_EXISTS');
     $info = $mediaPath;
     if (!is_dir($mediaPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_('COM_GAMIFICATION_WRITABLE_FOLDER');
     $info = $mediaPath;
     if (!is_writable($mediaPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_('COM_GAMIFICATION_GD_LIBRARY');
     $info = '';
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_GAMIFICATION_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_GAMIFICATION_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_GAMIFICATION_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_('COM_GAMIFICATION_FILEINFO');
     $info = '';
     if (!function_exists('finfo_open')) {
         $info = JText::_('COM_GAMIFICATION_FILEINFO_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_('COM_GAMIFICATION_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_GAMIFICATION_PHP_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $currentVersion = GamificationInstallHelper::getCurlVersion();
         $text = JText::sprintf('COM_GAMIFICATION_CURRENT_V_S', $currentVersion);
         if (version_compare($currentVersion, '7.34.0', '<')) {
             $info = JText::sprintf('COM_GAMIFICATION_REQUIRES_V_S', '7.34.0+');
             $result = array('type' => 'warning', 'text' => $text);
         } else {
             $result = array('type' => 'success', 'text' => $text);
         }
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification Open SSL
     $title = JText::_('COM_GAMIFICATION_OPEN_SSL');
     $info = '';
     if (!function_exists('curl_init')) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $currentVersion = GamificationInstallHelper::getOpenSslVersion();
         $text = JText::sprintf('COM_GAMIFICATION_CURRENT_V_S', $currentVersion);
         if (version_compare($currentVersion, '1.0.1.3', '<')) {
             $info = JText::sprintf('COM_GAMIFICATION_REQUIRES_V_S', '1.0.1.3+');
             $result = array('type' => 'warning', 'text' => $text);
         } else {
             $result = array('type' => 'success', 'text' => $text);
         }
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version
     $title = JText::_('COM_GAMIFICATION_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.5.19') < 0) {
         $result = array('type' => 'important', 'text' => JText::_('COM_GAMIFICATION_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about MySQL Version.
     $title = JText::_('COM_GAMIFICATION_MYSQL_VERSION');
     $info = '';
     $dbVersion = JFactory::getDbo()->getVersion();
     if (version_compare($dbVersion, '5.5.3', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_GAMIFICATION_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $title = JText::_('COM_GAMIFICATION_PRISM_LIBRARY');
         $info = JText::_('COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $prismVersion = new Prism\Version();
         $text = JText::sprintf('COM_GAMIFICATION_CURRENT_V_S', $prismVersion->getShortVersion());
         if (class_exists('Gamification\\Version')) {
             $componentVersion = new Gamification\Version();
             $title = JText::sprintf('COM_GAMIFICATION_PRISM_LIBRARY_S', $componentVersion->requiredPrismVersion);
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 $info = JText::_('COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD');
                 $result = array('type' => 'warning', 'text' => $text);
             }
         } else {
             $title = JText::_('COM_GAMIFICATION_PRISM_LIBRARY');
             $result = array('type' => 'success', 'text' => $text);
         }
     }
     GamificationInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     GamificationInstallHelper::addRowHeading(JText::_('COM_GAMIFICATION_INSTALLED_EXTENSIONS'));
     // Gamification Library
     $result = array('type' => 'success', 'text' => JText::_('COM_GAMIFICATION_INSTALLED'));
     GamificationInstallHelper::addRow(JText::_('COM_GAMIFICATION_GAMIFICATION_LIBRARY'), $result, JText::_('COM_GAMIFICATION_LIBRARY'));
     // Gamification System Gamification
     $result = array('type' => 'success', 'text' => JText::_('COM_GAMIFICATION_INSTALLED'));
     GamificationInstallHelper::addRow(JText::_('COM_GAMIFICATION_PLUGIN_SYSTEM_GAMIFICATION'), $result, JText::_('COM_GAMIFICATION_PLUGIN'));
     // End table
     GamificationInstallHelper::endTable();
     echo JText::sprintf('COM_GAMIFICATION_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_gamification'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_GAMIFICATION_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Gamification\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Gamification\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_GAMIFICATION_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
 }
Ejemplo n.º 18
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined("SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR")) {
         define("SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR", JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . "components" . DIRECTORY_SEPARATOR . "com_socialcommunity");
     }
     // Register Install Helper
     JLoader::register("SocialCommunityInstallHelper", SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . "helpers" . DIRECTORY_SEPARATOR . "install.php");
     jimport('Prism.init');
     jimport('Crowdfunding.init');
     $params = JComponentHelper::getParams("com_socialcommunity");
     /** @var  $params Joomla\Registry\Registry */
     $this->imagesFolder = JFolder::makeSafe($params->get("images_directory", "images/profiles"));
     $this->imagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $this->imagesFolder);
     // Create images folder
     if (!is_dir($this->imagesPath)) {
         SocialCommunityInstallHelper::createFolder($this->imagesPath);
     }
     // Start table with the information
     SocialCommunityInstallHelper::startTable();
     // Requirements
     SocialCommunityInstallHelper::addRowHeading(JText::_("COM_SOCIALCOMMUNITY_MINIMUM_REQUIREMENTS"));
     // Display result about verification for existing folder
     $title = JText::_("COM_SOCIALCOMMUNITY_IMAGE_FOLDER");
     $info = $this->imagesFolder;
     if (!is_dir($this->imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writeable folder
     $title = JText::_("COM_SOCIALCOMMUNITY_WRITABLE_FOLDER");
     $info = $this->imagesFolder;
     if (!is_writable($this->imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_("COM_SOCIALCOMMUNITY_GD_LIBRARY");
     $info = "";
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array("type" => "important", "text" => JText::_("COM_SOCIALCOMMUNITY_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_("COM_SOCIALCOMMUNITY_CURL_LIBRARY");
     $info = "";
     if (!extension_loaded('curl')) {
         $info = JText::_("COM_SOCIALCOMMUNITY_CURL_INFO");
         $result = array("type" => "important", "text" => JText::_("COM_SOCIALCOMMUNITY_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_("COM_SOCIALCOMMUNITY_MAGIC_QUOTES");
     $info = "";
     if (get_magic_quotes_gpc()) {
         $info = JText::_("COM_SOCIALCOMMUNITY_MAGIC_QUOTES_INFO");
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JOFF"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_("COM_SOCIALCOMMUNITY_FILEINFO");
     $info = "";
     if (!function_exists('finfo_open')) {
         $info = JText::_("COM_SOCIALCOMMUNITY_FILEINFO_INFO");
         $result = array("type" => "important", "text" => JText::_("JOFF"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification PHP Version.
     $title = JText::_("COM_SOCIALCOMMUNITY_PHP_VERSION");
     $info = "";
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array("type" => "important", "text" => JText::_("COM_SOCIALCOMMUNITY_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $title = JText::_("COM_SOCIALCOMMUNITY_PRISM_LIBRARY");
     $info = "";
     if (!class_exists("Prism\\Version")) {
         $info = JText::_("COM_SOCIALCOMMUNITY_PRISM_LIBRARY_DOWNLOAD");
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     SocialCommunityInstallHelper::addRowHeading(JText::_("COM_SOCIALCOMMUNITY_INSTALLED_EXTENSIONS"));
     // SocialCommunity Library
     $result = array("type" => "success", "text" => JText::_("COM_SOCIALCOMMUNITY_INSTALLED"));
     SocialCommunityInstallHelper::addRow(JText::_("COM_SOCIALCOMMUNITY_SOCIALCOMMUNITY_LIBRARY"), $result, JText::_("COM_SOCIALCOMMUNITY_LIBRARY"));
     // User - Social Community New User
     $result = array("type" => "success", "text" => JText::_("COM_SOCIALCOMMUNITY_INSTALLED"));
     SocialCommunityInstallHelper::addRow(JText::_("COM_SOCIALCOMMUNITY_USER_SOCIALCOMMUNITY_USER"), $result, JText::_("COM_SOCIALCOMMUNITY_PLUGIN"));
     // End table with the information
     SocialCommunityInstallHelper::endTable();
     echo JText::sprintf("COM_SOCIALCOMMUNITY_MESSAGE_REVIEW_SAVE_SETTINGS", JRoute::_("index.php?option=com_socialcommunity"));
     if (!class_exists("Prism\\Version")) {
         echo JText::_("COM_SOCIALCOMMUNITY_MESSAGE_INSTALL_PRISM_LIBRARY");
     } else {
         if (class_exists("SocialCommunity\\Version")) {
             $prismVersion = new Prism\Version();
             $componentVersion = new SocialCommunity\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion)) {
                 echo JText::_("COM_SOCIALCOMMUNITY_MESSAGE_INSTALL_PRISM_LIBRARY");
             }
         }
     }
 }
Ejemplo n.º 19
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR')) {
         define('EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_emailtemplates');
     }
     // Register Component helpers
     JLoader::register('EmailTemplatesInstallHelper', EMAILTEMPLATES_PATH_COMPONENT_ADMINISTRATOR . '/helpers/install.php');
     jimport('Prism.init');
     jimport('Emailtemplates.init');
     // Start table with the information
     EmailTemplatesInstallHelper::startTable();
     // Requirements
     EmailTemplatesInstallHelper::addRowHeading(JText::_('COM_EMAILTEMPLATES_MINIMUM_REQUIREMENTS'));
     // Display result about verification Magic Quotes
     $title = JText::_('COM_EMAILTEMPLATES_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_EMAILTEMPLATES_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version.
     $title = JText::_('COM_EMAILTEMPLATES_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.4.0') < 0) {
         $result = array('type' => 'important', 'text' => JText::_('COM_EMAILTEMPLATES_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // Display result about MySQL Version.
     $title = JText::_('COM_EMAILTEMPLATES_MYSQL_VERSION');
     $info = '';
     $dbVersion = JFactory::getDbo()->getVersion();
     if (version_compare($dbVersion, '5.5.3', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_EMAILTEMPLATES_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     jimport('Prism.version');
     $title = JText::_('COM_EMAILTEMPLATES_PRISM_LIBRARY');
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $info = JText::_('COM_EMAILTEMPLATES_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     EmailTemplatesInstallHelper::addRow($title, $result, $info);
     // End table
     EmailTemplatesInstallHelper::endTable();
     echo JText::sprintf('COM_EMAILTEMPLATES_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_emailtemplates'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_EMAILTEMPLATES_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Crowdfunding\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Emailtemplates\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_EMAILTEMPLATES_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
 }
Ejemplo n.º 20
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined("COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR")) {
         define("COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR", JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . "components" . DIRECTORY_SEPARATOR . "com_crowdfunding");
     }
     // Register Component helpers
     JLoader::register("CrowdfundingInstallHelper", COM_CROWDFUNDING_PATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . "helpers" . DIRECTORY_SEPARATOR . "install.php");
     jimport('joomla.filesystem.path');
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     jimport('Prism.init');
     jimport('Crowdfunding.init');
     $params = JComponentHelper::getParams("com_crowdfunding");
     /** @var $params Joomla\Registry\Registry */
     // Prepare images folders.
     $imagesFolder = JFolder::makeSafe($params->get("images_directory", "images/crowdfunding"));
     $temporaryImagesFolder = $imagesFolder . "/temporary";
     // Create images folder.
     $imagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $imagesFolder);
     if (!is_dir($imagesPath)) {
         CrowdfundingInstallHelper::createFolder($imagesPath);
     }
     // Create temporary images folder
     $temporaryImagesPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $temporaryImagesFolder);
     if (!is_dir($temporaryImagesPath)) {
         CrowdfundingInstallHelper::createFolder($temporaryImagesPath);
     }
     // Start table with the information
     CrowdfundingInstallHelper::startTable();
     // Requirements
     CrowdfundingInstallHelper::addRowHeading(JText::_("COM_CROWDFUNDING_MINIMUM_REQUIREMENTS"));
     // Display result about verification for existing folder
     $title = JText::_("COM_CROWDFUNDING_IMAGE_FOLDER");
     $info = $imagesFolder;
     if (!is_dir($imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_("COM_CROWDFUNDING_IMAGE_WRITABLE_FOLDER");
     $info = $imagesFolder;
     if (!is_writable($imagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for existing folder
     $title = JText::_("COM_CROWDFUNDING_TEMPORARY_IMAGE_FOLDER");
     $info = $temporaryImagesFolder;
     if (!is_dir($temporaryImagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_("COM_CROWDFUNDING_TEMPORARY_IMAGE_WRITABLE_FOLDER");
     $info = $temporaryImagesFolder;
     if (!is_writable($temporaryImagesPath)) {
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_("COM_CROWDFUNDING_GD_LIBRARY");
     $info = "";
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array("type" => "important", "text" => JText::_("COM_CROWDFUNDING_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_("COM_CROWDFUNDING_CURL_LIBRARY");
     $info = "";
     if (!extension_loaded('curl')) {
         $info = JText::_("COM_CROWDFUNDING_CURL_INFO");
         $result = array("type" => "important", "text" => JText::_("JOFF"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_("COM_CROWDFUNDING_MAGIC_QUOTES");
     $info = "";
     if (get_magic_quotes_gpc()) {
         $info = JText::_("COM_CROWDFUNDING_MAGIC_QUOTES_INFO");
         $result = array("type" => "important", "text" => JText::_("JON"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JOFF"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_("COM_CROWDFUNDING_FILEINFO");
     $info = "";
     if (!function_exists('finfo_open')) {
         $info = JText::_("COM_CROWDFUNDING_FILEINFO_INFO");
         $result = array("type" => "important", "text" => JText::_("JOFF"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JON"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification of PHP Version.
     $title = JText::_("COM_CROWDFUNDING_PHP_VERSION");
     $info = "";
     if (version_compare(PHP_VERSION, '5.3.0') < 0) {
         $result = array("type" => "important", "text" => JText::_("COM_CROWDFUNDING_WARNING"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $title = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY");
     $info = "";
     if (!class_exists("Prism\\Version")) {
         $info = JText::_("COM_CROWDFUNDING_PRISM_LIBRARY_DOWNLOAD");
         $result = array("type" => "important", "text" => JText::_("JNO"));
     } else {
         $result = array("type" => "success", "text" => JText::_("JYES"));
     }
     CrowdfundingInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     CrowdfundingInstallHelper::addRowHeading(JText::_("COM_CROWDFUNDING_INSTALLED_EXTENSIONS"));
     // Crowdfunding Library
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CROWDFUNDING_LIBRARY"), $result, JText::_("COM_CROWDFUNDING_LIBRARY"));
     // Plugins
     // Content - Crowdfunding - Navigation
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CONTENT_CROWDFUNDING_NAVIGATION"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Content - Crowdfunding - Share
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CONTENT_CROWDFUNDING_SHARE"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Content - Crowdfunding - Admin Mail
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CONTENT_CROWDFUNDING_ADMIN_MAIL"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Content - Crowdfunding - User Mail
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CONTENT_CROWDFUNDING_USER_MAIL"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Content - Crowdfunding - Validator
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CONTENT_CROWDFUNDING_VALIDATOR"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // System - Crowdfunding - Modules
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_SYSTEM_CROWDFUNDINGMODULES"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Crowdfunding Payment - PayPal
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CROWDFUNDINGPAYMENT_PAYPAL"), $result, JText::_("COM_CROWDFUNDING_PLUGIN"));
     // Modules
     // Crowdfunding Info
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CROWDFUNDING_MODULE_INFO"), $result, JText::_("COM_CROWDFUNDING_MODULE"));
     // Crowdfunding Details
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CROWDFUNDING_MODULE_DETAILS"), $result, JText::_("COM_CROWDFUNDING_MODULE"));
     // Crowdfunding Rewards
     $result = array("type" => "success", "text" => JText::_("COM_CROWDFUNDING_INSTALLED"));
     CrowdfundingInstallHelper::addRow(JText::_("COM_CROWDFUNDING_CROWDFUNDING_MODULE_REWARDS"), $result, JText::_("COM_CROWDFUNDING_MODULE"));
     // End table
     CrowdfundingInstallHelper::endTable();
     echo JText::sprintf("COM_CROWDFUNDING_MESSAGE_REVIEW_SAVE_SETTINGS", JRoute::_("index.php?option=com_crowdfunding"));
     if (!class_exists("Prism\\Version")) {
         echo JText::_("COM_CROWDFUNDING_MESSAGE_INSTALL_PRISM_LIBRARY");
     } else {
         if (class_exists("Crowdfunding\\Version")) {
             $prismVersion = new Prism\Version();
             $crowdfundingVersion = new Crowdfunding\Version();
             if (version_compare($prismVersion->getShortVersion(), $crowdfundingVersion->requiredPrismVersion)) {
                 echo JText::_("COM_CROWDFUNDING_MESSAGE_INSTALL_PRISM_LIBRARY");
             }
         }
     }
     // Remove the files that the system does not use anymore.
     $this->removeUnusedFiles();
 }
Ejemplo n.º 21
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR')) {
         define('SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_socialcommunity');
     }
     // Register Install Helper
     JLoader::register('SocialCommunityInstallHelper', SOCIALCOMMUNITY_PATH_COMPONENT_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'install.php');
     jimport('Prism.init');
     jimport('Socialcommunity.init');
     $params = JComponentHelper::getParams('com_socialcommunity');
     /** @var  $params Joomla\Registry\Registry */
     $mediaFolder = JFolder::makeSafe($params->get('local_media_folder', 'media/socialcommunity'));
     $mediaFolderPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $mediaFolder);
     $temporaryMediaFolder = $mediaFolder . '/temporary';
     $temporaryMediaFolderPath = JPath::clean(JPATH_SITE . DIRECTORY_SEPARATOR . $temporaryMediaFolder);
     // Create images folder
     if (!JFolder::exists($mediaFolderPath)) {
         SocialCommunityInstallHelper::createFolder($mediaFolderPath);
     }
     // Create temporary images folder
     if (!JFolder::exists($temporaryMediaFolderPath)) {
         SocialCommunityInstallHelper::createFolder($temporaryMediaFolderPath);
     }
     // Start table with the information
     SocialCommunityInstallHelper::startTable();
     // Requirements
     SocialCommunityInstallHelper::addRowHeading(JText::_('COM_SOCIALCOMMUNITY_MINIMUM_REQUIREMENTS'));
     // Display result about verification for existing folder
     $title = JText::_('COM_SOCIALCOMMUNITY_IMAGE_FOLDER');
     $info = $mediaFolder;
     if (!JFolder::exists($mediaFolderPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_('COM_SOCIALCOMMUNITY_WRITABLE_FOLDER');
     $info = $mediaFolder;
     if (!is_writable($mediaFolderPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for existing folder
     $title = JText::_('COM_SOCIALCOMMUNITY_TEMPORARY_IMAGE_FOLDER');
     $info = $temporaryMediaFolder;
     if (!JFolder::exists($temporaryMediaFolderPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for writable folder
     $title = JText::_('COM_SOCIALCOMMUNITY_TEMPORARY_WRITABLE_FOLDER');
     $info = $temporaryMediaFolder;
     if (!is_writable($temporaryMediaFolderPath)) {
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for GD library
     $title = JText::_('COM_SOCIALCOMMUNITY_GD_LIBRARY');
     $info = '';
     if (!extension_loaded('gd') and function_exists('gd_info')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_SOCIALCOMMUNITY_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_('COM_SOCIALCOMMUNITY_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_SOCIALCOMMUNITY_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('COM_SOCIALCOMMUNITY_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_SOCIALCOMMUNITY_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_SOCIALCOMMUNITY_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification FileInfo
     $title = JText::_('COM_SOCIALCOMMUNITY_FILEINFO');
     $info = '';
     if (!function_exists('finfo_open')) {
         $info = JText::_('COM_SOCIALCOMMUNITY_FILEINFO_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification PHP Version.
     $title = JText::_('COM_SOCIALCOMMUNITY_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_SOCIALCOMMUNITY_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about MySQL Version.
     $title = JText::_('COM_SOCIALCOMMUNITY_MYSQL_VERSION');
     $info = '';
     $dbVersion = JFactory::getDbo()->getVersion();
     if (version_compare($dbVersion, '5.5.3', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_SOCIALCOMMUNITY_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $title = JText::_('COM_SOCIALCOMMUNITY_PRISM_LIBRARY');
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $info = JText::_('COM_SOCIALCOMMUNITY_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     SocialCommunityInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     SocialCommunityInstallHelper::addRowHeading(JText::_('COM_SOCIALCOMMUNITY_INSTALLED_EXTENSIONS'));
     // SocialCommunity Library
     $result = array('type' => 'success', 'text' => JText::_('COM_SOCIALCOMMUNITY_INSTALLED'));
     SocialCommunityInstallHelper::addRow(JText::_('COM_SOCIALCOMMUNITY_SOCIALCOMMUNITY_LIBRARY'), $result, JText::_('COM_SOCIALCOMMUNITY_LIBRARY'));
     // User - Social Community New User
     $result = array('type' => 'success', 'text' => JText::_('COM_SOCIALCOMMUNITY_INSTALLED'));
     SocialCommunityInstallHelper::addRow(JText::_('COM_SOCIALCOMMUNITY_USER_SOCIALCOMMUNITY_USER'), $result, JText::_('COM_SOCIALCOMMUNITY_PLUGIN'));
     // End table with the information
     SocialCommunityInstallHelper::endTable();
     echo JText::sprintf('COM_SOCIALCOMMUNITY_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_socialcommunity'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_SOCIALCOMMUNITY_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Socialcommunity\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Socialcommunity\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_SOCIALCOMMUNITY_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
     // Create profiles if orphans exist.
     SocialCommunityHelper::createProfiles();
 }
$info = '';
$dbVersion = JFactory::getDbo()->getVersion();
if (version_compare($dbVersion, '5.5.3', '<')) {
    $result = array('type' => 'important', 'text' => JText::_('COM_GAMIFICATION_WARNING'));
} else {
    $result = array('type' => 'success', 'text' => JText::_('JYES'));
}
GamificationInstallHelper::addRow($title, $result, $info);
// Display result about verification of installed ITPrism Library
$info = '';
if (!class_exists('Prism\\Version')) {
    $title = JText::_('COM_GAMIFICATION_PRISM_LIBRARY');
    $info = JText::_('COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD');
    $result = array('type' => 'important', 'text' => JText::_('JNO'));
} else {
    $prismVersion = new Prism\Version();
    $text = JText::sprintf('COM_GAMIFICATION_CURRENT_V_S', $prismVersion->getShortVersion());
    if (class_exists('Gamification\\Version')) {
        $componentVersion = new Gamification\Version();
        $title = JText::sprintf('COM_GAMIFICATION_PRISM_LIBRARY_S', $componentVersion->requiredPrismVersion);
        if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
            $info = JText::_('COM_GAMIFICATION_PRISM_LIBRARY_DOWNLOAD');
            $result = array('type' => 'warning', 'text' => $text);
        }
    } else {
        $title = JText::_('COM_GAMIFICATION_PRISM_LIBRARY');
        $result = array('type' => 'success', 'text' => $text);
    }
}
GamificationInstallHelper::addRow($title, $result, $info);
GamificationInstallHelper::endTable();
Ejemplo n.º 23
0
 /**
  * Method to run after an install/update/uninstall method.
  *
  * @param string $type
  * @param string $parent
  *
  * @throws \UnexpectedValueException
  * @throws \InvalidArgumentException
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     if (!defined('COM_CROWDFUNDINGFINANCE_PATH_COMPONENT_ADMINISTRATOR')) {
         define('COM_CROWDFUNDINGFINANCE_PATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_crowdfundingfinance');
     }
     jimport('Prism.init');
     jimport('Crowdfundingfinance.init');
     // Register Component helpers
     JLoader::register('CrowdfundingfinanceInstallHelper', COM_CROWDFUNDINGFINANCE_PATH_COMPONENT_ADMINISTRATOR . '/helpers/install.php');
     // Start table with the information
     CrowdfundingfinanceInstallHelper::startTable();
     // Requirements
     CrowdfundingfinanceInstallHelper::addRowHeading(JText::_('COM_CROWDFUNDINGFINANCE_MINIMUM_REQUIREMENTS'));
     // Display result about verification for GD library
     $title = JText::_('COM_CROWDFUNDINGFINANCE_GD_LIBRARY');
     $info = '';
     if (!extension_loaded('gd') and !function_exists('gd_info')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about verification for cURL library
     $title = JText::_('COM_CROWDFUNDINGFINANCE_CURL_LIBRARY');
     $info = '';
     if (!extension_loaded('curl')) {
         $info = JText::_('COM_CROWDFUNDINGFINANCE_CURL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about verification Magic Quotes
     $title = JText::_('COM_CROWDFUNDINGFINANCE_MAGIC_QUOTES');
     $info = '';
     if (get_magic_quotes_gpc()) {
         $info = JText::_('COM_CROWDFUNDINGFINANCE_MAGIC_QUOTES_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JON'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JOFF'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about verification PHP Intl
     $title = JText::_('COM_CROWDFUNDINGFINANCE_PHPINTL');
     $info = '';
     if (!extension_loaded('intl')) {
         $info = JText::_('COM_CROWDFUNDINGFINANCE_PHPINTL_INFO');
         $result = array('type' => 'important', 'text' => JText::_('JOFF'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JON'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about PHP version.
     $title = JText::_('COM_CROWDFUNDINGFINANCE_PHP_VERSION');
     $info = '';
     if (version_compare(PHP_VERSION, '5.5.0') < 0) {
         $result = array('type' => 'important', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about MySQL Version.
     $title = JText::_('COM_CROWDFUNDINGFINANCE_MYSQL_VERSION');
     $info = '';
     $dbVersion = JFactory::getDbo()->getVersion();
     if (version_compare($dbVersion, '5.5.3', '<')) {
         $result = array('type' => 'important', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_WARNING'));
     } else {
         $result = array('type' => 'success', 'text' => JText::_('JYES'));
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Display result about verification of installed Prism Library
     $info = '';
     if (!class_exists('Prism\\Version')) {
         $title = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY');
         $info = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD');
         $result = array('type' => 'important', 'text' => JText::_('JNO'));
     } else {
         $prismVersion = new Prism\Version();
         $text = JText::sprintf('COM_CROWDFUNDINGFINANCE_CURRENT_V_S', $prismVersion->getShortVersion());
         if (class_exists('Crowdfundingfinance\\Version')) {
             $componentVersion = new Crowdfundingfinance\Version();
             $title = JText::sprintf('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_S', $componentVersion->requiredPrismVersion);
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 $info = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD');
                 $result = array('type' => 'warning', 'text' => $text);
             }
         } else {
             $title = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY');
             $result = array('type' => 'success', 'text' => $text);
         }
     }
     CrowdfundingfinanceInstallHelper::addRow($title, $result, $info);
     // Installed extensions
     CrowdfundingfinanceInstallHelper::addRowHeading(JText::_('COM_CROWDFUNDINGFINANCE_INSTALLED_EXTENSIONS'));
     // Crowdfundingfinance Library
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_INSTALLED'));
     CrowdfundingfinanceInstallHelper::addRow(JText::_('COM_CROWDFUNDINGFINANCE_CROWDFUNDINGFINANCE_LIBRARY'), $result, JText::_('COM_CROWDFUNDINGFINANCE_LIBRARY'));
     // Crowdfunding - Payout Options
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_INSTALLED'));
     CrowdfundingfinanceInstallHelper::addRow(JText::_('COM_CROWDFUNDINGFINANCE_CROWDFUNDING_PAYOUT_OPTIONS'), $result, JText::_('COM_CROWDFUNDINGFINANCE_PLUGIN'));
     // Content - Crowdfunding Fraud Prevention
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_INSTALLED'));
     CrowdfundingfinanceInstallHelper::addRow(JText::_('COM_CROWDFUNDINGFINANCE_CONTENT_CROUDFUNDINGFRAUDPREVENTION'), $result, JText::_('COM_CROWDFUNDINGFINANCE_PLUGIN'));
     // CrowdfundingPayment - Fraud Prevention
     $result = array('type' => 'success', 'text' => JText::_('COM_CROWDFUNDINGFINANCE_INSTALLED'));
     CrowdfundingfinanceInstallHelper::addRow(JText::_('COM_CROWDFUNDINGFINANCE_CROWDFUNDINGPAYMENT_FRAUDPREVENTION'), $result, JText::_('COM_CROWDFUNDINGFINANCE_PLUGIN'));
     // End table
     CrowdfundingfinanceInstallHelper::endTable();
     echo JText::sprintf('COM_CROWDFUNDINGFINANCE_MESSAGE_REVIEW_SAVE_SETTINGS', JRoute::_('index.php?option=com_crowdfundingfinance'));
     if (!class_exists('Prism\\Version')) {
         echo JText::_('COM_CROWDFUNDINGFINANCE_MESSAGE_INSTALL_PRISM_LIBRARY');
     } else {
         if (class_exists('Crowdfundingfinance\\Version')) {
             $prismVersion = new Prism\Version();
             $componentVersion = new Crowdfundingfinance\Version();
             if (version_compare($prismVersion->getShortVersion(), $componentVersion->requiredPrismVersion, '<')) {
                 echo JText::_('COM_CROWDFUNDINGFINANCE_MESSAGE_INSTALL_PRISM_LIBRARY');
             }
         }
     }
 }