本文整理汇总了PHP中JCckDevHelper::getRelativePath方法的典型用法代码示例。如果您正苦于以下问题:PHP JCckDevHelper::getRelativePath方法的具体用法?PHP JCckDevHelper::getRelativePath怎么用?PHP JCckDevHelper::getRelativePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCckDevHelper
的用法示例。
在下文中一共展示了JCckDevHelper::getRelativePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_variation
public function export_variation()
{
$app = JFactory::getApplication();
$model = $this->getModel();
$name = $app->input->getString('variation', '');
$folder = $app->input->getString('folder', '');
if ($file = $model->prepareExport_Variation($name, $folder)) {
$file = JCckDevHelper::getRelativePath($file, false);
$this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
} else {
$this->setRedirect('index.php?option=com_cck&view=variations');
}
}
示例2: export
public function export()
{
$app = JFactory::getApplication();
$model = $this->getModel();
$recordId = $app->input->getInt('id', 0);
$elements = $app->input->getString('elements', '');
$elements = array_flip(explode(',', $elements));
$dependencies = array();
$menu = $app->input->getInt('dep_menu', 0);
$options = $app->input->get('options', array(), 'array');
if ($app->input->getInt('dep_categories', 0)) {
$dependencies['categories'] = 1;
}
if ($menu) {
$dependencies['menu'] = $menu;
}
if ($file = $model->prepareExport($recordId, $elements, $dependencies, $options)) {
$file = JCckDevHelper::getRelativePath($file, false);
$this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
} else {
$this->setRedirect(_C0_LINK, JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
}
}
示例3: process
public function process()
{
// JSession::checkToken() or jexit( JText::_( 'JINVALID_TOKEN' ) );
if (!is_file(JPATH_ADMINISTRATOR . '/components/com_cck_toolbox/models/cck_toolbox.php')) {
$this->setRedirect($this->_getReturnPage(), JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return;
}
$app = JFactory::getApplication();
$ids = $app->input->get('cid', array(), 'array');
$task_id = $app->input->getInt('tid', 0);
jimport('joomla.utilities.arrayhelper');
JArrayHelper::toInteger($ids);
require_once JPATH_ADMINISTRATOR . '/components/com_cck_toolbox/models/cck_toolbox.php';
$model = JModelLegacy::getInstance('CCK_Toolbox', 'CCK_ToolboxModel');
$params = JComponentHelper::getParams('com_cck_toolbox');
$output = 1;
// $params->get( 'output', 0 );
if ($file = $model->prepareProcess($params, $task_id, $ids)) {
if ($output > 0) {
$this->setRedirect($this->_getReturnPage(), JText::_('COM_CCK_SUCCESSFULLY_PROCESSED'), 'message');
} else {
$file = JCckDevHelper::getRelativePath($file, false);
$this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
}
} else {
$this->setRedirect($this->_getReturnPage(), JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
}
}
示例4: export
public function export()
{
$app = JFactory::getApplication();
$type = $app->input->getString('extension', 'plugin');
$model = $this->getModel();
if ($type == 'languages') {
$lang_tag = $app->input->getString('lang_tag', 'en-GB');
if ($file = $model->prepareLanguages($lang_tag)) {
$file = JCckDevHelper::getRelativePath($file, false);
$this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
}
} else {
$id = $app->input->getInt('extension_id', 0);
if ($file = $model->prepareExport($id)) {
$file = JCckDevHelper::getRelativePath($file, false);
$this->setRedirect(JUri::base() . 'index.php?option=com_cck&task=download&file=' . $file);
} else {
switch ($type) {
case 'plugin':
default:
$link = 'index.php?option=com_' . $type . 's&view=' . $type . '&layout=edit&extension_id=' . $id;
break;
}
$this->setRedirect($link, 'Plugin not found. Try to download it manually.', 'notice');
}
}
}