function installPluginTableByThemeName($themeName)
 {
     jimport('joomla.filesystem.file');
     $sqlFile = JPATH_PLUGINS . DS . $this->_pluginType . DS . $themeName . DS . $this->_installFile;
     if (JFile::exists($sqlFile)) {
         $objJNSUtils = JSNISFactory::getObj('classes.jsn_is_utils');
         $buffer = $objJNSUtils->readFileToString($sqlFile);
         if ($buffer === false) {
             return false;
         }
         jimport('joomla.installer.helper');
         $queries = JInstallerHelper::splitSql($buffer);
         if (count($queries) == 0) {
             JError::raiseWarning(100, $sqlFile . JText::_(' not exits'));
             return 0;
         }
         foreach ($queries as $query) {
             $query = trim($query);
             if ($query != '' && $query[0] != '#') {
                 $this->_db->setQuery($query);
                 if (!$this->_db->query()) {
                     JError::raiseWarning(100, 'JInstaller::install: ' . JText::_('SQL Error') . " " . $this->_db->stderr(true));
                     return false;
                 }
             }
         }
         return true;
     } else {
         JError::raiseWarning(100, $sqlFile . JText::_(' not exits'));
         return false;
     }
 }
Esempio n. 2
0
 /**
  * Add nesscessary JS & CSS files
  *
  * @return void
  */
 private function _addAssets()
 {
     $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
     !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
     $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js');
 }
Esempio n. 3
0
 /**
  * Queue store script file to array
  *
  * @param   string  $path  The path of file.
  *
  * @return	void
  */
 public function addStyleSheet($path)
 {
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $currentVersion = $objUtils->getVersion();
     $path .= '?v=' . $currentVersion;
     $this->_document->addStyleSheet($path);
 }
Esempio n. 4
0
    function updateThumbnailSize($externalSourceId, $updateThumbnailSize = 144)
    {
        if (!$updateThumbnailSize || !$externalSourceId) {
            return false;
        }
        $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
        $objJSNImages = JSNISFactory::getObj('classes.jsn_is_images');
        $showlists = $objJSNShowlist->getListShowlistBySource($externalSourceId, 'picasa');
        foreach ($showlists as $showlist) {
            $images = $objJSNImages->getImagesByShowlistID($showlist->showlist_id);
            if ($images) {
                foreach ($images as $image) {
                    $patt = '/\\/s(\\d)*\\//';
                    $imageSmall = preg_replace($patt, '/s' . $updateThumbnailSize . '/', $image->image_small);
                    $query = 'UPDATE #__imageshow_images
							  SET image_small = ' . $this->_db->quote($imageSmall) . '
							  WHERE showlist_id =' . (int) $showlist->showlist_id . '
							  AND image_id = ' . $this->_db->quote($image->image_id) . '
							  LIMIT 1';
                    $this->_db->setQuery($query);
                    $this->_db->query();
                }
            }
        }
    }
