本文整理汇总了PHP中NNFrameworkFunctions::getByUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP NNFrameworkFunctions::getByUrl方法的具体用法?PHP NNFrameworkFunctions::getByUrl怎么用?PHP NNFrameworkFunctions::getByUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NNFrameworkFunctions
的用法示例。
在下文中一共展示了NNFrameworkFunctions::getByUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: NNFrameworkFunctions
function __construct()
{
$url = JFactory::getApplication()->input->getString('url', '');
require_once JPATH_PLUGINS . '/system/nnframework/helpers/functions.php';
$func = new NNFrameworkFunctions();
if ($url) {
echo $func->getByUrl($url);
die;
}
$file = JFactory::getApplication()->input->getString('file', '');
// only allow files that have .inc.php in the file name
if (!$file || strpos($file, '.inc.php') === false) {
die;
}
$folder = JFactory::getApplication()->input->getString('folder', '');
if ($folder) {
$file = implode('/', explode('.', $folder)) . '/' . $file;
}
$allowed = array('administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/modules/mod_addtomenu/addtomenu.inc.php', 'media/rereplacer/images/image.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
if (!$file || in_array($file, $allowed) === false) {
die;
}
jimport('joomla.filesystem.file');
if (JFactory::getApplication()->isSite()) {
JFactory::getApplication()->setTemplate('../administrator/templates/isis');
}
$_REQUEST['tmpl'] = 'component';
JFactory::getApplication()->input->set('option', '1');
JHtml::_('bootstrap.framework');
JFactory::getDocument()->addScript(JURI::root(true) . '/administrator/templates/isis/js/template.js');
JFactory::getDocument()->addStyleSheet(JURI::root(true) . '/administrator/templates/isis/css/template.css');
JHtml::stylesheet('nnframework/popup.min.css', false, true);
$file = JPATH_SITE . '/' . $file;
$html = '';
if (JFile::exists($file)) {
ob_start();
include $file;
$html = ob_get_contents();
ob_end_clean();
}
JFactory::getDocument()->setBuffer($html, 'component');
if (version_compare(JVERSION, '3.2', 'l')) {
JFactory::getApplication()->render();
} else {
nnApplication::render();
}
$html = JResponse::toString(JFactory::getApplication()->getCfg('gzip'));
$html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
$html = preg_replace('#(<' . 'body [^>]*class=")#s', '\\1nnpopup ', $html);
$html = str_replace('<' . 'body>', '<' . 'body class="nnpopup"', $html);
echo $html;
die;
}
示例2: render
function render()
{
$url = JFactory::getApplication()->input->getString('url', '');
$func = new NNFrameworkFunctions();
if ($url) {
echo $func->getByUrl($url);
die;
}
$allowed = array('administrator/components/com_dbreplacer/ajax.php', 'administrator/modules/mod_addtomenu/popup.php', 'media/rereplacer/images/popup.php', 'plugins/editors-xtd/articlesanywhere/popup.php', 'plugins/editors-xtd/contenttemplater/popup.php', 'plugins/editors-xtd/dummycontent/popup.php', 'plugins/editors-xtd/modals/popup.php', 'plugins/editors-xtd/modulesanywhere/popup.php', 'plugins/editors-xtd/sliders/popup.php', 'plugins/editors-xtd/snippets/popup.php', 'plugins/editors-xtd/sourcerer/popup.php', 'plugins/editors-xtd/tabs/popup.php', 'plugins/editors-xtd/tooltips/popup.php', 'administrator/components/com_dbreplacer/dbreplacer.inc.php', 'administrator/components/com_nonumbermanager/details.inc.php', 'administrator/modules/mod_addtomenu/addtomenu.inc.php', 'media/rereplacer/images/image.inc.php', 'plugins/editors-xtd/articlesanywhere/articlesanywhere.inc.php', 'plugins/editors-xtd/contenttemplater/contenttemplater.inc.php', 'plugins/editors-xtd/dummycontent/dummycontent.inc.php', 'plugins/editors-xtd/modulesanywhere/modulesanywhere.inc.php', 'plugins/editors-xtd/snippets/snippets.inc.php', 'plugins/editors-xtd/sourcerer/sourcerer.inc.php');
$file = JFactory::getApplication()->input->getString('file', '');
$folder = JFactory::getApplication()->input->getString('folder', '');
if ($folder) {
$file = implode('/', explode('.', $folder)) . '/' . $file;
}
if (!$file || in_array($file, $allowed) === false) {
die;
}
jimport('joomla.filesystem.file');
if (JFactory::getApplication()->isSite()) {
JFactory::getApplication()->setTemplate('../administrator/templates/isis');
}
$_REQUEST['tmpl'] = 'component';
JFactory::getApplication()->input->set('option', 'com_content');
header('Content-Type: text/html; charset=utf-8');
JHtml::_('bootstrap.framework');
JFactory::getDocument()->addScript(JUri::root(true) . '/administrator/templates/isis/js/template.js');
JFactory::getDocument()->addStyleSheet(JUri::root(true) . '/administrator/templates/isis/css/template.css');
JHtml::stylesheet('nnframework/popup.min.css', false, true);
$file = JPATH_SITE . '/' . $file;
$html = '';
if (JFile::exists($file)) {
ob_start();
include $file;
$html = ob_get_contents();
ob_end_clean();
}
JFactory::getDocument()->setBuffer($html, 'component');
NNApplication::render();
$html = JResponse::toString(JFactory::getApplication()->getCfg('gzip'));
$html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*templates/system/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
$html = preg_replace('#(<' . 'body [^>]*class=")#s', '\\1nnpopup ', $html);
$html = str_replace('<' . 'body>', '<' . 'body class="nnpopup"', $html);
echo $html;
die;
}