本文整理汇总了PHP中JSNISFactory::getSource方法的典型用法代码示例。如果您正苦于以下问题:PHP JSNISFactory::getSource方法的具体用法?PHP JSNISFactory::getSource怎么用?PHP JSNISFactory::getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSNISFactory
的用法示例。
在下文中一共展示了JSNISFactory::getSource方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
// Get config parameters
$config = JSNConfigHelper::get();
$this->_document = JFactory::getDocument();
JHtmlBehavior::framework();
// Set the toolbar
JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('MAINTENANCE_CONFIGURATION_AND_MAINTENANCE'), 'maintenance');
// Get messages
$msgs = '';
if (!$config->get('disable_all_messages')) {
$msgs = JSNUtilsMessage::getList('CONFIGURATION_AND_MAINTENANCE');
$msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
}
// Assign variables for rendering
$this->assignRef('msgs', $msgs);
$this->_addAssets();
$this->addToolbar();
// Type of screen
$type = JRequest::getWord('type', 'backup');
$themeName = JRequest::getWord('theme_name');
$sourceType = JRequest::getString('source_type');
switch ($type) {
case 'themeparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $themeName . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('theme_config');
break;
case 'profileparameters':
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('source_config');
break;
case 'editprofile':
$sourceID = JRequest::getInt('external_source_id');
$countShowlist = JRequest::getInt('count_showlist');
$imageSource = JSNISFactory::getSource($sourceType, 'external');
$imageSource->_source['sourceTable']->load($sourceID);
$this->assignRef('sourceInfo', $imageSource->_source['sourceTable']);
$this->assignRef('countShowlist', $countShowlist);
$this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . 'source' . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl');
echo $this->loadTemplate('edit_source_profile');
break;
default:
// Display the template
parent::display($tpl);
break;
}
}
示例2: deleteProfile
/**
* Delete a specifed profile
*
* @param int $sourceID The ID of source
* @param string $sourceName The name of source
*
* @return void
*/
public function deleteProfile($sourceID, $sourceName)
{
$query = 'SELECT sl.showlist_id FROM #__imageshow_source_profile p
INNER JOIN #__imageshow_showlist sl
ON sl.image_source_profile_id = p.external_source_profile_id
WHERE
p.external_source_id = ' . (int) $sourceID . '
AND
sl.image_source_name = ' . $this->_db->quote($sourceName);
$this->_db->setQuery($query);
$result = $this->_db->loadObjectList();
if (count($result)) {
$showlistTable = JTable::getInstance('showlist', 'Table');
foreach ($result as $showlist) {
if ($showlistTable->load($showlist->showlist_id)) {
$imageSource = JSNISFactory::getSource($showlistTable->image_source_name, $showlistTable->image_source_type, $showlistTable->showlist_id);
$imageSource->removeAllImages(array('showlist_id' => $showlistTable->showlist_id));
$imageSource->_source['profileTable']->delete();
$showlistTable->image_source_name = '';
$showlistTable->image_source_type = '';
$showlistTable->image_source_profile_id = 0;
$showlistTable->store();
}
}
}
//remove source
$query = 'DELETE FROM #__imageshow_external_source_' . $sourceName . '
WHERE external_source_id = ' . (int) $sourceID;
$this->_db->setQuery($query);
$this->_db->query();
}
示例3: defined
* Websites: http://www.joomlashine.com
* Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html
*/
defined('_JEXEC') or die('Restricted access');
$app = JFactory::getApplication();
$showlistID = JRequest::getInt('showlist_id', 0);
$sourceIdentify = JRequest::getVar('source_identify', '');
$sourceType = JRequest::getVar('image_source_type', '');
$return = JRequest::getVar('return', '', 'get');
if (base64_decode($return) != @$_SERVER['HTTP_REFERER']) {
$app->redirect(base64_decode($return));
return;
}
$availableProfile = array();
if ($sourceIdentify != '') {
$imageSource = JSNISFactory::getSource($sourceIdentify, $sourceType, $showlistID);
$availableProfile = $imageSource->getAvaiableProfiles();
}
$availableProfile = array_reverse($availableProfile);
$exsitedAvailableProfile = count($availableProfile);
$availableProfile[] = array('value' => 0, 'text' => ' - ' . JText::_('SHOWLIST_PROFILE_SELECT_PROFILE') . ' - ');
$availableProfile = array_reverse($availableProfile);
$params = JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_SAVE', 'JSN_IMAGESHOW_CLOSE', 'JSN_IMAGESHOW_CONFIRM'));
?>
<script type="text/javascript">
var objISShowlist = null;
require(['imageshow/joomlashine/showlist'], function (JSNISShowlist) {
objISShowlist = new JSNISShowlist({
language: <?php
echo json_encode($params);
?>
示例4: uninstallImageSource
function uninstallImageSource($sourceInfo)
{
if (!isset($sourceInfo->pluginInfo)) {
return false;
}
$pluginTable = JTable::getInstance('extension', 'JTable');
if ($pluginTable->load((int) $sourceInfo->pluginInfo->extension_id)) {
$tableName = str_replace('source', '', $pluginTable->element);
$query = 'SELECT *
FROM #__imageshow_showlist
WHERE image_source_name = ' . $this->_db->quote($sourceInfo->identified_name) . '
AND image_source_type = ' . $this->_db->quote($sourceInfo->type);
$this->_db->setQuery($query);
$showlists = $this->_db->loadObjectList();
foreach ($showlists as $showlist) {
$imageSource = JSNISFactory::getSource($showlist->image_source_name, $showlist->image_source_type, $showlist->showlist_id);
// remove all images
$imageSource->removeAllImages(array('showlist_id' => $showlist->showlist_id));
// remove profile if have profile
if (isset($imageSource->_source['profileTable'])) {
$imageSource->_source['profileTable']->delete();
}
// update showlist
$imageSource->_showlistTable->image_source_type = '';
$imageSource->_showlistTable->image_source_name = '';
$imageSource->_showlistTable->image_source_profile_id = 0;
$imageSource->_showlistTable->store();
}
}
return true;
}
示例5: getShowlist2JSON
public function getShowlist2JSON($URL, $showlistID)
{
$objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist');
$objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
$showlistTable = JTable::getInstance('showlist', 'Table');
$images = array();
if ($showlistTable->load($showlistID) && $showlistTable->image_source_name) {
$imageSource = JSNISFactory::getSource($showlistTable->image_source_name, $showlistTable->image_source_type, $showlistID);
$images = $imageSource->getImages2JSON(array('URL' => $URL, 'showlist_id' => $showlistID, 'limitEdition' => true));
}
$showlistInfo = $objJSNShowlist->getShowListByID($showlistID);
$dataObj = new stdClass();
//showlist
$showlistObj = new stdClass();
$showlistObj->{'title'} = $showlistInfo['showlist_title'];
$showlistObj->{'description'} = $showlistInfo['description'];
$showlistObj->{'link'} = $showlistInfo['showlist_link'];
$overrideTitle = $showlistInfo['override_title'];
$overrideDesc = $showlistInfo['override_description'];
$overrideLink = $showlistInfo['override_link'];
$showExifData = $showlistInfo['show_exif_data'];
//images object
$imagesObj = new stdClass();
$arrayImage = array();
foreach ($images as $image) {
if ($overrideTitle == 1) {
$image->title = $showlistInfo['showlist_title'];
}
if ($overrideDesc == 1) {
$image->description = $showlistInfo['description'];
}
if ($overrideLink == 1) {
$image->link = $showlistInfo['showlist_link'];
}
if (!$objUtils->isDomain($image->link)) {
$image->link = $URL . $image->link;
}
$tmpExifData = '';
if (@$image->exif_data != '') {
$tmpExifData = '(' . @$image->exif_data . ')';
}
if ($showExifData == 'title') {
$image->title = $image->title . ' ' . $tmpExifData;
} elseif ($showExifData == 'description') {
if ($image->description != '') {
$image->description = $image->description . "\n" . $tmpExifData;
} else {
$image->description = $image->description . $tmpExifData;
}
} else {
}
$arrayImage[] = $image;
}
$imagesObj->{'image'} = $arrayImage;
// end images object
$showlistObj->{'images'} = $imagesObj;
$dataObj->{'showlist'} = $showlistObj;
// end show list
return $dataObj;
}
示例6: validateProfile
/**
* Validate profile
*
* @return void
*/
public function validateProfile()
{
$get = JRequest::get('get');
$data['success'] = true;
$imageSource = JSNISFactory::getSource($get['source'], 'external');
$data['success'] = $imageSource->getValidation($get);
$data['msg'] = $data['success'] == false ? $imageSource->getErrorMsg() : '';
echo json_encode($data);
exit;
}
示例7: init
/**
* Function init show all images selected of the first album is selected
*/
function init()
{
// load all album is selected with current showlist -> and then get the firt album to get all images of that album.
$showListID = JRequest::getVar('showListID', '');
$sourceType = JRequest::getVar('sourceType', '');
$sourceName = JRequest::getVar('sourceName', '');
$selectMode = JRequest::getVar('selectMode', '');
$imageSource = JSNISFactory::getSource($sourceName, $sourceType, $showListID);
$model = $this->getModel('images');
$cat = $model->getAllCatShowlist($showListID);
if (!empty($cat)) {
$catid = $cat[0];
$config = array('album' => $catid);
$images = $imageSource->loadImages($config);
} else {
$images->images = array();
}
include JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_imageshow' . DS . 'views' . DS . 'showlist' . DS . 'tmpl' . DS . 'init.php';
jexit();
}
示例8: delete
public function delete($cid = array())
{
$result = false;
if (count($cid)) {
JArrayHelper::toInteger($cid);
$showlistTable = JTable::getInstance('showlist', 'Table');
foreach ($cid as $showlistID) {
$showlistTable->load($showlistID);
$imageSource = JSNISFactory::getSource($showlistTable->image_source_name, $showlistTable->image_source_type, $showlistID);
$imageSource->removeShowlist();
}
}
return true;
}
示例9: getScriptCheckThumb
function getScriptCheckThumb()
{
$showlistID = JRequest::getInt('showlist_id');
$script = '';
$showlistTable = JTable::getInstance('showlist', 'Table');
$showlistTable->load($showlistID);
if ($showlistTable->image_source_name != '') {
$imageSource = JSNISFactory::getSource($showlistTable->image_source_name, $showlistTable->image_source_type, $showlistID);
$script .= $imageSource->renderScriptcheckThumb();
} else {
$script .= ' JSNISImageShow.checkThumbCallBack(); ';
}
return $script;
}
示例10: checksyncalbum
/**
*
* Check sync
*/
public function checksyncalbum()
{
$syncCate = JRequest::getVar('syncCate', '');
//$syncCate = str_replace("cat_","",$syncCate);
$showListID = JRequest::getVar('showListID', '');
$sourceType = JRequest::getVar('sourceType', '');
$sourceName = JRequest::getVar('sourceName', '');
$imageSource = JSNISFactory::getSource($sourceName, $sourceType, $showListID);
if ($imageSource->getShowlistMode() == 'sync' && $imageSource->checkSync($syncCate)) {
$status = 'is_selected';
} else {
$status = 'none';
}
jexit($status);
}