Esempio n. 5
0
 /**
  * Restore database table data and/or files from backup.
  *
  * @param   mixed  $backup  Either path to an existing file or a variable of $_FILES.
  *
  * @return  void
  */
 public function restore($backup)
 {
     global $objectLog;
     $session = JFactory::getSession();
     $objJSNRestore = JSNISFactory::getObj('classes.jsn_is_restore');
     // Get Joomla config
     $config = JFactory::getConfig();
     // Initialize backup file
     $config = array();
     $config['file'] = $backup;
     $config['compress'] = 1;
     $config['path'] = JPATH_ROOT . DS . 'tmp' . DS;
     $config['file_upload'] = JPATH_ROOT . DS . 'tmp' . DS . $backup['name'];
     $result = $objJSNRestore->restore($config);
     $requiredInstallData = $objJSNRestore->getListRequiredInstallData();
     $requiredInstallData['backup_file'] = $backup;
     $requiredInstallData['processText'] = JText::_('JSN_IMAGESHOW_PROCESS_TEXT', true);
     $requiredInstallData['waitText'] = JText::_('JSN_IMAGESHOW_WAIT_TEXT', true);
     if ($result) {
         $objectLog->addLog(JFactory::getUser()->get('id'), JRequest::getURI(), $backup['name'], 'maintenance', 'restore');
         $session->set('JSNISRestore', array('error' => false, 'extractFile' => $objJSNRestore->_extractFile, 'message' => JText::_('MAINTENANCE_BACKUP_RESTORE_SUCCESSFULL'), 'requiredSourcesNeedInstall' => $objJSNRestore->_requiredSourcesNeedInstall, 'requiredThemesNeedInstall' => $objJSNRestore->_requiredThemesNeedInstall, 'requiredInstallData' => $requiredInstallData));
     } else {
         $session->set('JSNISRestore', array('error' => true, 'extractFile' => $objJSNRestore->_extractFile, 'message' => $objJSNRestore->_msgError, 'requiredSourcesNeedInstall' => $objJSNRestore->_requiredSourcesNeedInstall, 'requiredThemesNeedInstall' => $objJSNRestore->_requiredThemesNeedInstall, 'requiredInstallData' => $requiredInstallData));
     }
 }
Esempio n. 6
0
 /**
  * Display method
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return	void
  */
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     $showcaseID = JRequest::getVar('showcase_id');
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $objShowcaseTheme = JSNISFactory::getObj('classes.jsn_is_showcasetheme');
     $themeProfile = $objShowcaseTheme->getThemeProfile($showcaseID);
     if ($showcaseID > 0 && !is_null($themeProfile)) {
         $showcaseData = $objJSNShowcase->getShowcaseByID($showcaseID);
     } elseif ($showcaseID > 0 && is_null($themeProfile)) {
         $theme = JRequest::getVar('theme');
         $showcaseTable = JTable::getInstance('showcase', 'Table');
         $showcaseTable->showcase_id = $showcaseID;
         $showcaseTable->theme_name = $theme;
         $showcaseData = $showcaseTable;
     } else {
         $theme = JRequest::getVar('theme');
         $showcaseTable = JTable::getInstance('showcase', 'Table');
         $showcaseTable->showcase_id = 0;
         $showcaseTable->theme_name = $theme;
         $showcaseData = $showcaseTable;
     }
     $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = dirname($objJSNUtils->overrideURL()) . '/';
     $dataObj = $objJSNShowcase->getShowcase2JSON($showcaseData, $URL);
     echo json_encode($dataObj);
     jexit();
 }
 function _installPackage()
 {
     $installer = JSNISInstaller::getInstance();
     if ($this->_packageExtract) {
         $objJSNPlugins = JSNISFactory::getObj('classes.jsn_is_plugins');
         $countSource = count($this->_listCurrentSources);
         $currentSources = array();
         if ($countSource) {
             for ($i = 0; $i < $countSource; $i++) {
                 $item = $this->_listCurrentSources[$i];
                 $currentSources[$item->element] = $objJSNPlugins->getXmlFile($item);
             }
         }
         if (!$installer->install($this->_packageExtract['dir'])) {
             $this->_msgError = JText::_('INSTALLER_IMAGE_SOURCE_PACKAGE_UNSUCCESSFULLY_INSTALLED');
             $this->_error = true;
             return false;
         }
         $this->_upgradeSourceDB($currentSources, $installer);
         if (!is_file($this->_packageExtract['packagefile'])) {
             $config = JFactory::getConfig();
             $package['packagefile'] = $config->getValue('config.tmp_path') . DS . $this->_packageExtract['packagefile'];
         }
         JInstallerHelper::cleanupInstall($this->_packageExtract['packagefile'], $this->_packageExtract['extractdir']);
     }
 }
