本文整理汇总了PHP中UniteFunctionsRev::getPostGetVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::getPostGetVariable方法的具体用法?PHP UniteFunctionsRev::getPostGetVariable怎么用?PHP UniteFunctionsRev::getPostGetVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::getPostGetVariable方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkExportImport
/**
*
* check export / import actions
*/
private function checkExportImport()
{
//set message on start
$message = UniteFunctionsRev::getGetVar("m");
if ($message == "is") {
//import success message
$this->messageOnStart = "Import slider parameters and slides success!!!";
}
$clientAction = UniteFunctionsRev::getPostGetVariable("client_action");
$helper = new HelperUniteOperationsRev();
switch ($clientAction) {
case "export_slider":
$helper->exportSlider($this->sliderID);
break;
case "import_slider":
$helper->importSlider($this->sliderID);
//redirect
$urlSlider = HelperUniteRev::getViewUrl_Slider($this->sliderID);
$urlSlider .= "&m=is";
UniteFunctionsRev::redirectToUrl($urlSlider);
break;
}
}
示例2: previewOutputMarkup
public function previewOutputMarkup($sliderID, $output = null)
{
if ($sliderID == "empty_output") {
$this->loadingMessageOutput();
exit;
}
if ($output == null) {
$output = new RevSliderOutput();
}
$slider = new RevSlider();
$slider->initByID($sliderID);
$isWpmlExists = UniteWpmlRev::isWpmlExists();
$useWpml = $slider->getParam("use_wpml", "off");
$wpmlActive = false;
if ($isWpmlExists && $useWpml == "on") {
$wpmlActive = true;
$arrLanguages = UniteWpmlRev::getArrLanguages(false);
//set current lang to output
$currentLang = UniteFunctionsRev::getPostGetVariable("lang");
if (empty($currentLang)) {
$currentLang = UniteWpmlRev::getCurrentLang();
}
if (empty($currentLang)) {
$currentLang = $arrLanguages[0];
}
$output->setLang($currentLang);
$selectLangChoose = UniteFunctionsRev::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
}
$output->setPreviewMode();
//put the output html
$urlPlugin = "http://yourpluginpath/";
$urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&only_markup=true&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
$nonce = wp_create_nonce("revslider_actions");
$setBase = is_ssl() ? "https://" : "http://";
$f = new ThemePunch_Fonts();
$my_fonts = $f->get_all_fonts();
?>
<html>
<head>
<script type='text/javascript' src='<?php
echo $setBase;
?>
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
</head>
<body style="padding:0px;margin:0px;">
<?php
if ($wpmlActive == true) {
?>
<div style="margin-bottom:10px;text-align:center;">
<?php
_e("Choose language", REVSLIDER_TEXTDOMAIN);
?>
: <?php
echo $selectLangChoose;
?>
</div>
<script type="text/javascript">
var g_previewPattern = '<?php
echo $urlPreviewPattern;
?>
';
jQuery("#select_langs").change(function(){
var lang = this.value;
var nonce = "<?php
echo $nonce;
?>
";
var pattern = g_previewPattern;
var urlPreview = pattern.replace("[lang]",lang).replace("[nonce]",nonce);
location.href = urlPreview;
});
jQuery('body').on('click', '#rev_replace_images', function(){
var from = jQuery('input[name="orig_image_path"]').val();
var to = jQuery('input[name="replace_image_path"]').val();
jQuery('#rev_script_content').val(jQuery('#rev_script_content').val().replace(from, to));
jQuery('#rev_the_content').val(jQuery('#rev_the_content').val().replace(from, to));
jQuery('#rev_style_content').val(jQuery('#rev_style_content').val().replace(from, to));
jQuery('#rev_head_content').val(jQuery('#rev_head_content').val().replace(from, to));
});
</script>
<?php
}
?>
<?php
//UniteBaseClassRev::$url_plugin
ob_start();
?>
<link rel='stylesheet' href='<?php
echo $urlPlugin;
?>
css/settings.css?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
' type='text/css' media='all' />
<?php
$http = is_ssl() ? 'https' : 'http';
//.........这里部分代码省略.........
示例3: onAjaxAction
//.........这里部分代码省略.........
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_custom_anim":
$arrAnims = $operations->updateCustomAnim($data);
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "delete_custom_anim":
$arrAnims = $operations->deleteCustomAnim($data);
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_slides_order":
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
// case "preview_slider":
// $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
// $operations->previewOutput($sliderID);
// break;
// case "preview_slider":
// $sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
// $operations->previewOutput($sliderID);
// break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
sdsconfig::getgeneratecssfile();
self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$new_data = array();
// print_r($data);
foreach ($data as $key => $value) {
$new_data[$key] = $value;
}
$operations->updateGeneralSettings($new_data);
// sdsconfig::getgeneratecssfile();
self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
示例4: onAjaxAction
//.........这里部分代码省略.........
case "update_captions_css":
$arrCaptions = $operations->updateCaptionsContentData($data);
self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
break;
case "delete_captions_css":
$arrCaptions = $operations->deleteCaptionsContentData($data);
self::ajaxResponseSuccess(__ug("Style deleted succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
break;
case "update_static_css":
$staticCss = $operations->updateStaticCss($data);
self::ajaxResponseSuccess(__ug("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
break;
case "insert_custom_anim":
$arrAnims = $operations->insertCustomAnim($data);
//$arrCaptions =
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_custom_anim":
$arrAnims = $operations->updateCustomAnim($data);
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "delete_custom_anim":
$arrAnims = $operations->deleteCustomAnim($data);
self::ajaxResponseSuccess(__ug("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_slides_order":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__ug("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__ug("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
self::ajaxResponseSuccess(__ug("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__ug("General settings updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__ug("Sortby updated", REVSLIDER_TEXTDOMAIN));
break;
case "replace_image_urls":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDER_OPERATIONS);
$slider->replaceImageUrlsFromData($data);
self::ajaxResponseSuccess(__ug("Image urls replaced", REVSLIDER_TEXTDOMAIN));
break;
case "reset_slide_settings":
RevOperations::validatePermission(GlobalsRevSlider::PERMISSION_SLIDE_OPERATIONS);
$slider->resetSlideSettings($data);
self::ajaxResponseSuccess(__ug("Settings in all Slides changed", REVSLIDER_TEXTDOMAIN));
break;
default:
self::ajaxResponseError("wrong ajax action: {$action} ");
break;
}
} catch (Exception $e) {
$message = $e->getMessage();
if ($action == "preview_slide" || $action == "preview_slider") {
echo $message;
exit;
}
self::ajaxResponseError($message);
}
//it's an ajax action, so exit
self::ajaxResponseError("No response output on <b> {$action} </b> action. please check with the developer.");
exit;
}
示例5: onAjaxAction
//.........这里部分代码省略.........
case "update_static_css":
$staticCss = $operations->updateStaticCss($data);
self::ajaxResponseSuccess(__("CSS saved succesfully!", REVSLIDER_TEXTDOMAIN), array("css" => $staticCss));
break;
case "insert_custom_anim":
$arrAnims = $operations->insertCustomAnim($data);
//$arrCaptions =
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_custom_anim":
$arrAnims = $operations->updateCustomAnim($data);
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "delete_custom_anim":
$arrAnims = $operations->deleteCustomAnim($data);
self::ajaxResponseSuccess(__("Animation saved succesfully!", REVSLIDER_TEXTDOMAIN), $arrAnims);
//,array("arrCaptions"=>$arrCaptions)
break;
case "update_slides_order":
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$do_markup = UniteFunctionsRev::getPostGetVariable("only_markup");
if ($do_markup == 'true') {
$operations->previewOutputMarkup($sliderID);
} else {
$operations->previewOutput($sliderID);
}
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
self::ajaxResponseSuccess(__("All files successfully updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__("General settings updated", REVSLIDER_TEXTDOMAIN));
break;
case "update_posts_sortby":
$slider->updatePostsSortbyFromData($data);
self::ajaxResponseSuccess(__("Sortby updated", REVSLIDER_TEXTDOMAIN));
break;
case "replace_image_urls":
$slider->replaceImageUrlsFromData($data);
示例6: previewOutput
/**
*
* preview slider output
* if output object is null - create object
*/
public function previewOutput($sliderID, $output = null)
{
if ($sliderID == "empty_output") {
$this->loadingMessageOutput();
exit;
}
if ($output == null) {
$output = new RevSliderOutput();
}
$slider = new RevSlider();
$slider->initByID($sliderID);
$isWpmlExists = UniteWpmlRev::isWpmlExists();
$useWpml = $slider->getParam("use_wpml", "off");
$wpmlActive = false;
if ($isWpmlExists && $useWpml == "on") {
$wpmlActive = true;
$arrLanguages = UniteWpmlRev::getArrLanguages(false);
//set current lang to output
$currentLang = UniteFunctionsRev::getPostGetVariable("lang");
if (empty($currentLang)) {
$currentLang = UniteWpmlRev::getCurrentLang();
}
if (empty($currentLang)) {
$currentLang = $arrLanguages[0];
}
$output->setLang($currentLang);
$selectLangChoose = UniteFunctionsRev::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
}
$output->setPreviewMode();
//put the output html
$urlPlugin = RevSliderAdmin::$url_plugin . "rs-plugin/";
$urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
$nonce = wp_create_nonce("revslider_actions");
$setBase = is_ssl() ? "https://" : "http://";
?>
<html>
<head>
<link rel='stylesheet' href='<?php
echo $urlPlugin;
?>
css/settings.css?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
' type='text/css' media='all' />
<?php
//check if dynamic-captions.css exists. If not, include captions.php
//if(file_exists(UniteBaseClassRev::$path_plugin."rs-plugin/css/dynamic-captions.css") == false){
?>
<link rel='stylesheet' href='<?php
echo $urlPlugin;
?>
css/captions.php?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
' type='text/css' media='all' />
<?php
/*}else{
?>
<link rel='stylesheet' href='<?php echo $urlPlugin?>css/dynamic-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?>' type='text/css' media='all' />
<?php
}*/
$custom_css = RevOperations::getStaticCss();
echo '<style type="text/css">' . $custom_css . '</style>';
/*<!--link rel='stylesheet' href='<?php echo $urlPlugin?>css/static-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?>' type='text/css' media='all' /-->*/
?>
<script type='text/javascript' src='<?php
echo $setBase;
?>
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
<script type='text/javascript' src='<?php
echo $urlPlugin;
?>
js/jquery.themepunch.plugins.min.js?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
'></script>
<script type='text/javascript' src='<?php
echo $urlPlugin;
?>
js/jquery.themepunch.revolution.min.js?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
'></script>
</head>
<body style="padding:0px;margin:0px;">
<?php
if ($wpmlActive == true) {
?>
<div style="margin-bottom:10px;text-align:center;">
<?php
_e("Choose language", REVSLIDER_TEXTDOMAIN);
?>
: <?php
echo $selectLangChoose;
//.........这里部分代码省略.........
示例7: putRevCssCaptions
require_once JPATH_ADMINISTRATOR . "/components/com_uniterevolution2/inc_php/framework/include_framework.php";
require_once JPATH_ADMINISTRATOR . "/components/com_uniterevolution2/inc_php/revslider_globals.class.php";
//error_reporting(E_ALL); // debug
/**
*
* get revolution slider captions css
*/
function putRevCssCaptions()
{
$tableCss = "#__" . GlobalsRevSlider::TABLE_CSS_NAME;
$db = new UniteDBRev();
$arrStyles = $db->fetch($tableCss);
$cssStyles = UniteCssParserRev::parseDbArrayToCss($arrStyles, "\n");
header('Content-type: text/css');
echo $cssStyles;
exit;
}
$action = UniteFunctionsRev::getPostGetVariable("action");
if (empty($action)) {
echo "action not given";
exit;
}
switch ($action) {
case "getcaptions":
putRevCssCaptions();
break;
default:
echo "action not found: {$action}";
exit;
break;
}
示例8: onAjaxAction
//.........这里部分代码省略.........
self::ajaxResponseSuccessRedirect(__("The slider deleted", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
break;
case "duplicate_slider":
$slider->duplicateSliderFromData($data);
self::ajaxResponseSuccessRedirect(__("The duplicate successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDERS));
break;
case "add_slide":
$numSlides = $slider->createSlideFromData($data);
$sliderID = $data["sliderid"];
if ($numSlides == 1) {
$responseText = __("Slide Created", REVSLIDER_TEXTDOMAIN);
} else {
$responseText = $numSlides . " " . __("Slides Created", REVSLIDER_TEXTDOMAIN);
}
$urlRedirect = self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}");
self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
break;
case "add_slide_fromslideview":
$slideID = $slider->createSlideFromData($data, true);
$urlRedirect = self::getViewUrl(self::VIEW_SLIDE, "id={$slideID}");
$responseText = __("Slide Created, redirecting...", REVSLIDER_TEXTDOMAIN);
self::ajaxResponseSuccessRedirect($responseText, $urlRedirect);
break;
case "update_slide":
$slide->updateSlideFromData($data);
self::ajaxResponseSuccess(__("Slide updated", REVSLIDER_TEXTDOMAIN));
break;
case "delete_slide":
$slide->deleteSlideFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "sliderID");
self::ajaxResponseSuccessRedirect(__("Slide Deleted Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "duplicate_slide":
$sliderID = $slider->duplicateSlideFromData($data);
self::ajaxResponseSuccessRedirect(__("Slide Duplicated Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "copy_move_slide":
$sliderID = $slider->copyMoveSlideFromData($data);
self::ajaxResponseSuccessRedirect(__("The operation successfully, refreshing page...", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "get_captions_css":
$contentCSS = $operations->getCaptionsContent();
self::ajaxResponseData($contentCSS);
break;
case "update_captions_css":
$arrCaptions = $operations->updateCaptionsContentData($data);
self::ajaxResponseSuccess(__("CSS file saved succesfully!", REVSLIDER_TEXTDOMAIN), array("arrCaptions" => $arrCaptions));
break;
case "restore_captions_css":
$operations->restoreCaptionsCss();
$contentCSS = $operations->getCaptionsContent();
self::ajaxResponseData($contentCSS);
break;
case "update_slides_order":
$slider->updateSlidesOrderFromData($data);
self::ajaxResponseSuccess(__("Order updated successfully", REVSLIDER_TEXTDOMAIN));
break;
case "change_slide_image":
$slide->updateSlideImageFromData($data);
$sliderID = UniteFunctionsRev::getVal($data, "slider_id");
self::ajaxResponseSuccessRedirect(__("Slide Changed Successfully", REVSLIDER_TEXTDOMAIN), self::getViewUrl(self::VIEW_SLIDES, "id={$sliderID}"));
break;
case "preview_slide":
$operations->putSlidePreviewByData($data);
break;
case "preview_slider":
$sliderID = UniteFunctionsRev::getPostGetVariable("sliderid");
$operations->previewOutput($sliderID);
break;
case "toggle_slide_state":
$currentState = $slide->toggleSlideStatFromData($data);
self::ajaxResponseData(array("state" => $currentState));
break;
case "slide_lang_operation":
$responseData = $slide->doSlideLangOperation($data);
self::ajaxResponseData($responseData);
break;
case "update_plugin":
self::updatePlugin(self::DEFAULT_VIEW);
break;
case "update_text":
self::updateSettingsText();
self::ajaxResponseSuccess("All files successfully updated");
break;
case "update_general_settings":
$operations->updateGeneralSettings($data);
self::ajaxResponseSuccess(__("General settings updated"));
break;
default:
self::ajaxResponseError("wrong ajax action: {$action} ");
break;
}
} catch (Exception $e) {
$message = $e->getMessage();
self::ajaxResponseError($message);
}
//it's an ajax action, so exit
self::ajaxResponseError("No response output on <b> {$action} </b> action. please check with the developer.");
exit;
}
示例9: dirname
$user = JFactory::getUser();
// Access check.
if ($user->authorise('core.manage', "com_uniterevolution2") == false) {
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
$currentDir = dirname(__FILE__) . "/";
$currentFile = __FILE__;
$currentFolder = dirname($currentFile);
require_once $currentFolder . "/includes.php";
require_once $currentFolder . "/revslider_admin.php";
$action = UniteFunctionsRev::getPostGetVariable("action");
switch ($action) {
case "getcaptions":
RevOperations::putRevCssCaptions();
break;
}
//add tiny box dropdown menu
$tinybox = new RevSlider_TinyBox();
$productAdmin = new RevSliderAdmin($currentFile);
//set global title
$title = JText::_('COM_UNITEREVOLUTION2');
JToolBarHelper::title($title, 'generic.png');
//enable mootools on sliders view when the permissions option is
//enable toolbar options button on a sliders view.
$manager_permission = $user->authorise('core.admin', GlobalsRevSlider::PLUGIN_NAME);
$view = UniteFunctionsRev::getPostGetVariable("view");
if ((!$view || $view == "sliders") && $manager_permission) {
JToolBarHelper::preferences('com_uniterevolution2', 550, 875);
} else {
UniteFunctionJoomlaRev::disableMootools();
}
示例10: previewOutput
/**
*
* preview slider output
* if output object is null - create object
*/
public function previewOutput($sliderID, $output = null)
{
if ($sliderID == "empty_output") {
$this->loadingMessageOutput();
exit;
}
if ($output == null) {
$output = new RevSliderOutput();
}
$slider = new RevSlider();
$slider->initByID($sliderID);
$isWpmlExists = UniteWpmlRev::isWpmlExists();
$useWpml = $slider->getParam("use_wpml", "off");
$wpmlActive = false;
if ($isWpmlExists && $useWpml == "on") {
$wpmlActive = true;
$arrLanguages = UniteWpmlRev::getArrLanguages(false);
//set current lang to output
$currentLang = UniteFunctionsRev::getPostGetVariable("lang");
if (empty($currentLang)) {
$currentLang = UniteWpmlRev::getCurrentLang();
}
if (empty($currentLang)) {
$currentLang = $arrLanguages[0];
}
$output->setLang($currentLang);
$selectLangChoose = UniteFunctionsRev::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
}
$output->setPreviewMode();
//put the output html
$urlPlugin = RevSliderAdmin::$url_plugin . "rs-plugin/";
$urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&sliderid={$sliderID}&lang=[lang]";
?>
<html>
<head>
<link rel='stylesheet' href='<?php
echo $urlPlugin;
?>
css/settings.css' type='text/css' media='all' />
<link rel='stylesheet' href='<?php
echo $urlPlugin;
?>
css/captions.css' type='text/css' media='all' />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
<script type='text/javascript' src='<?php
echo $urlPlugin;
?>
js/jquery.themepunch.revolution.min.js'></script>
</head>
<body style="padding:0px;margin:0px;">
<?php
if ($wpmlActive == true) {
?>
<div style="margin-bottom:10px;text-align:center;">
<?php
_e("Choose language");
?>
: <?php
echo $selectLangChoose;
?>
</div>
<script type="text/javascript">
var g_previewPattern = '<?php
echo $urlPreviewPattern;
?>
';
jQuery("#select_langs").change(function(){
var lang = this.value;
var pattern = g_previewPattern;
var urlPreview = pattern.replace("[lang]",lang);
location.href = urlPreview;
});
</script>
<?php
}
?>
<?php
$output->putSliderBase($sliderID);
?>
</body>
</html>
<?php
exit;
}