本文整理汇总了PHP中UniteFunctionsRev类的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev类的具体用法?PHP UniteFunctionsRev怎么用?PHP UniteFunctionsRev使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UniteFunctionsRev类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getControlFields
/**
*
* get fields that relevant for the control
*/
public function getControlFields()
{
$arrControls = array();
//get base elements array
$arrBase = array();
$arrBase["parent"] = (string) UniteFunctionsRev::getVal($this->element, 'parent');
$arrBase["value"] = (string) UniteFunctionsRev::getVal($this->element, 'value');
$arrBase["ctype"] = (string) UniteFunctionsRev::getVal($this->element, 'ctype');
//validate fields:
if (empty($arrBase["parent"])) {
UniteFunctionsRev::throwError("The parent can't be empty in control");
}
if (empty($arrBase["value"])) {
UniteFunctionsRev::throwError("The value can't be empty in control: {$arrBase['parent']}");
}
if (empty($arrBase["ctype"])) {
UniteFunctionsRev::throwError("The ctype can't be empty in control: {$arrBase['parent']}");
}
//get children
$strchild = (string) UniteFunctionsRev::getVal($this->element, 'child');
//validate child
if (empty($strchild)) {
UniteFunctionsRev::throwError("The child can't be empty in control: {$arrBase['parent']}");
}
$strchild = trim($strchild);
$children = explode(",", $strchild);
foreach ($children as $child) {
$arrControl = $arrBase;
$arrControl["child"] = $child;
$arrControls[] = $arrControl;
}
return $arrControls;
}
示例2: rev_slider_shortcode
function rev_slider_shortcode($args)
{
$sliderAlias = UniteFunctionsRev::getVal($args, 0);
ob_start();
$slider = RevSliderOutput::putSlider($sliderAlias);
$content = ob_get_contents();
ob_clean();
ob_end_clean();
//handle slider output types
if (!empty($slider)) {
$outputType = $slider->getParam("output_type", "");
switch ($outputType) {
case "compress":
$content = str_replace("\n", "", $content);
$content = str_replace("\r", "", $content);
return $content;
break;
case "echo":
echo $content;
//bypass the filters
break;
default:
return $content;
break;
}
} else {
return $content;
}
//normal output
}
示例3: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal');
// Build the script.
$script = array();
$script[] = ' function onBulletsSelect(data){';
$script[] = ' alert("do something: " + data)';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$link = 'index.php?option=com_uniterevolution&view=slider&layout=bullets&tmpl=component';
$html[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . $this->value . '" />';
$bulletsText = "Change Bullets";
$buttonID = $this->id . "-btn";
$desc = UniteFunctionsRev::getVal($this->element, "description");
$htmlAddon = "";
if (!empty($desc)) {
$htmlAddon = ' title="' . $desc . '"';
//$class .= " hasTip"; //making problems with rel
}
// The user select button.
$html[] = ' <a id="' . $buttonID . '" class="modal panel_button" ' . $htmlAddon . ' href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 900, y: 450}}">' . $bulletsText . '</a>';
$html = implode("\n", $html);
return $html;
}
示例4: putJavascript
/**
*
* javascript output to footer
*/
public function putJavascript()
{
$urlPlugin = UniteBaseClassRev::$url_plugin . "rs-plugin/";
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$use_hammer = UniteFunctionsRev::getVal($arrValues, "use_hammer_js", 'on');
if ($use_hammer == 'off') {
?>
<script type='text/javascript' src='<?php
echo $urlPlugin;
?>
js/jquery.themepunch.disablehammer.js?rev=<?php
echo GlobalsRevSlider::SLIDER_REVISION;
?>
'></script>
<?php
}
?>
<script type='text/javascript' src='<?php
echo $urlPlugin;
?>
js/jquery.themepunch.tools.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>
<?php
}
示例5: yit_revslider_slider
function yit_revslider_slider()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");
$isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
return;
}
wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = (is_ssl()) ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
wp_enqueue_script("jquery", $url_jquery);
// put javascript to footer
add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
示例6: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal');
// Build the script.
$script = array();
$script[] = ' function onArrowsSelect(data){';
$script[] = ' UniteAdminRev.onArrowsChange(data);';
$script[] = ' SqueezeBox.close();';
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
$link = 'index.php?option=' . GlobalsUniteRev::COMPONENT_NAME . '&view=slider&layout=arrows&tmpl=component&settingid=' . $this->id;
$buttonType = $this->value;
$arrArrowSet = HelperUniteRev::getArrowSet($buttonType);
$arrowName = $arrArrowSet["name"];
$html[] = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . $this->value . '" />';
$buttonID = $this->id . "-btn";
$desc = UniteFunctionsRev::getVal($this->element, "description");
// The the arrow
$imageArrow = $arrArrowSet["url_right"];
$html[] = '<span class="chooser-image-wrapper"><img id="' . $this->id . '-img" title="' . $arrowName . '" src="' . $imageArrow . '"></span>';
//put select button
$html[] = ' <a id="' . $buttonID . '" class="modal button-secondary button-chooser" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 900, y: 450}}">Change</a>';
$html = implode("\n", $html);
return $html;
}
示例7: getSliderID
/**
*
* get slider id
*/
public function getSliderID()
{
$sliderID = JRequest::getCmd("id");
if (empty($sliderID)) {
UniteFunctionsRev::throwError("Slider ID url argument not found (id)");
}
return $sliderID;
}
示例8: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!.
*
*/
public static function onAddScripts()
{
global $wp_version;
$style_pre = '';
$style_post = '';
if ($wp_version < 3.7) {
$style_pre = '<style type="text/css">';
$style_post = '</style>';
}
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
$includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
$strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
/*
*/
/*
$styles = $db->fetch(GlobalsRevSlider::$table_css);
$styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
$styles = UniteCssParserRev::compress_css($styles);
wp_add_inline_style( 'rs-plugin-settings', $style_pre.$styles.$style_post );
// KRISZTIAN MODIFICATION FOR INNERLAYERS
$stylesinnerlayers = str_replace('.tp-caption', '',$styles);´
wp_add_inline_style( 'rs-plugin-settings', $style_pre.$stylesinnerlayers.$style_post );
// END MODIFICATION
*/
$setBase = is_ssl() ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
self::addScriptAbsoluteUrl($url_jquery, "jquery");
if ($includesFooter == "off") {
$waitfor = array('jquery');
$enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
if ($enable_logs == 'on') {
self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
$waitfor[] = 'enable-logs';
}
self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
} else {
//put javascript to footer
UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
}
}
示例9: rev_slider_shortcode
function rev_slider_shortcode($args)
{
$sliderAlias = UniteFunctionsRev::getVal($args, 0);
ob_start();
RevSliderOutput::putSlider($sliderAlias);
$content = ob_get_contents();
ob_clean();
return $content;
}
示例10: delete
/**
*
* delete rows
*/
public function delete($table, $where)
{
global $wpdb;
UniteFunctionsRev::validateNotEmpty($table, "table name");
UniteFunctionsRev::validateNotEmpty($where, "where");
$query = "delete from {$table} where {$where}";
$wpdb->query($query);
$this->checkForErrors("Delete query error");
}
示例11: update
public function update($table, $arrItems, $where)
{
$response = $this->wpdb->update($table, $arrItems, $where);
if ($response === false) {
UniteFunctionsRev::throwError("no update action taken!");
}
$this->checkForErrors("Update query error");
return $response;
}
示例12: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$revSliderAdmin = Mage::getSingleton('RevSliderAdmin');
$revSliderAdmin->requireSettings("slider_settings");
$settingsMain = $revSliderAdmin->getSettings("slider_main");
$settingsParams = $revSliderAdmin->getSettings("slider_params");
$settingsSliderMain = new RevSliderSettingsProduct();
$settingsSliderParams = new UniteSettingsProductSidebarRev();
//get taxonomies with cats
$postTypesWithCats = RevOperations::getPostTypesWithCatsForClient();
$jsonTaxWithCats = UniteFunctionsRev::jsonEncodeForClientSide($postTypesWithCats);
//check existing slider data:
$sliderID = $this->getRequest()->getParam('id');
if (!empty($sliderID)) {
$slider = new RevSlider();
$slider->initByID($sliderID);
//get setting fields
$settingsFields = $slider->getSettingsFields();
$arrFieldsMain = $settingsFields["main"];
$arrFieldsParams = $settingsFields["params"];
//modify arrows type for backword compatability
$arrowsType = UniteFunctionsRev::getVal($arrFieldsParams, "navigation_arrows");
switch ($arrowsType) {
case "verticalcentered":
$arrFieldsParams["navigation_arrows"] = "solo";
break;
}
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, $arrFieldsParams, $postTypesWithCats);
//set setting values from the slider
$settingsMain->setStoredValues($arrFieldsParams);
$settingsParams->setStoredValues($arrFieldsParams);
//update short code setting
$shortcode = $slider->getShortcode();
$settingsMain->updateSettingValue("shortcode", htmlentities($shortcode));
$linksEditSlides = $this->helper("adminhtml")->getUrl('adminhtml/nwdrevslider/slides/id/' . $sliderID);
$settingsSliderParams->init($settingsParams);
$settingsSliderMain->init($settingsMain);
$settingsSliderParams->isAccordion(true);
$this->assign('sliderID', $sliderID);
$this->assign('linksEditSlides', $linksEditSlides);
$this->assign('arrFieldsParams', $arrFieldsParams);
$this->setTemplate('nwdthemes/revslider/templates/slider_edit.phtml');
} else {
//set custom type params values:
$settingsMain = RevSliderSettingsProduct::setSettingsCustomValues($settingsMain, array(), $postTypesWithCats);
$settingsSliderParams->init($settingsParams);
$settingsSliderMain->init($settingsMain);
$settingsSliderParams->isAccordion(true);
$this->setTemplate('nwdthemes/revslider/templates/slider_new.phtml');
}
$this->assign('sliderTemplate', $this->_sliderTemplate);
$this->assign('settingsSliderMain', $settingsSliderMain);
$this->assign('settingsSliderParams', $settingsSliderParams);
$this->assign('jsonTaxWithCats', $jsonTaxWithCats);
}
示例13: checkCopyCaptionsCssFile
/**
*
* check that captions file exists and if not - copy it to it's place.
*/
private function checkCopyCaptionsCssFile()
{
if (file_exists(GlobalsUniteRev::$pathCaptionsCss) == false) {
copy(GlobalsUniteRev::$pathCaptionsCssOriginal, GlobalsUniteRev::$pathCaptionsCss);
}
if (file_exists(GlobalsUniteRev::$pathCaptionsCss) == false) {
UniteFunctionsRev::throwError("The captions file couldn't be copied to it's place: {GlobalsUniteRev::{$pathCaptionsCss}}, please copy it by hand from captions-original.css from the same folder, or turn to support.");
}
}
示例14: getFieldFromDB
/**
*
* get field from db
*/
public function getFieldFromDB($name)
{
$arr = $this->db->fetch(GlobalsRevSlider::$table_settings);
if (empty($arr)) {
return "";
}
$arr = $arr[0];
if (array_key_exists($name, $arr) == false) {
UniteFunctionsRev::throwError("The settings db should cotnain field: {$name}");
}
$value = $arr[$name];
return $value;
}
示例15: isDBTableExists
/**
*
* check if some db table exists
*/
public static function isDBTableExists($tableName)
{
global $wpdb;
if (empty($tableName)) {
UniteFunctionsRev::throwError("Empty table name!!!");
}
$sql = "show tables like '{$tableName}'";
$table = $wpdb->get_var($sql);
if ($table == $tableName) {
return true;
}
return false;
}