Esempio n. 8
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     JHTML::script('jsn_is_imageshow.js', 'administrator/components/com_imageshow/assets/js/');
     JHTML::stylesheet('imageshow.css', 'administrator/components/com_imageshow/assets/css/');
     JHTML::stylesheet('mediamanager.css', 'administrator/components/com_imageshow/assets/css/');
     $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
     $task = JRequest::getString('task');
     if ($task != 'element' && $task != 'elements') {
         $objJSNShowlist->checkShowlistLimition();
     }
     $list = array();
     $model = $this->getModel();
     $filterState = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_state', 'filter_state', '', 'word');
     $filterOrder = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_order', 'filter_order', '', 'cmd');
     $filterOrderDir = $mainframe->getUserStateFromRequest('com_imageshow.showlist.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $showlistTitle = $mainframe->getUserStateFromRequest('com_imageshow.showlist.showlist_stitle', 'showlist_stitle', '', 'string');
     $showlistAccess = $mainframe->getUserStateFromRequest('com_imageshow.showlist.showlist_access', 'access', '', 'string');
     $type = array(0 => array('value' => '', 'text' => '- Published -'), 1 => array('value' => 'P', 'text' => 'Yes'), 2 => array('value' => 'U', 'text' => 'No'));
     $lists['type'] = JHTML::_('select.genericList', $type, 'filter_state', 'id="filter_state" class="inputbox" onchange="document.adminForm.submit( );"' . '', 'value', 'text', $filterState);
     $lists['state'] = JHTML::_('grid.state', $filterState);
     $lists['access'] = $model->accesslevel($showlistAccess);
     $lists['showlistTitle'] = $showlistTitle;
     $lists['order_Dir'] = $filterOrderDir;
     $lists['order'] = $filterOrder;
     $items =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $this->assignRef('lists', $lists);
     $this->assignRef('total', $total);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Esempio n. 9
0
 public function createBackUpFileForMigrate()
 {
     $session = JFactory::getSession();
     $preVersion = (double) str_replace('.', '', $session->get('preversion', null, 'jsnimageshow'));
     $version400 = (double) str_replace('.', '', '4.0.0');
     //$preVersion = 313;
     if (!$preVersion) {
         return;
     }
     if ($preVersion < $version400) {
         $objJSNISMaintenance = JSNISFactory::getObj('classes.jsn_is_maintenance313', null, 'database');
         $xmlString = $objJSNISMaintenance->renderXMLData(true, true);
     } else {
         if ($preVersion >= $version400) {
             $objJSNISData = JSNISFactory::getObj('classes.jsn_is_data');
             $xmlString = $objJSNISData->executeBackup(true, true)->asXML();
         }
     }
     $fileBackupName = 'jsn_imageshow_backup_db.xml';
     $fileZipName = 'jsn_is_backup_for_migrate_' . $preVersion . '_' . date('YmdHis') . '.zip';
     if (JFile::write(JPATH_ROOT . DS . 'tmp' . DS . $fileBackupName, $xmlString)) {
         $config = JPATH_ROOT . DS . 'tmp' . DS . $fileZipName;
         $zip = JSNISFactory::getObj('classes.jsn_is_archive', 'JSNISZIPFile', $config);
         $zip->setOptions(array('inmemory' => 1, 'recurse' => 0, 'storepaths' => 0));
         $zip->addFiles(JPATH_ROOT . DS . 'tmp' . DS . $fileBackupName);
         $zip->createArchive();
         $zip->writeArchiveFile();
         $FileDelte = JPATH_ROOT . DS . 'tmp' . DS . $fileBackupName;
         $session->set('jsn_is_backup_for_migrate', $fileZipName, 'jsnimageshow');
         return true;
     }
     return false;
 }
Esempio n. 10
0
 function sampledata()
 {
     $sampleData = JRequest::getInt('sample_data');
     $menuType = JRequest::getString('menutype');
     $keepAllData = JRequest::getInt('keep_all_data');
     $installMessage = JRequest::getInt('install_message');
     $model = $this->getModel('cpanel');
     $msg = '';
     if ($keepAllData == 1) {
         $model->clearData();
     }
     if ($installMessage == 1) {
         $objJSNInstMessage = JSNISFactory::getObj('classes.jsn_is_installermessage');
         $objJSNInstMessage->installMessage();
     }
     if ($sampleData == 1) {
         $model->populateDatabase();
         if ($menuType != '') {
             $model->insertMenuSample($menuType);
         }
         $msg = JText::_('INSTALL SAMPLE DATA SUCCESSFULLY');
     }
     $link = 'index.php?option=com_imageshow';
     $this->setRedirect($link, $msg);
 }
Esempio n. 11
0
 function display($tpl = null)
 {
     global $mainframe, $option, $Itemid;
     jimport('joomla.utilities.simplexml');
     $showlistID = JRequest::getInt('showlist_id', 0);
     if ($showlistID == 0) {
         $menu =& JSite::getMenu();
         $item = $menu->getActive();
         $params =& $menu->getParams($item->id);
         $showlistID = $params->get('showlist_id', 0);
     }
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = $objUtils->overrideURL();
     $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
     $showlistInfo = $objJSNShowlist->getShowListByID($showlistID, true);
     if (count($showlistInfo) <= 0) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     $objJSNShowlist->insertHitsShowlist($showlistID);
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $dataObj = $objJSNShowlist->getShowlist2JSON($URL, $showlistID);
     echo $objJSNJSON->encode($dataObj);
     jexit();
 }
Esempio n. 12
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     jimport('joomla.utilities.simplexml');
     $showCaseID = JRequest::getInt('showcase_id', 0);
     if ($showCaseID == 0) {
         $menu =& JSite::getMenu();
         $item = $menu->getActive();
         $params =& $menu->getParams($item->id);
         $showcase_id = $params->get('showcase_id', 0);
     } else {
         $showcase_id = $showCaseID;
     }
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = $objUtils->overrideURL();
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $row = $objJSNShowcase->getShowCaseByID($showcase_id);
     if (count($row) <= 0) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL);
     echo $objJSNJSON->encode($dataObj);
     jexit();
 }
