本文整理汇总了PHP中vmPlugin::_getLayoutPath方法的典型用法代码示例。如果您正苦于以下问题:PHP vmPlugin::_getLayoutPath方法的具体用法?PHP vmPlugin::_getLayoutPath怎么用?PHP vmPlugin::_getLayoutPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmPlugin
的用法示例。
在下文中一共展示了vmPlugin::_getLayoutPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplatePath
/**
* @param $pluginName
* @param $group
* @param string $layout
* @return mixed
* @author Valérie Isaksen
*/
public function getTemplatePath($pluginName, $group, $layout = 'default')
{
$layoutPath = vmPlugin::_getLayoutPath($pluginName, 'vm' . $group, $layout);
return str_replace(DS . $layout . '.php', '', $layoutPath);
}
示例2: renderByLayout
/**
* Get the path to a layout for a type
*
* @param string $type The name of the type
* @param string $layout The name of the type layout. If alternative
* layout, in the form template:filename.
* @param array $viewData The data you want to use in the layout
* can be an object/array/string... to reuse in the template
* @return string The path to the type layout
* original from libraries\joomla\application\module\helper.php
* @since 11.1
* @author Patrick Kohl, Valérie Isaksen
*/
public function renderByLayout($layout_name = 'default', $viewData = NULL, $name = NULL, $psType = NULL)
{
if ($name === NULL) {
$name = $this->_name;
}
static $theme;
if (empty($theme)) {
include JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'onepage.cfg.php';
$theme = $selected_template;
}
if ($psType === NULL) {
$psType = $this->_psType;
}
$layout = vmPlugin::_getLayoutPath($name, 'vm' . $psType, $layout_name);
jimport('joomla.filesystem.file');
$psType = strtolower($psType);
$psType = JFile::makeSafe($psType);
$isset = false;
//echo JPATH_SITE.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_onepage'.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$theme.DIRECTORY_SEPARATOR.'overrides'.DIRECTORY_SEPARATOR.$psType.DIRECTORY_SEPARATOR.$name.DIRECTORY_SEPARATOR.$layout_name.'.php';
if (file_exists(JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $theme . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . $layout_name . '.php')) {
$name = JFile::makeSafe($name);
$layout_name = JFile::makeSafe($layout_name);
$layout = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $theme . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . $layout_name . '.php';
$isset = true;
} else {
if (file_exists(JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . $layout_name . '.php')) {
$isset = true;
$name = JFile::makeSafe($name);
$layout_name = JFile::makeSafe($layout_name);
$layout = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . $layout_name . '.php';
}
}
if (!$isset) {
if (strpos($layout, 'payment_form') !== false) {
if (strpos($layout, 'klarna') !== false) {
$layout = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . 'klarna' . DIRECTORY_SEPARATOR . 'payment_form.php';
}
}
}
if (is_array($viewData)) {
if (!empty($viewData['paymnentForm']) && $viewData['paymentForm'] == '#paymentForm') {
$viewData['paymnentForm'] = '#adminForm';
}
}
if (!$isset) {
if (strpos($layout, 'javascript') !== false && $name == 'stripe') {
$layout = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . 'stripe' . DIRECTORY_SEPARATOR . 'javascript.php';
}
}
if (strpos($layout, 'display_payment') !== false) {
if (strpos($layout, 'ddmandate') !== false) {
$layout = JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'overrides' . DIRECTORY_SEPARATOR . $psType . DIRECTORY_SEPARATOR . 'ddmandate' . DIRECTORY_SEPARATOR . 'payment_form.php';
}
}
if (!file_exists($layout)) {
//JFactory::getApplication()->enqueueMessage('Layout not found: '.$layout);
} else {
ob_start();
include $layout;
$html = ob_get_clean();
return $html;
}
}
示例3: renderByLayout
/**
* Get the path to a layout for a type
*
* @param string $type The name of the type
* @param string $layout The name of the type layout. If alternative
* layout, in the form template:filename.
* @param array $viewData The data you want to use in the layout
* can be an object/array/string... to reuse in the template
* @return string The path to the type layout
* original from libraries\joomla\application\module\helper.php
* @since 11.1
* @author Patrick Kohl, Valérie Isaksen
*/
public function renderByLayout($layout = 'default', $viewData = NULL, $name = NULL, $psType = NULL)
{
if ($name === NULL) {
$name = $this->_name;
}
if ($psType === NULL) {
$psType = $this->_psType;
}
$layout = vmPlugin::_getLayoutPath($name, 'vm' . $psType, $layout);
ob_start();
include $layout;
return ob_get_clean();
}
示例4: renderByLayout
/**
* Get the path to a layout for a type
*
* @param string $type The name of the type
* @param string $layout The name of the type layout. If alternative
* layout, in the form template:filename.
* @param array $viewData The data you want to use in the layout
* can be an object/array/string... to reuse in the template
* @return string The path to the type layout
* original from libraries\joomla\application\module\helper.php
* @since 11.1
* @author Patrick Kohl, Valérie Isaksen
*/
public function renderByLayout($layout = 'default', $viewData = NULL, $name = NULL, $psType = NULL)
{
if ($name === NULL) {
$name = $this->_name;
}
if ($psType === NULL) {
$psType = $this->_psType;
}
if (!($file = vmPlugin::_getLayoutPath($name, 'vm' . $psType, $layout))) {
JError::raiseNotice(100, $layout . ' not found ');
return;
}
ob_start();
include $file;
return ob_get_clean();
}