本文整理汇总了PHP中JClientHelper::hasCredentials方法的典型用法代码示例。如果您正苦于以下问题:PHP JClientHelper::hasCredentials方法的具体用法?PHP JClientHelper::hasCredentials怎么用?PHP JClientHelper::hasCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JClientHelper
的用法示例。
在下文中一共展示了JClientHelper::hasCredentials方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$config = JComponentHelper::getParams('com_media');
if (!$app->isAdmin()) {
return $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');
}
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$session = JFactory::getSession();
$state = $this->get('state');
$this->session = $session;
$this->config =& $config;
$this->state =& $state;
$this->require_ftp = $ftp;
$this->folders_id = ' id="media-tree"';
$this->folders = $this->get('folderTree');
$this->sidebar = JHtmlSidebar::render();
// Set the toolbar
$this->addToolbar();
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
global $mainframe;
$style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$listStyle = "\n\t\t\t<ul id=\"submenu\">\n\t\t\t\t<li><a id=\"thumbs\" onclick=\"MediaManager.setViewType('thumbs')\">" . JText::_('Thumbnail View') . "</a></li>\n\t\t\t\t<li><a id=\"details\" onclick=\"MediaManager.setViewType('details')\">" . JText::_('Detail View') . "</a></li>\n\t\t\t</ul>\n\t\t";
$document =& JFactory::getDocument();
$document->setBuffer($listStyle, 'module', 'submenu');
JHTML::_('behavior.mootools');
$document->addScript('components/com_media/assets/mediamanager.js');
$document->addStyleSheet('components/com_media/assets/mediamanager.css');
JHTML::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
JHTML::script('mootree.js');
JHTML::stylesheet('mootree.css');
JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
$base = str_replace("\\", "/", JPATH_ROOT);
$js = "\n\t\t\tvar basepath = '" . $base . '/images' . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', JComponentHelper::getParams('com_media'));
$this->assignRef('state', $this->get('state'));
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $this->get('folderTree'));
// Set the toolbar
$this->_setToolBar();
parent::display($tpl);
echo JHTML::_('behavior.keepalive');
}
示例3: display
function display($tpl = null)
{
global $mainframe;
$config =& JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
$append = '';
if ($app->getClientId() == 1) {
$append = 'administrator/';
}
JHTML::_('script', 'popup-imagemanager.js', $append . 'components/com_media/assets/');
JHTML::_('stylesheet', 'popup-imagemanager.css', $append . 'components/com_media/assets/');
if ($config->get('enable_flash', 1)) {
JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ ImageManager.refreshFrame(); }'));
}
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', $config);
$this->assignRef('state', $this->get('state'));
$this->assignRef('folderList', $this->get('folderList'));
$this->assign('require_ftp', $ftp);
parent::display($tpl);
}
示例4: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*
* @since 3.6
*/
public function display($tpl = null)
{
$this->user = JFactory::getUser();
$this->bar = JToolbar::getInstance('toolbar');
$ftp = !JClientHelper::hasCredentials('ftp');
$images = $this->get('images');
$subfolders = $this->get('folders');
$folders = $this->getModel()->getFolders(COM_MEDIA_BASE);
$currentFolder = $this->getModel()->getCurrentFolder();
$state = $this->get('state');
$this->session = JFactory::getSession();
$this->config = JComponentHelper::getParams('com_media');
$this->state = $this->get('state');
$this->require_ftp = $ftp;
$this->images = $images;
$this->folders = $folders;
$this->current_folder = $currentFolder;
$this->subfolders = $subfolders;
$this->state = $state;
if ($this->state->folder === "") {
$this->state->folder = COM_MEDIA_BASEURL;
}
// Set the toolbar
$this->addToolbar();
parent::display($tpl);
}
示例5: display
function display($tpl = null)
{
$config = JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$append = '';
$clave = JRequest::getVar('clave');
JHtml::_('behavior.framework', true);
JHtml::_('script', 'media/popup-imagemanager.js', true, true);
JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', array(), true);
}
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = JFactory::getSession();
$this->config = $config;
$this->state = $this->get('state');
$this->folderList = $this->get('folderList');
$this->require_ftp = $ftp;
parent::display($tpl);
}
示例6: display
function display($tpl = null)
{
$app =& JFactory::getApplication();
$config =& JComponentHelper::getParams('com_media');
$style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$document =& JFactory::getDocument();
$document->setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu');
JHtml::_('behavior.framework', true);
$document->addScript('../media/media/js/mediamanager.js');
$document->addStyleSheet('../media/media/css/mediamanager.css');
JHtml::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
JHtml::script('mootree.js');
JHtml::stylesheet('mootree.css');
if ($config->get('enable_flash', 1)) {
$fileTypes = $config->get('image_extensions', 'bmp,gif,jpg,png,jpeg');
$types = explode(',', $fileTypes);
$displayTypes = '';
// this is what the user sees
$filterTypes = '';
// this is what controls the logic
$firstType = true;
foreach ($types as $type) {
if (!$firstType) {
$displayTypes .= ', ';
$filterTypes .= '; ';
} else {
$firstType = false;
}
$displayTypes .= '*.' . $type;
$filterTypes .= '*.' . $type;
}
$typeString = '{ \'Images (' . $displayTypes . ')\': \'' . $filterTypes . '\' }';
JHtml::_('behavior.uploader', 'upload-flash', array('onComplete' => 'function(){ MediaManager.refreshFrame(); }', 'targetURL' => '\\$(\'uploadForm\').action', 'typeFilter' => $typeString));
}
if (DS == '\\') {
$base = str_replace(DS, "\\\\", COM_MEDIA_BASE);
} else {
$base = COM_MEDIA_BASE;
}
$js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', $config);
$this->assignRef('state', $this->get('state'));
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $this->get('folderTree'));
// Set the toolbar
$this->_setToolBar();
parent::display($tpl);
echo JHtml::_('behavior.keepalive');
}
示例7: display
function display($tpl = null)
{
$config = JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$append = '';
JHtml::_('behavior.framework', true);
//JHtml::_('script', 'media/popup-imagemanager.js', true, true);
JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', array(), true);
}
$document =& JFactory::getDocument();
$directory = "administrator/";
if (JFactory::getApplication()->isAdmin()) {
$directory = "";
}
if (JRequest::getVar("only") == "folder") {
$document->addScript($directory . "components/com_fieldsattach/popup-imagemanager_folder.js");
} else {
$document->addScript($directory . "components/com_fieldsattach/popup-imagemanager.js");
}
//ADD LANGUAGE
$lang =& JFactory::getLanguage();
$extension = 'com_media';
$base_dir = JPATH_SITE;
$language_tag = JRequest::getVar("lang");
$reload = true;
$lang->load($extension, $base_dir, $language_tag, $reload);
//FILEROOT
/*$path = "file_path";
$view = JRequest::getCmd('view');
if (substr(strtolower($view), 0, 6) == "images" || $popup_upload == 1) {
$path = "image_path";
}
define('COM_MEDIA_BASE', JPATH_ROOT.'/'.$config->get($path, 'images'));
define('COM_MEDIA_BASEURL', JURI::root().$config->get($path, 'images'));
*/
// $sitepath = JPATH_ADMINISTRATOR ;
// JLoader::register('MediaModelManager', $sitepath.DS.'components/com_media/models/manager.php');
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = JFactory::getSession();
$this->config = $config;
$this->state = $this->get('state');
$this->folderList = $this->get('folderList');
//$this->folderList = MediaModelManager::getFolderList(COM_MEDIA_BASE);
//echo "FOLDEER:".MediaModelManager::getFolderList(COM_MEDIA_BASE) ;
$this->require_ftp = $ftp;
parent::display($tpl);
}
示例8: display
function display($tpl = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$config = JComponentHelper::getParams(JACOMPONENT);
$lang = JFactory::getLanguage();
//$style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'details', 'word');
$style = "details";
JHtml::_('behavior.framework', true);
$assets = JURI::root() . 'administrator/components/com_jaextmanager/assets/';
$document = JFactory::getDocument();
if (jaIsJoomla3x()) {
$document->setBuffer($this->loadTemplate('navigation'), 'modules', 'top');
JHtml::_('script', $assets . 'repo_manager_3/' . 'repomanager.js', false, true);
JHtml::_('stylesheet', $assets . 'repo_manager_3/' . 'repomanager.css', false, true);
} else {
$document->setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu');
JHtml::_('script', $assets . 'repo_manager/' . 'repomanager.js', false, true);
JHtml::_('stylesheet', $assets . 'repo_manager/' . 'repomanager.css', false, true);
}
JHtml::_('behavior.modal', 'a.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
JHtml::_('script', 'system/mootree.js', true, true, false, false);
JHtml::_('stylesheet', 'system/mootree.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/mootree_rtl.css', array(), true);
}
if ($config->get('enable_flash', 0)) {
JHtml::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
}
if (DS == '\\') {
$base = str_replace(DS, "\\\\", JA_WORKING_DATA_FOLDER);
} else {
$base = JA_WORKING_DATA_FOLDER;
}
$js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$session = JFactory::getSession();
$state = $this->get('state');
$folderTree = $this->get('folderTree');
$this->assignRef('session', $session);
$this->assignRef('config', $config);
$this->assignRef('state', $state);
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $folderTree);
// Set the toolbar
$this->addToolbar();
parent::display($tpl);
echo JHtml::_('behavior.keepalive');
}
示例9: display
public function display($tpl = null)
{
$app = JFactory::getApplication();
$config = JComponentHelper::getParams('com_media');
if (!$app->isAdmin()) {
return $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');
}
$lang = JFactory::getLanguage();
$style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
$document = JFactory::getDocument();
JHtml::_('behavior.framework', true);
JHtml::_('script', 'media/mediamanager.js', true, true);
/*
JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
if ($lang->isRTL()) :
JHtml::_('stylesheet', 'media/mediamanager_rtl.css', array(), true);
endif;
*/
JHtml::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function()\n\t\t{\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
// JHtml::_('script', 'system/mootree.js', true, true, false, false);
JHtml::_('stylesheet', 'system/mootree.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/mootree_rtl.css', array(), true);
}
if (DIRECTORY_SEPARATOR == '\\') {
$base = str_replace(DIRECTORY_SEPARATOR, "\\\\", COM_MEDIA_BASE);
} else {
$base = COM_MEDIA_BASE;
}
$js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$session = JFactory::getSession();
$state = $this->get('state');
$this->session = $session;
$this->config =& $config;
$this->state =& $state;
$this->require_ftp = $ftp;
$this->folders_id = ' id="media-tree"';
$this->folders = $this->get('folderTree');
// Set the toolbar
$this->addToolbar();
parent::display($tpl);
echo JHtml::_('behavior.keepalive');
}
示例10: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
$config = JComponentHelper::getParams('com_media');
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = JFactory::getSession();
$this->config = $config;
$this->state = $this->get('state');
$this->folderList = $this->get('folderList');
$this->require_ftp = $ftp;
parent::display($tpl);
}
示例11: display
function display($tpl = null)
{
Html::behavior('framework', true);
\Hubzero\Document\Assets::addComponentScript('com_media', 'popup-imagemanager.js');
\Hubzero\Document\Assets::addComponentStylesheet('com_media', 'popup-imagemanager.css');
// Display form for FTP credentials?
// Don't set them here, as there are other functions called before this one if there is any file write operation
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = App::get('session');
$this->config = Component::params('com_media');
$this->state = $this->get('state');
$this->folderList = $this->get('folderList');
$this->require_ftp = $ftp;
parent::display($tpl);
}
示例12: display
function display($tpl = null)
{
$config = JComponentHelper::getParams('com_media');
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
$append = '';
JHtml::_('behavior.framework', true);
JHtml::_('script', 'media/popup-imagemanager.js', true, true);
JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', array(), true);
}
if ($config->get('enable_flash', 1)) {
$fileTypes = $config->get('image_extensions', 'bmp,gif,jpg,png,jpeg');
$types = explode(',', $fileTypes);
$displayTypes = '';
// this is what the user sees
$filterTypes = '';
// this is what controls the logic
$firstType = true;
foreach ($types as $type) {
if (!$firstType) {
$displayTypes .= ', ';
$filterTypes .= '; ';
} else {
$firstType = false;
}
$displayTypes .= '*.' . $type;
$filterTypes .= '*.' . $type;
}
$typeString = '{ \'' . JText::_('COM_MEDIA_FILES', 'true') . ' (' . $displayTypes . ')\': \'' . $filterTypes . '\' }';
JHtml::_('behavior.uploader', 'upload-flash', array('onBeforeStart' => 'function(){ Uploader.setOptions({url: document.id(\'uploadForm\').action + \'&folder=\' + document.id(\'imageForm\').folderlist.value}); }', 'onComplete' => 'function(){ window.frames[\'imageframe\'].location.href = window.frames[\'imageframe\'].location.href; }', 'targetURL' => '\\document.id(\'uploadForm\').action', 'typeFilter' => $typeString, 'fileSizeMax' => (int) ($config->get('upload_maxsize', 0) * 1024 * 1024)));
}
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', $config);
$this->assignRef('state', $this->get('state'));
$this->assignRef('folderList', $this->get('folderList'));
$this->assign('require_ftp', $ftp);
parent::display($tpl);
}
示例13: display
function display($tpl = null)
{
global $mainframe;
$config =& JComponentHelper::getParams(JACOMPONENT);
//$style = $mainframe->getUserStateFromRequest('media.list.layout', 'layout', 'details', 'word');
$style = "details";
$listStyle = "\n\t\t\t<ul id=\"submenu\">\n\t\t\t\t<li><a title=\"\" href=\"index.php?option=" . JACOMPONENT . "&extionsion_type=&search=\"> " . JText::_("Extensions Manager") . "</a></li>\n\t\t\t\t<li><a title=\"\" href=\"index.php?option=" . JACOMPONENT . "&view=services\"> " . JText::_("Services Manager") . "</a></li>\n\t\t\t\t<li><a title=\"\" class=\"active\" href=\"index.php?option=" . JACOMPONENT . "&view=repo\"> " . JText::_("Repository Manager") . "</a></li>\n\t\t\t\t<li><a title=\"\" href=\"index.php?option=" . JACOMPONENT . "&view=default&layout=config_service\"> " . JText::_("Configurations") . "</a></li>\n\t\t\t\t<li><a title=\"\" href=\"index.php?option=" . JACOMPONENT . "&view=default&layout=help_support\"> " . JText::_("Help and Support") . "</a></li>\n\t\t\t</ul>\n\t\t";
$document =& JFactory::getDocument();
$document->setBuffer($listStyle, 'modules', 'submenu');
JHTML::_('behavior.mootools');
$document->addScript('components/' . JACOMPONENT . '/assets/repo_manager/repomanager.js');
$document->addStyleSheet('components/' . JACOMPONENT . '/assets/repo_manager/repomanager.css');
JHTML::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tdocument.preview = SqueezeBox;\n\t\t});");
JHTML::script('mootree.js');
JHTML::stylesheet('mootree.css');
if ($config->get('enable_flash', 0)) {
JHTML::_('behavior.uploader', 'file-upload', array('onAllComplete' => 'function(){ MediaManager.refreshFrame(); }'));
}
if (DS == '\\') {
$base = str_replace(DS, "\\\\", JA_WORKING_DATA_FOLDER);
} else {
$base = JA_WORKING_DATA_FOLDER;
}
$js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
jimport('joomla.client.helper');
$ftp = !JClientHelper::hasCredentials('ftp');
$this->assignRef('session', JFactory::getSession());
$this->assignRef('config', $config);
$this->assignRef('state', $this->get('state'));
$this->assign('require_ftp', $ftp);
$this->assign('folders_id', ' id="media-tree"');
$this->assign('folders', $this->get('folderTree'));
$user =& JFactory::getUser();
$this->assignRef('user', $user);
// Set the toolbar
$this->_setToolBar();
parent::display($tpl);
echo JHTML::_('behavior.keepalive');
}
示例14: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$config = JComponentHelper::getParams('com_media');
$lang = JFactory::getLanguage();
$document = JFactory::getDocument();
$mediaModel = JModelLegacy::getInstance('Manager', 'MediaModel');
$m_params = JComponentHelper::getParams('com_media');
define('COM_MEDIA_BASE', JPATH_ROOT . '/' . $m_params->get('file_path', 'images'));
if (!$app->isAdmin()) {
return $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');
}
$style = $app->getUserStateFromRequest('media.list.layout', 'layout', 'thumbs', 'word');
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'bw_postman/popup-imagemanager.js', true, true);
JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);
JHtml::_('stylesheet', 'system/mootree.css', array(), true);
if ($lang->isRTL()) {
JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', array(), true);
JHtml::_('stylesheet', 'media/mootree_rtl.css', array(), true);
}
if (DIRECTORY_SEPARATOR == '\\') {
$base = str_replace(DIRECTORY_SEPARATOR, "\\\\", COM_MEDIA_BASE);
} else {
$base = COM_MEDIA_BASE;
}
$js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
$document->addScriptDeclaration($js);
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = JFactory::getSession();
$this->config = $config;
$state = $mediaModel->getState();
$this->state =& $state;
$this->folderList = $mediaModel->getFolderList();
$this->require_ftp = $ftp;
$this->folders_id = ' id="media-tree"';
$this->folders = $mediaModel->getFolderTree();
parent::display($tpl);
}
示例15: display
function display($tpl = null)
{
global $mainframe;
$params =& JComponentHelper::getParams('com_phocagallery');
// Do not allow cache
JResponse::allowCache(false);
$document =& JFactory::getDocument();
$document->addStyleSheet('../administrator/components/com_phocagallery/assets/phocagallery.css');
$document->addStyleSheet('../administrator/templates/system/css/system.css');
$document->addCustomTag("<!--[if IE]>\n<link rel=\"stylesheet\" href=\"../administrator/components/com_phocagallery/assets/phocagalleryieall.css\" type=\"text/css\" />\n<![endif]-->");
$path = PhocaGalleryHelper::getPathSet();
$path_orig_rel = $path['orig_rel_ds'];
$this->assign('path_orig_rel', $path_orig_rel);
$this->assignRef('images', $this->get('images'));
$this->assignRef('folders', $this->get('folders'));
$this->assignRef('state', $this->get('state'));
// Upload Form ------------------------------------
JHTML::_('behavior.mootools');
//$document->addScript('components/com_phocagallery/assets/upload/mediamanager.js');
$document->addStyleSheet('components/com_phocagallery/assets/upload/mediamanager.css');
// Set FTP form
$ftp = !JClientHelper::hasCredentials('ftp');
// Set flash uploader if ftp password and login exists (will be not problems)
$state = $this->get('state');
$refreshSite = 'index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&folder=' . $state->folder;
if (!$ftp) {
if ($params->get('enable_flash', 1)) {
PhocaGalleryHelperUpload::uploader('file-upload', array('onAllComplete' => 'function(){ window.location.href="' . $refreshSite . '"; }'));
}
}
// PARAMS - Upload size
$upload_maxsize = 3000000;
if ($params->get('upload_maxsize') != '') {
$upload_maxsize = $params->get('upload_maxsize');
}
// END Upload Form ------------------------------------
$this->assignRef('session', JFactory::getSession());
$this->assignRef('uploadmaxsize', $upload_maxsize);
$this->assign('require_ftp', $ftp);
parent::display($tpl);
echo JHTML::_('behavior.keepalive');
}