Esempio n. 13
0
 function deleteProfileSelect($cid = array())
 {
     $result = false;
     if (count($cid)) {
         JArrayHelper::toInteger($cid);
         $cids = implode(',', $cid);
         $query = 'DELETE FROM #__imageshow_configuration' . ' WHERE configuration_id IN ( ' . $cids . ' )';
         $this->_db->setQuery($query);
         $this->_db->query();
         $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
         $listShowlistID = $objJSNShowlist->getListShowlistID($cids);
         if (count($listShowlistID)) {
             foreach ($listShowlistID as $value) {
                 $values[] = $value[0];
             }
             $listID = implode(',', $values);
             $query = 'UPDATE #__imageshow_showlist SET configuration_id = 0, showlist_source = 0 WHERE showlist_id IN ( ' . $listID . ' )';
             $this->_db->setQuery($query);
             $this->_db->query();
             $query = 'DELETE FROM #__imageshow_images WHERE showlist_id IN ( ' . $listID . ' )';
             $this->_db->setQuery($query);
             $this->_db->query();
         }
     }
     return true;
 }
 function installMessage()
 {
     $db = JFactory::getDBO();
     $lang = JFactory::getLanguage();
     $currentlang = $lang->getTag();
     $objectReadxmlDetail = new JSNISReadXmlDetails();
     $infoXmlDetail = $objectReadxmlDetail->parserXMLDetails();
     $langSupport = $infoXmlDetail['langs'];
     $registry = new JRegistry();
     $newStrings = array();
     $path = null;
     $realLang = null;
     $queries = array();
     if (array_key_exists($currentlang, $langSupport)) {
         $path = JLanguage::getLanguagePath(JPATH_BASE, $currentlang);
         $realLang = $currentlang;
     } else {
         $filepath = JPATH_ROOT . DS . 'administrator' . DS . 'language';
         $foldersLang = $this->getFolder($filepath);
         foreach ($foldersLang as $value) {
             if (in_array($value, $langSupport) == true) {
                 $path = JLanguage::getLanguagePath(JPATH_BASE, $value);
                 $realLang = $value;
                 break;
             }
         }
     }
     $filename = $path . DS . $realLang . '.com_imageshow.ini';
     $objJNSUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $content = $objJNSUtils->readFileToString($filename);
     if ($content) {
         $registry->loadString($content);
         $newStrings = $registry->toArray();
         if (count($newStrings)) {
             if (count($infoXmlDetail['menu'])) {
                 $queries[] = 'TRUNCATE TABLE #__jsn_imageshow_messages';
                 foreach ($infoXmlDetail['menu'] as $value) {
                     $index = 1;
                     while (isset($newStrings['MESSAGE_' . $value . '_' . $index . '_PRIMARY'])) {
                         $queries[] = 'INSERT INTO #__jsn_imageshow_messages (msg_screen, published, ordering) VALUES (\'' . $value . '\', 1, ' . $index . ')';
                         $index++;
                     }
                 }
             }
         }
         if (count($queries)) {
             foreach ($queries as $query) {
                 $query = trim($query);
                 if ($query != '') {
                     $db->setQuery($query);
                     $db->query();
                 }
             }
         }
     }
     return true;
 }
Esempio n. 15
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     $pageclassSFX = '';
     $titleWillShow = '';
     $app = JFactory::getApplication('site');
     $input = $app->input;
     $menu_params = $app->getParams('com_imageshow');
     $menus = $app->getMenu();
     $menu = $menus->getActive();
     $jsnisID = JRequest::getInt('jsnisid', 0);
     $showCaseID = $input->getInt('showcase_id', 0);
     if ($jsnisID != 0) {
         $pageclassSFX = $menu_params->get('pageclass_sfx');
         $showPageTitle = $menu_params->get('show_page_heading');
         $pageTitle = $menu_params->get('page_title');
         if (!empty($showPageTitle)) {
             if (!empty($pageTitle)) {
                 $titleWillShow = $pageTitle;
             } else {
                 if (!empty($item->name)) {
                     $titleWillShow = $item->name;
                 }
             }
         }
     }
     $showListID = $input->getInt('showlist_id', 0);
     $showBreadCrumbs = $input->getInt('show_breadcrumbs', 0);
     $objJSNShow = JSNISFactory::getObj('classes.jsn_is_show');
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $objJSNImages = JSNISFactory::getObj('classes.jsn_is_images');
     $coreData = $objUtils->getComponentInfo();
     $coreInfo = json_decode($coreData->manifest_cache);
     $paramsCom = $mainframe->getParams('com_imageshow');
     $randomNumber = $objUtils->randSTR(5);
     $showlistInfo = $objJSNShowlist->getShowListByID($showListID);
     if (count($showlistInfo) && $showBreadCrumbs) {
         $pathway = $app->getPathway();
         $pathway->addItem($showlistInfo['showlist_title']);
     }
     $articleAuth = $objJSNShow->getArticleAuth($showListID);
     $row = $objJSNShowcase->getShowCaseByID($showCaseID);
     $imagesData = $objJSNImages->getImagesByShowlistID($showlistInfo['showlist_id']);
     $this->assignRef('titleWillShow', $titleWillShow);
     $this->assignRef('showcaseInfo', $row);
     $this->assignRef('randomNumber', $randomNumber);
     $this->assignRef('imagesData', $imagesData);
     $this->assignRef('showlistInfo', $showlistInfo);
     $this->assignRef('articleAuth', $articleAuth);
     $this->assignRef('pageclassSFX', $pageclassSFX);
     $this->assignRef('objUtils', $objUtils);
     $this->assignRef('Itemid', $menu->id);
     $this->assignRef('coreInfo', $coreInfo);
     parent::display($tpl);
 }
Esempio n. 16
0
 /**
  * Add nesscessary JS & CSS files
  *
  * @return void
  */
 private function _addAssets()
 {
     $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
     !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
     //$this->_document->addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
     $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
     //JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
     $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js');
 }
Esempio n. 17
0
 function _checkTable()
 {
     $query = 'SHOW TABLES LIKE \'' . $this->_tablePrefix . '\'';
     $this->_db->setQuery($query);
     $result = $this->_db->loadResult();
     if (!empty($result)) {
         return true;
     }
     $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $objJSNUtils->runSQLFile($this->_pluginPath . DS . 'install' . DS . $this->_installFile);
 }
Esempio n. 18
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     $this->model = $this->getModel();
     JHTML::stylesheet('imageshow.css', 'administrator/components/com_imageshow/assets/css/');
     JHTML::script('jsn_is_imageshow.js', 'administrator/components/com_imageshow/assets/js/');
     $objJSNXML = JSNISFactory::getObj('classes.jsn_is_readxmldetails');
     $infoXmlDetail = $objJSNXML->parserXMLDetails();
     $this->assignRef('infoXmlDetail', $infoXmlDetail);
     parent::display($tpl);
 }
 private function checkComponent()
 {
     $objJSNSource = JSNISFactory::getObj('classes.jsn_is_source');
     if (isset($this->_source['sourceDefine']->component) && $this->_source['sourceDefine']->component != '') {
         $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
         $comInstalled = $objJSNUtils->checkComInstalled($this->_source['sourceDefine']->component);
         if (!$comInstalled) {
             $objJSNSource->updateShowlistBySource(array('image_source_name' => $this->_showlistTable->image_source_name, 'image_source_type' => $this->_showlistTable->image_source_type));
         }
     }
 }
Esempio n. 20
0
 function onDisplayJSNShowcaseTheme($args)
 {
     if ($args->theme_name != $this->_showcaseThemeName) {
         return false;
     }
     JPlugin::loadLanguage('plg_' . $this->_showcaseThemeType . '_' . $this->_showcaseThemeName);
     $basePath = JPATH_PLUGINS . DS . $this->_showcaseThemeType . DS . $this->_showcaseThemeName;
     $objThemeDisplay = JSNISFactory::getObj('classes.jsn_is_carouseldisplay', null, null, $basePath);
     $result = $objThemeDisplay->display($args);
     return $result;
 }
Esempio n. 21
0
 function onDisplayJSNShowcaseTheme($args)
 {
     if ($args->theme_name != $this->_showcaseThemeName) {
         return false;
     }
     JHTML::stylesheet($this->_pathAssets . 'css/style.css');
     JPlugin::loadLanguage('plg_' . $this->_showcaseThemeType . '_' . $this->_showcaseThemeName);
     $basePath = JPATH_PLUGINS . DIRECTORY_SEPARATOR . $this->_showcaseThemeType . DIRECTORY_SEPARATOR . $this->_showcaseThemeName;
     $objThemeDisplay = JSNISFactory::getObj('classes.jsn_is_stripdisplay', null, null, $basePath);
     $result = $objThemeDisplay->display($args);
     return $result;
 }
Esempio n. 22
0
 function display($tpl = null)
 {
     global $mainframe, $option, $Itemid;
     jimport('joomla.utilities.simplexml');
     $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = dirname($objJSNUtils->overrideURL()) . '/';
     $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $showlistID = JRequest::getVar('showlist_id');
     $dataObj = $objJSNShowlist->getShowlist2JSON($URL, $showlistID);
     echo $objJSNJSON->encode($dataObj);
     jexit();
 }
Esempio n. 23
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     JHTML::stylesheet('imageshow.css', 'administrator/components/com_imageshow/assets/css/');
     JHTML::script('jsn_is_imageshow.js', 'administrator/components/com_imageshow/assets/js/');
     JHTML::_('behavior.modal', 'a.modal');
     $lists = array();
     $model = $this->getModel();
     $document =& JFactory::getDocument();
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
     $objJSNLog = JSNISFactory::getObj('classes.jsn_is_log');
     $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $objJSNTip = JSNISFactory::getObj('classes.jsn_is_tip');
     $totalShowlist = $objJSNShowlist->countShowlist();
     $totalShowcase = $objJSNShowcase->getTotalShowcase();
     $totalProfile = $objJSNUtils->getTotalProfile();
     $allContentTips = $objJSNTip->getAllContentTips($document->getLanguage());
     $objJSNLog->deleteRecordLog();
     $checkModule = $objJSNUtils->checkIntallModule();
     $checkPluginContent = $objJSNUtils->checkIntallPluginContent();
     $checkPluginSystem = $objJSNUtils->checkIntallPluginSystem();
     if ($checkModule == false || $checkPluginContent == false || $checkPluginSystem == false) {
         if ($checkModule == false) {
             $msgNotice[] = '<li>&nbsp;&nbsp;-&nbsp;&nbsp;' . JText::_('JSN IMAGESHOW MODULE') . '</li>';
         }
         if ($checkPluginSystem == false) {
             $msgNotice[] = '<li>&nbsp;&nbsp;-&nbsp;&nbsp;' . JText::_('JSN IMAGESHOW SYSTEM PLUGIN') . '</li>';
         }
         if ($checkPluginContent == false) {
             $msgNotice[] = '<li>&nbsp;&nbsp;-&nbsp;&nbsp;' . JText::_('JSN IMAGESHOW CONTENT PLUGIN') . '</li>';
         }
         $strMsg = implode('', $msgNotice);
         JError::raiseWarning(100, JText::sprintf('FOLLOWING ELEMENTS ARE NOT INSTALLED: %S', $strMsg));
     }
     $presentationMethods = array('0' => array('value' => '', 'text' => '- ' . JText::_('SELECT PRESENTATION METHOD') . ' -'), '1' => array('value' => 'menu', 'text' => JText::_('VIA MENU ITEM COMPONENT')), '2' => array('value' => 'module', 'text' => JText::_('IN MODULE POSITION MODULE')), '3' => array('value' => 'plugin', 'text' => JText::_('INSIDE ARTICLE CONTENT PLUGIN')));
     $lists['presentationMethods'] = JHTML::_('select.genericList', $presentationMethods, 'presentation_method', 'class="jsnis-gallery-selectbox" onchange="choosePresentMethode();" disabled="disabled"' . '', 'value', 'text', "");
     $pluginContentInfo = $objJSNUtils->getPluginContentInfo();
     $languageObj = $document->getLanguage();
     $lists['showlist'] = $objJSNShowlist->renderShowlistComboBox('0', JText::_('SELECT SHOWLIST'), 'showlist_id', 'class="jsnis-gallery-selectbox" onchange="enableButton();"');
     $lists['showcase'] = $objJSNShowcase->renderShowcaseComboBox('0', JText::_('SELECT SHOWCASE'), 'showcase_id', 'class="jsnis-gallery-selectbox" onchange="enableButton();"');
     $lists['menu'] = $objJSNUtils->renderMenuComboBox(null, 'Select menu', 'menutype', 'class="jsnis-gallery-selectbox jsnis-menutype-selection" onchange="createViaMenu();"');
     $this->assignRef('pluginContentInfo', $pluginContentInfo);
     $this->assignRef('totalShowlist', $totalShowlist[0]);
     $this->assignRef('totalShowcase', $totalShowcase[0]);
     $this->assignRef('totalProfile', $totalProfile[0]);
     $this->assignRef('currentLanguage', $languageObj);
     $this->assignRef('lists', $lists);
     $this->assignRef('allContentTips', $allContentTips);
     parent::display($tpl);
 }
Esempio n. 24
0
 function display($tpl = null)
 {
     global $mainframe;
     JHTML::_('stylesheet', 'popup-imagemanager.css', 'administrator/components/com_imageshow/assets/css/');
     $document =& JFactory::getDocument();
     $document->addScriptDeclaration("var JSNISImageManager = window.parent.JSNISImageManager;");
     $objJSNMediaManager = JSNISFactory::getObj('classes.jsn_is_mediamanager');
     $images = $objJSNMediaManager->getImages();
     $folders = $objJSNMediaManager->getFolders();
     $this->assign('baseURL', $objJSNMediaManager->comMediaBaseURL);
     $this->assignRef('images', $images);
     $this->assignRef('folders', $folders);
     parent::display($tpl);
 }
Esempio n. 25
0
 /**
  * Add nesscessary JS & CSS files
  *
  * @return void
  */
 private function _addAssets()
 {
     $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
     JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
     $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
     JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js');
     JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js');
     JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css');
     JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
     !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/image_selector.css');
     JSNHtmlAsset::loadScript('imageshow/joomlashine/showlist', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE'))));
 }
Esempio n. 26
0
 /**
  * Add nesscessary JS & CSS files
  *
  * @return void
  */
 private function _addAssets()
 {
     $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media');
     !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets();
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/view.about.css');
     $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css');
     JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js');
     $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js');
     JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js');
     // Add toolbar menu
     JSNISImageShowHelper::addToolbarMenu();
     // Set the submenu
     JSNISImageShowHelper::addSubmenu('about');
 }
Esempio n. 27
0
 function checkVersion()
 {
     $jsnProductInfo = 'http://www.joomlashine.com/joomla-extensions/jsn-imageshow-version-check.html';
     $objJSNHTTP = JSNISFactory::getObj('classes.jsn_is_httprequest', null, $jsnProductInfo);
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $result = $objJSNHTTP->DownloadToString();
     if ($result == false) {
         echo $objJSNJSON->encode(array('connection' => false, 'version' => ''));
         exit;
     } else {
         $stringExplode = explode("\n", $result);
         echo $objJSNJSON->encode(array('connection' => true, 'version' => @$stringExplode[2]));
         exit;
     }
 }
Esempio n. 28
0
 function display($tpl = null)
 {
     global $mainframe;
     JHTML::_('script', 'jsn_is_imagemanager.js', 'administrator/components/com_imageshow/assets/js/');
     JHTML::_('stylesheet', 'popup-imagemanager.css', 'administrator/components/com_imageshow/assets/css/');
     JHTML::_('stylesheet', 'system.css', 'templates/system/css/');
     $objJSNMediaManager = JSNISFactory::getObj('classes.jsn_is_mediamanager');
     $objJSNMediaManager->setMediaBasePath();
     $state = $objJSNMediaManager->getStateFolder();
     $folderList = $objJSNMediaManager->getFolderList();
     $this->assignRef('session', JFactory::getSession());
     $this->assignRef('state', $state);
     $this->assignRef('folderList', $folderList);
     parent::display($tpl);
 }
Esempio n. 29
0
 function display($tpl = null)
 {
     $showCaseID = JRequest::getInt('showcase_id', 0);
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = $objUtils->overrideURL();
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $row = $objJSNShowcase->getShowCaseByID($showCaseID);
     if (count($row) <= 0) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     $dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL);
     $document = JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     echo json_encode($dataObj);
     return;
 }
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->_externalPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_imageshow';
     //load profile table
     $this->_source['profileTable'] = JTable::getInstance('SourceProfile', 'Table');
     $this->_source['profileTable']->load($this->_showlistTable->image_source_profile_id);
     // load source table
     $this->_source['sourceTable'] = $this->getSourceTable();
     $this->_source['sourceTable']->load($this->_source['profileTable']->external_source_id);
     $objJSNImages = JSNISFactory::getObj('classes.jsn_is_images');
     $albumSync = $objJSNImages->getSyncAlbumsByShowlistID($this->_showlistTable->showlist_id);
     if (count($albumSync) > 0) {
         $this->_syncmode = true;
         $this->_syncAlbum = $albumSync;
     }
 }