first commit
@@ -0,0 +1,803 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
class UniteCreatorAcfIntegrate{
|
||||
|
||||
const TYPE_SIMPLE_ARRAY = "simple_array";
|
||||
const TYPE_POST = "post";
|
||||
const TYPE_POSTS_LIST = "posts_list";
|
||||
const TYPE_URL = "url";
|
||||
const TYPE_USER = "user";
|
||||
const TYPE_REPEATER = "repeater";
|
||||
const TYPE_GALLERY = "gallery";
|
||||
const PREFIX = "cf_";
|
||||
|
||||
const SHOW_DEBUG_FIELDS = false;
|
||||
const DEBUG_UNKNOWN_TYPE = false;
|
||||
|
||||
private $outputImageSize = null;
|
||||
|
||||
|
||||
/**
|
||||
* return if acf plugin activated
|
||||
*/
|
||||
public static function isAcfActive(){
|
||||
|
||||
if(class_exists('ACF'))
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* get image title
|
||||
*/
|
||||
private function getImageFieldTitle($field){
|
||||
|
||||
$title = UniteFunctionsUC::getVal($field, "title");
|
||||
$filename = UniteFunctionsUC::getVal($field, "filename");
|
||||
|
||||
if(empty($title))
|
||||
$title = $filename;
|
||||
|
||||
|
||||
$info = pathinfo($title);
|
||||
$name = UniteFunctionsUC::getVal($info, "filename");
|
||||
|
||||
if(!empty($name))
|
||||
$title = $name;
|
||||
|
||||
return($title);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get image field data
|
||||
*/
|
||||
private function getImageFieldData($field, $key=null){
|
||||
|
||||
|
||||
//set the output image size
|
||||
|
||||
$outputImageSize = null;
|
||||
|
||||
if(!empty($this->outputImageSize))
|
||||
$outputImageSize = $this->outputImageSize;
|
||||
|
||||
|
||||
$imageID = UniteFunctionsUC::getVal($field, "id");
|
||||
|
||||
|
||||
$title = $this->getImageFieldTitle($field);
|
||||
|
||||
$caption = UniteFunctionsUC::getVal($field, "caption");
|
||||
if(!empty($caption))
|
||||
$title = $caption;
|
||||
|
||||
$description = UniteFunctionsUC::getVal($field, "description");
|
||||
$alt = UniteFunctionsUC::getVal($field, "alt");
|
||||
|
||||
if(empty($alt))
|
||||
$alt = $title;
|
||||
|
||||
$urlImage = UniteFunctionsUC::getVal($field, "url");
|
||||
$arrSizes = UniteFunctionsUC::getVal($field, "sizes");
|
||||
|
||||
$width = UniteFunctionsUC::getVal($field, "width");
|
||||
$height = UniteFunctionsUC::getVal($field, "height");
|
||||
|
||||
if(!empty($outputImageSize)){
|
||||
|
||||
$urlImageSize = UniteFunctionsUC::getVal($arrSizes, $outputImageSize);
|
||||
|
||||
if(!empty($urlImageSize)){
|
||||
|
||||
$urlImage = $urlImageSize;
|
||||
$width = UniteFunctionsUC::getVal($arrSizes, $outputImageSize."-width");
|
||||
$height = UniteFunctionsUC::getVal($arrSizes, $outputImageSize."-height");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$arrValues = array();
|
||||
|
||||
$keyprefix = "";
|
||||
if(!empty($key))
|
||||
$keyprefix = $key."_";
|
||||
|
||||
if(!empty($key)){
|
||||
$arrValues[$key] = $urlImage;
|
||||
$arrValues[$keyprefix."width"] = $width;
|
||||
$arrValues[$keyprefix."height"] = $height;
|
||||
}
|
||||
else{
|
||||
$arrValues["image"] = $urlImage;
|
||||
$arrValues["image_width"] = $width;
|
||||
$arrValues["image_height"] = $height;
|
||||
}
|
||||
|
||||
$thumbMedium = UniteFunctionsUC::getVal($arrSizes, "medium");
|
||||
$arrValues[$keyprefix."thumb"] = $thumbMedium;
|
||||
|
||||
$thumbMediumWidth = UniteFunctionsUC::getVal($arrSizes, "medium-width");
|
||||
$thumbMediumHeight = UniteFunctionsUC::getVal($arrSizes, "medium-width");
|
||||
|
||||
$arrValues[$keyprefix."thumb_width"] = $thumbMediumWidth;
|
||||
$arrValues[$keyprefix."thumb_height"] = $thumbMediumHeight;
|
||||
|
||||
if(empty($arrSizes))
|
||||
$arrSizes = array();
|
||||
|
||||
foreach($arrSizes as $size => $value){
|
||||
|
||||
if( $size == "medium")
|
||||
continue;
|
||||
|
||||
if(is_numeric($value))
|
||||
continue;
|
||||
|
||||
$thumbName = $keyprefix."thumb_".$size;
|
||||
$thumbName = str_replace("-", "_", $thumbName);
|
||||
|
||||
$thumbWidth = UniteFunctionsUC::getVal($arrSizes, $size."-width");
|
||||
$thumbHeight = UniteFunctionsUC::getVal($arrSizes, $size."-height");
|
||||
|
||||
$arrValues[$thumbName] = $value;
|
||||
$arrValues[$thumbName."_width"] = $width;
|
||||
$arrValues[$thumbName."_height"] = $height;
|
||||
}
|
||||
|
||||
|
||||
//set attributes
|
||||
|
||||
$attributes = "";
|
||||
|
||||
$attributes .= " src=\"{$urlImage}\"";
|
||||
|
||||
if(!empty($alt)){
|
||||
|
||||
$alt = esc_attr($alt);
|
||||
$attributes .= " alt=\"{$alt}\"";
|
||||
}
|
||||
|
||||
$data[$keyprefix."_attributes_nosize"] = $attributes;
|
||||
|
||||
if(!empty($width)){
|
||||
$attributes .= " width=\"$width\"";
|
||||
$attributes .= " height=\"$height\"";
|
||||
}
|
||||
|
||||
|
||||
//set other data
|
||||
|
||||
$arrValues[$keyprefix."attributes"] = $attributes;
|
||||
$arrValues[$keyprefix."title"] = $title;
|
||||
$arrValues[$keyprefix."description"] = $description;
|
||||
$arrValues[$keyprefix."alt"] = $alt;
|
||||
$arrValues[$keyprefix."imageid"] = $imageID;
|
||||
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* get post data
|
||||
*/
|
||||
private function getPostData($objPost, $key, $addID = false){
|
||||
|
||||
$arrPost = (array)$objPost;
|
||||
|
||||
$postID = UniteFunctionsUC::getVal($arrPost, "ID");
|
||||
|
||||
$arrValues = array();
|
||||
|
||||
if($addID == true)
|
||||
$arrValues[$key."_id"] = $postID;
|
||||
else
|
||||
$arrValues[$key] = $postID;
|
||||
|
||||
$arrValues[$key."_title"] = UniteFunctionsUC::getVal($arrPost, "post_title");
|
||||
$arrValues[$key."_alias"] = UniteFunctionsUC::getVal($arrPost, "post_name");
|
||||
$arrValues[$key."_content"] = UniteFunctionsUC::getVal($arrPost, "post_content");
|
||||
$arrValues[$key."_link"] = UniteFunctionsWPUC::getPermalink($objPost);
|
||||
$arrValues["put_post_add_data"] = true;
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get file field data
|
||||
*/
|
||||
private function getFileFieldData($data, $key){
|
||||
|
||||
$title = UniteFunctionsUC::getVal($data, "title");
|
||||
$filename = UniteFunctionsUC::getVal($data, "filename");
|
||||
|
||||
if(empty($title))
|
||||
$title = $filename;
|
||||
|
||||
$url = UniteFunctionsUC::getVal($data, "url");
|
||||
$filesize = UniteFunctionsUC::getVal($data, "filesize");
|
||||
$filesize = size_format($filesize, 2);
|
||||
$filesize = str_replace(" ", "", $filesize);
|
||||
|
||||
$arrValues = array();
|
||||
$arrValues[$key] = $url;
|
||||
$arrValues[$key."_title"] = $title;
|
||||
$arrValues[$key."_filename"] = $filename;
|
||||
$arrValues[$key."_size"] = $filesize;
|
||||
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* get posts list data
|
||||
*/
|
||||
private function getPostsListData($data){
|
||||
|
||||
if(empty($data))
|
||||
return($data);
|
||||
|
||||
$arrOutput = array();
|
||||
foreach($data as $post){
|
||||
|
||||
$arrPost = $this->getPostData($post, "post", true);
|
||||
|
||||
$arrOutput[] = $arrPost;
|
||||
}
|
||||
|
||||
return($arrOutput);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get data type of acf values
|
||||
*/
|
||||
private function getDataType($data, $key){
|
||||
|
||||
$type = null;
|
||||
|
||||
//image and application types
|
||||
|
||||
if(is_array($data)){
|
||||
$type = UniteFunctionsUC::getVal($data, "type");
|
||||
|
||||
if(!empty($type))
|
||||
return($type);
|
||||
|
||||
if(isset($data[0])){
|
||||
|
||||
$item = $data[0];
|
||||
|
||||
$itemType = gettype($item);
|
||||
|
||||
|
||||
if($item instanceof WP_Post)
|
||||
return(self::TYPE_POSTS_LIST);
|
||||
|
||||
if($itemType == "array"){
|
||||
|
||||
$itemType = UniteFunctionsUC::getVal($item, "type");
|
||||
|
||||
if($itemType == "image" && isset($item["sizes"]))
|
||||
return(self::TYPE_GALLERY);
|
||||
|
||||
return(self::TYPE_REPEATER);
|
||||
}
|
||||
|
||||
if($itemType != "object")
|
||||
return(self::TYPE_SIMPLE_ARRAY);
|
||||
|
||||
};
|
||||
|
||||
|
||||
//check for url
|
||||
if(isset($data["url"]))
|
||||
return(self::TYPE_URL);
|
||||
|
||||
if(isset($data["user_firstname"]) && isset($data["user_lastname"]))
|
||||
return(self::TYPE_USER);
|
||||
|
||||
if(self::DEBUG_UNKNOWN_TYPE == true){
|
||||
dmp("unknown type");
|
||||
dmp($data);
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//post
|
||||
if(is_object($data)){
|
||||
|
||||
if($data instanceof WP_Post)
|
||||
return(self::TYPE_POST);
|
||||
}
|
||||
|
||||
if(is_string($data) || is_numeric($data) || is_bool($data))
|
||||
return("simple");
|
||||
|
||||
return(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* get user field data
|
||||
*/
|
||||
private function getUserData($arrUser, $key){
|
||||
|
||||
$arrValues = array();
|
||||
$arrValues[$key."_firstname"] = UniteFunctionsUC::getVal($arrUser, "user_firstname");
|
||||
$arrValues[$key."_lastname"] = UniteFunctionsUC::getVal($arrUser, "user_lastname");
|
||||
$arrValues[$key."_displayname"] = UniteFunctionsUC::getVal($arrUser, "display_name");
|
||||
$arrValues[$key."_email"] = UniteFunctionsUC::getVal($arrUser, "user_email");
|
||||
$arrValues[$key."_avatar"] = UniteFunctionsUC::getVal($arrUser, "user_avatar");
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* get repeater field
|
||||
*/
|
||||
private function getRepeaterField($arrData){
|
||||
|
||||
if(empty($arrData))
|
||||
return($arrData);
|
||||
|
||||
foreach($arrData as $index => $arrItem){
|
||||
|
||||
//prepare new item
|
||||
$arrItemNew = array();
|
||||
$arrItemNew["item_index"] = $index+1;
|
||||
|
||||
foreach($arrItem as $key => $value){
|
||||
$arrItemNew = self::addAcfValues($arrItemNew, $key, $value);
|
||||
}
|
||||
|
||||
$arrData[$index] = $arrItemNew;
|
||||
}
|
||||
|
||||
return($arrData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get gallery field
|
||||
*/
|
||||
private function getGalleryField($data){
|
||||
|
||||
if(empty($data))
|
||||
return(array());
|
||||
|
||||
$arrItems = array();
|
||||
foreach($data as $index => $item){
|
||||
|
||||
$itemData = $this->getImageFieldData($item);
|
||||
$itemData["item_index"] = $index+1;
|
||||
|
||||
$arrItems[] = $itemData;
|
||||
}
|
||||
|
||||
|
||||
return($arrItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* get link field attributes from data
|
||||
*/
|
||||
private function getLinkAttributes($data){
|
||||
|
||||
$title = UniteFunctionsUC::getVal($data, "title");
|
||||
$target = UniteFunctionsUC::getVal($data, "target");
|
||||
|
||||
$title = htmlspecialchars($title);
|
||||
|
||||
$strAttr = "";
|
||||
|
||||
if(!empty($title))
|
||||
$strAttr = "title=\"$title\"";
|
||||
|
||||
if(!empty($target))
|
||||
$strAttr .= " target=\"$target\"";
|
||||
|
||||
return($strAttr);
|
||||
}
|
||||
|
||||
/**
|
||||
* get acf type
|
||||
*/
|
||||
private function addAcfValues($arrValues, $key, $data){
|
||||
|
||||
if(empty($data)){
|
||||
$arrValues[$key] = $data;
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
if(is_string($data) == true){
|
||||
$arrValues[$key] = $data;
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
$type = $this->getDataType($data, $key);
|
||||
|
||||
switch($type){
|
||||
case "simple": //simple type like string or boolean
|
||||
|
||||
$arrValues[$key] = $data;
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case "image":
|
||||
|
||||
$imageData = $this->getImageFieldData($data, $key);
|
||||
|
||||
$arrValues = array_merge($arrValues, $imageData);
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case "application":
|
||||
|
||||
$fileData = $this->getFileFieldData($data, $key);
|
||||
$arrValues = array_merge($arrValues, $fileData);
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case self::TYPE_POST:
|
||||
|
||||
$postData = $this->getPostData($data, $key);
|
||||
$arrValues = array_merge($arrValues, $postData);
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case self::TYPE_SIMPLE_ARRAY:
|
||||
$strData = implode(", ", $data);
|
||||
|
||||
$arrValues[$key] = $strData;
|
||||
$arrValues[$key."_array"] = $data;
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case self::TYPE_URL:
|
||||
$arrValues[$key] = $data["url"];
|
||||
|
||||
$linkAttributes = $this->getLinkAttributes($data);
|
||||
$arrValues[$key."_attributes"] = $linkAttributes;
|
||||
|
||||
$arrValues[$key."_array"] = $data;
|
||||
|
||||
return($arrValues);
|
||||
break;
|
||||
case self::TYPE_POSTS_LIST:
|
||||
|
||||
$arrValues[$key] = $this->getPostsListData($data);
|
||||
|
||||
break;
|
||||
case self::TYPE_USER:
|
||||
$userData = $this->getUserData($data, $key);
|
||||
$arrValues = array_merge($arrValues, $userData);
|
||||
|
||||
break;
|
||||
case self::TYPE_REPEATER:
|
||||
|
||||
$arrValues[$key] = $this->getRepeaterField($data);
|
||||
|
||||
break;
|
||||
case self::TYPE_GALLERY:
|
||||
|
||||
$arrValues[$key] = $this->getGalleryField($data);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
if(is_array($data))
|
||||
$arrValues[$key] = $data;
|
||||
else
|
||||
$arrValues[$key] = ""; //another object
|
||||
|
||||
//dmp("assoc");dmp($data); exit();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return($arrValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* get fields objects
|
||||
*/
|
||||
private function getFieldsObjects($postID, $objName, $addPrefix = true){
|
||||
|
||||
switch($objName){
|
||||
case "post":
|
||||
$arrObjects = get_field_objects($postID);
|
||||
|
||||
break;
|
||||
default:
|
||||
UniteFunctionsUC::throwError("get acf fields objects function works only for post right now");
|
||||
break;
|
||||
}
|
||||
|
||||
if($addPrefix == false)
|
||||
return($arrObjects);
|
||||
|
||||
if(empty($arrObjects))
|
||||
return(array());
|
||||
|
||||
if(is_array($arrObjects) == false)
|
||||
return(array());
|
||||
|
||||
|
||||
//add prefixes
|
||||
$arrOutput = array();
|
||||
foreach($arrObjects as $key => $arrObject){
|
||||
|
||||
$key = self::PREFIX.$key;
|
||||
$arrOutput[$key] = $arrObject;
|
||||
}
|
||||
|
||||
return($arrOutput);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get fields type assoc array
|
||||
*/
|
||||
private function getFieldsTypes($postID, $objName, $addPrefix = true){
|
||||
|
||||
$arrObjects = $this->getFieldsObjects($postID, $objName, $addPrefix);
|
||||
|
||||
$arrTypes = array();
|
||||
foreach($arrObjects as $key => $arrObject){
|
||||
|
||||
$type = UniteFunctionsUC::getVal($arrObject, "type");
|
||||
|
||||
$arrTypes[$key] = $type;
|
||||
}
|
||||
|
||||
return($arrTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* modify get fields data, consolidate all clones
|
||||
* clone is array inside array
|
||||
*/
|
||||
public function modifyFieldsData($arrData){
|
||||
|
||||
if(empty($arrData))
|
||||
return($arrData);
|
||||
|
||||
$arrOutput = array();
|
||||
|
||||
foreach($arrData as $key => $item){
|
||||
|
||||
//simple value
|
||||
if(is_array($item) == false){
|
||||
|
||||
$arrOutput[$key] = $item;
|
||||
continue;
|
||||
}
|
||||
|
||||
//numeric array
|
||||
if(isset($item[0])){
|
||||
$arrOutput[$key] = $item;
|
||||
continue;
|
||||
}
|
||||
|
||||
$isAssocArray = UniteFunctionsUC::isAssocArray($item);
|
||||
|
||||
$firstItem = UniteFunctionsUC::getArrFirstValue($item);
|
||||
|
||||
if(is_array($firstItem) == false && $isAssocArray == false){
|
||||
$arrOutput[$key] = $item;
|
||||
continue;
|
||||
}
|
||||
|
||||
//what's rest is assoc array, wich is clone or group:)
|
||||
|
||||
//add them to output
|
||||
foreach($item as $itemKey => $subItem){
|
||||
|
||||
$newKey = $key."_".$itemKey;
|
||||
$arrOutput[$newKey] = $subItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return($arrOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
* get single acf field
|
||||
*/
|
||||
public function getAcfFieldValue($fieldName, $objID, $objName = "post"){
|
||||
|
||||
switch($objName){
|
||||
case "post":
|
||||
|
||||
$value = get_field($fieldName, $objID);
|
||||
|
||||
break;
|
||||
case "term":
|
||||
|
||||
$termID = "term_".$objID;
|
||||
|
||||
$value = get_field($fieldName, $objID);
|
||||
|
||||
break;
|
||||
default:
|
||||
UniteFunctionsUC::throwError("get acf fields function works only for post and term right now");
|
||||
break;
|
||||
}
|
||||
|
||||
$arrDataOutput = array();
|
||||
$arrDataOutput = $this->addAcfValues($arrDataOutput, $fieldName, $value);
|
||||
|
||||
$value = UniteFunctionsUC::getVal($arrDataOutput, $fieldName);
|
||||
|
||||
|
||||
return($value);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get fields data
|
||||
*/
|
||||
private function getAcfFieldsData($postID, $objName = "post"){
|
||||
|
||||
switch($objName){
|
||||
case "post":
|
||||
|
||||
$arrData = get_fields($postID);
|
||||
|
||||
$arrData = $this->modifyFieldsData($arrData);
|
||||
|
||||
break;
|
||||
case "term":
|
||||
|
||||
$termID = "term_".$postID;
|
||||
|
||||
$arrData = get_fields($termID);
|
||||
|
||||
break;
|
||||
case "user":
|
||||
|
||||
$userID = "user_".$postID;
|
||||
|
||||
$arrData = get_fields($userID);
|
||||
|
||||
break;
|
||||
default:
|
||||
UniteFunctionsUC::throwError("get acf fields function works only for post and term and users right now");
|
||||
break;
|
||||
}
|
||||
|
||||
if(self::SHOW_DEBUG_FIELDS == true){
|
||||
dmp($arrData);
|
||||
exit();
|
||||
}
|
||||
|
||||
if(empty($arrData))
|
||||
$arrData = array();
|
||||
|
||||
return($arrData);
|
||||
}
|
||||
|
||||
/**
|
||||
* get only image id's from data
|
||||
*/
|
||||
public function getAcfFieldsImageIDs($postID, $objName = "post"){
|
||||
|
||||
$arrData = $this->getAcfFieldsData($postID, $objName);
|
||||
|
||||
$arrImageiDs = array();
|
||||
|
||||
foreach($arrData as $name=>$item){
|
||||
$type = UniteFunctionsUC::getVal($item, "type");
|
||||
|
||||
if($type != "image")
|
||||
continue;
|
||||
|
||||
$imageID = UniteFunctionsUC::getVal($item, "id");
|
||||
|
||||
if(empty($imageID))
|
||||
continue;
|
||||
|
||||
$arrImageiDs[$name] = $imageID;
|
||||
}
|
||||
|
||||
|
||||
return($arrImageiDs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get acf post fields
|
||||
*/
|
||||
public function getAcfFields($postID, $objName = "post", $addPrefix = true, $imageSize = null){
|
||||
|
||||
$isActive = self::isAcfActive();
|
||||
|
||||
if($isActive == false)
|
||||
return(array());
|
||||
|
||||
if(!empty($imageSize))
|
||||
$this->outputImageSize = $imageSize;
|
||||
|
||||
$arrData = $this->getAcfFieldsData($postID, $objName);
|
||||
|
||||
$arrDataOutput = array();
|
||||
foreach($arrData as $key => $value){
|
||||
|
||||
if($addPrefix == true)
|
||||
$key = self::PREFIX.$key;
|
||||
|
||||
$arrDataOutput = $this->addAcfValues($arrDataOutput, $key, $value);
|
||||
}
|
||||
|
||||
//clear image size
|
||||
|
||||
$this->outputImageSize = null;
|
||||
|
||||
return($arrDataOutput);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* get keys of acf fields
|
||||
*/
|
||||
public function getAcfFieldsKeys($postID, $objName = "post", $addPrefix = true){
|
||||
|
||||
$arrFields = $this->getAcfFields($postID, $objName, $addPrefix);
|
||||
$arrTypes = $this->getFieldsTypes($postID, $objName, $addPrefix);
|
||||
|
||||
$arrOutput = array();
|
||||
foreach($arrFields as $key=>$value){
|
||||
|
||||
$fieldType = UniteFunctionsUC::getVal($arrTypes, $key);
|
||||
|
||||
if(($fieldType == "repeater") && empty($value)){
|
||||
$arrOutput[$key] = "empty_repeater";
|
||||
continue;
|
||||
}
|
||||
|
||||
$type = "simple";
|
||||
if(is_array($value)){
|
||||
|
||||
$item = UniteFunctionsUC::getArrFirstValue($value);
|
||||
|
||||
if(is_string($item))
|
||||
$type = "array"; //check if simple array or complext array (repeater)
|
||||
else{
|
||||
$type = $item;
|
||||
}
|
||||
}
|
||||
|
||||
$arrOutput[$key] = $type;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
UniteFunctionsUC::showTrace();
|
||||
dmp($arrOutput);
|
||||
exit();
|
||||
*/
|
||||
return($arrOutput);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeBannerBuilder extends UCAdminNoticeBuilderAbstract{
|
||||
|
||||
const THEME_DARK = 'dark';
|
||||
const THEME_LIGHT = 'light';
|
||||
|
||||
private $theme = self::THEME_LIGHT;
|
||||
private $linkUrl;
|
||||
private $linkTarget;
|
||||
private $imageUrl;
|
||||
|
||||
/**
|
||||
* set the notice theme
|
||||
*/
|
||||
public function theme($theme){
|
||||
|
||||
$this->theme = $theme;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice link URL
|
||||
*/
|
||||
public function link($url, $target = ''){
|
||||
|
||||
$this->linkUrl = $url;
|
||||
$this->linkTarget = $target;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice image URL
|
||||
*/
|
||||
public function image($url){
|
||||
|
||||
$this->imageUrl = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function build(){
|
||||
|
||||
$class = implode(' ', array(
|
||||
'notice',
|
||||
'uc-admin-notice',
|
||||
'uc-admin-notice--banner',
|
||||
'uc-admin-notice--theme-' . $this->theme,
|
||||
'uc-admin-notice--' . $this->getId(),
|
||||
));
|
||||
|
||||
$html = '<div class="' . esc_attr($class) . '">';
|
||||
$html .= '<a class="uc-notice-link" href="' . esc_url($this->linkUrl) . '" target="' . esc_attr($this->linkTarget) . '" >';
|
||||
$html .= $this->getImageHtml();
|
||||
$html .= '</a>';
|
||||
$html .= $this->getDebugHtml();
|
||||
$html .= $this->getDismissHtml();
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the image html
|
||||
*/
|
||||
private function getImageHtml(){
|
||||
|
||||
if(empty($this->imageUrl))
|
||||
return '';
|
||||
|
||||
return '<img class="uc-notice-image" src="' . esc_attr($this->imageUrl) . '" alt="" />';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeBuilder extends UCAdminNoticeBuilderAbstract{
|
||||
|
||||
const COLOR_INFO = 'info';
|
||||
const COLOR_WARNING = 'warning';
|
||||
const COLOR_ERROR = 'error';
|
||||
const COLOR_DOUBLY = 'doubly';
|
||||
|
||||
const ACTION_VARIANT_PRIMARY = 'primary';
|
||||
const ACTION_VARIANT_SECONDARY = 'secondary';
|
||||
|
||||
private $color = self::COLOR_INFO;
|
||||
private $heading;
|
||||
private $content;
|
||||
private $actions = array();
|
||||
|
||||
/**
|
||||
* set the notice color
|
||||
*/
|
||||
public function color($color){
|
||||
|
||||
$this->color = $color;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice heading
|
||||
*/
|
||||
public function withHeading($heading){
|
||||
|
||||
$this->heading = $heading;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice content
|
||||
*/
|
||||
public function withContent($content){
|
||||
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* add the notice action
|
||||
*/
|
||||
public function addAction($action){
|
||||
|
||||
$this->actions[] = $action;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* add the link action
|
||||
*/
|
||||
public function withLinkAction($text, $url, $variant = self::ACTION_VARIANT_PRIMARY, $target = ''){
|
||||
|
||||
$action = '<a class="button button-' . $variant . '" href="' . esc_url($url) . '" target="' . esc_attr($target) . '">' . $text . '</a>';
|
||||
|
||||
return $this->addAction($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* add the dismiss action
|
||||
*/
|
||||
public function withDismissAction($text, $variant = self::ACTION_VARIANT_SECONDARY){
|
||||
|
||||
$ajaxUrl = $this->getDismissAjaxUrl();
|
||||
|
||||
$action = '<a class="button button-' . $variant . '" href="#" data-action="dismiss" data-ajax-url="' . esc_attr($ajaxUrl) . '">' . $text . '</a>';
|
||||
|
||||
return $this->addAction($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* add the postpone action
|
||||
*/
|
||||
public function withPostponeAction($text, $duration, $variant = self::ACTION_VARIANT_SECONDARY){
|
||||
|
||||
$ajaxUrl = $this->getPostponeAjaxUrl($duration);
|
||||
|
||||
$action = '<a class="button button-' . $variant . '" href="#" data-action="postpone" data-ajax-url="' . esc_attr($ajaxUrl) . '">' . $text . '</a>';
|
||||
|
||||
return $this->addAction($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function build(){
|
||||
|
||||
$class = implode(' ', array(
|
||||
'notice',
|
||||
'notice-' . $this->color,
|
||||
'uc-admin-notice',
|
||||
'uc-admin-notice--' . $this->getId(),
|
||||
));
|
||||
|
||||
$html = '<div class="' . esc_attr($class) . '">';
|
||||
$html .= '<div class="uc-notice-wrapper">';
|
||||
$html .= $this->getLogoHtml();
|
||||
$html .= '<div class="uc-notice-container">';
|
||||
$html .= $this->getHeadingHtml();
|
||||
$html .= $this->getContentHtml();
|
||||
$html .= $this->getActionsHtml();
|
||||
$html .= $this->getDebugHtml();
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= $this->getDismissHtml();
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the logo html
|
||||
*/
|
||||
private function getLogoHtml(){
|
||||
|
||||
$logoUrl = GlobalsUC::$urlPluginImages . 'logo-circle.svg';
|
||||
|
||||
return '<img class="uc-notice-logo" src="' . esc_attr($logoUrl) . '" alt="Logo" width="40" height="40" />';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the heading html
|
||||
*/
|
||||
private function getHeadingHtml(){
|
||||
|
||||
if(empty($this->heading))
|
||||
return '';
|
||||
|
||||
return '<h3 class="uc-notice-heading">' . $this->heading . '</h3>';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the content html
|
||||
*/
|
||||
private function getContentHtml(){
|
||||
|
||||
if(empty($this->content))
|
||||
return '';
|
||||
|
||||
return '<p class="uc-notice-content">' . $this->content . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* get actions html
|
||||
*/
|
||||
private function getActionsHtml(){
|
||||
|
||||
if(empty($this->actions))
|
||||
return '';
|
||||
|
||||
return '<div class="uc-notice-actions">' . implode('', $this->actions) . '</div>';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
abstract class UCAdminNoticeBuilderAbstract{
|
||||
|
||||
private $id;
|
||||
private $dismissible = false;
|
||||
private $debug;
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
abstract public function build();
|
||||
|
||||
/**
|
||||
* create a new builder instance
|
||||
*/
|
||||
public function __construct($id){
|
||||
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice as dismissible
|
||||
*/
|
||||
public function dismissible(){
|
||||
|
||||
$this->dismissible = true;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice debug data
|
||||
*/
|
||||
public function debug($data){
|
||||
|
||||
$this->debug = $data;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
protected function getId(){
|
||||
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the dismiss html
|
||||
*/
|
||||
protected function getDismissHtml(){
|
||||
|
||||
if($this->dismissible === false)
|
||||
return '';
|
||||
|
||||
$ajaxUrl = $this->getDismissAjaxUrl();
|
||||
$text = __('Dismiss', 'unlimited-elements-for-elementor');
|
||||
$title = __('Dismiss Notice', 'unlimited-elements-for-elementor');
|
||||
|
||||
return '<a class="uc-notice-dismiss" href="#" data-action="dismiss" title="' . esc_attr($title) . '" data-ajax-url="' . esc_attr($ajaxUrl) . '">' . $text . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the debug html
|
||||
*/
|
||||
protected function getDebugHtml(){
|
||||
|
||||
if(empty($this->debug))
|
||||
return '';
|
||||
|
||||
return '<p class="uc-notice-debug"><b>DEBUG:</b> ' . $this->debug . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the dismiss ajax url
|
||||
*/
|
||||
protected function getDismissAjaxUrl(){
|
||||
|
||||
$ajaxUrl = HelperUC::getUrlAjax('dismiss_notice');
|
||||
$ajaxUrl = UniteFunctionsUC::addUrlParams($ajaxUrl, array('id' => $this->id));
|
||||
|
||||
return $ajaxUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the postpone ajax url (duration in hours)
|
||||
*/
|
||||
protected function getPostponeAjaxUrl($duration){
|
||||
|
||||
$ajaxUrl = HelperUC::getUrlAjax('postpone_notice');
|
||||
$ajaxUrl = UniteFunctionsUC::addUrlParams($ajaxUrl, array('id' => $this->id, 'duration' => $duration));
|
||||
|
||||
return $ajaxUrl;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
$path = dirname(__FILE__) . '/';
|
||||
|
||||
require_once $path . 'builders/builder_abstract.class.php';
|
||||
require_once $path . 'builders/builder.class.php';
|
||||
require_once $path . 'builders/banner_builder.class.php';
|
||||
|
||||
require_once $path . 'notices/notice_abstract.class.php';
|
||||
require_once $path . 'notices/banner.class.php';
|
||||
require_once $path . 'notices/simple_example.class.php';
|
||||
require_once $path . 'notices/doubly.class.php';
|
||||
require_once $path . 'notices/rating.class.php';
|
||||
|
||||
require_once $path . 'manager.class.php';
|
||||
require_once $path . 'options.class.php';
|
||||
require_once $path . 'notices.class.php';
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticesManager{
|
||||
|
||||
private static $notices = array();
|
||||
|
||||
/**
|
||||
* get all notices
|
||||
*/
|
||||
public static function getNotices(){
|
||||
|
||||
return self::$notices;
|
||||
}
|
||||
|
||||
/**
|
||||
* add a notice instance
|
||||
*/
|
||||
public static function addNotice($notice){
|
||||
|
||||
self::$notices[$notice->getId()] = $notice;
|
||||
}
|
||||
|
||||
/**
|
||||
* mark the notice as dismissed
|
||||
*/
|
||||
public static function dismissNotice($id){
|
||||
|
||||
$notice = self::getNotice($id);
|
||||
|
||||
if($notice === null)
|
||||
return;
|
||||
|
||||
$notice->dismiss();
|
||||
}
|
||||
|
||||
/**
|
||||
* postpone the notice for the given duration (in hours)
|
||||
*/
|
||||
public static function postponeNotice($id, $duration){
|
||||
|
||||
$notice = self::getNotice($id);
|
||||
|
||||
if($notice === null)
|
||||
return;
|
||||
|
||||
$notice->postpone($duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice by identifier
|
||||
*/
|
||||
private static function getNotice($id){
|
||||
|
||||
if(empty(self::$notices[$id]))
|
||||
return null;
|
||||
|
||||
return self::$notices[$id];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
abstract class UCAdminNotices{
|
||||
|
||||
const NOTICES_DISPLAY_LIMIT = 2;
|
||||
|
||||
private static $initialized = false;
|
||||
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
public static function init($notices){
|
||||
|
||||
$shouldInitialize = self::shouldInitialize();
|
||||
|
||||
if($shouldInitialize === false)
|
||||
return;
|
||||
|
||||
self::initializeOptions();
|
||||
|
||||
self::registerNotices($notices);
|
||||
self::registerHooks();
|
||||
|
||||
self::checkDismissAction();
|
||||
|
||||
self::$initialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* display notices
|
||||
*/
|
||||
public static function displayNotices(){
|
||||
|
||||
$notices = UCAdminNoticesManager::getNotices();
|
||||
$displayedCount = 0;
|
||||
|
||||
foreach($notices as $notice){
|
||||
$isDebug = $notice->isDebug();
|
||||
|
||||
if($isDebug === true){
|
||||
$noticeHtml = $notice->getHtml();
|
||||
|
||||
echo $noticeHtml;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if($displayedCount >= self::NOTICES_DISPLAY_LIMIT)
|
||||
return;
|
||||
|
||||
$isDisplayable = $notice->shouldDisplay();
|
||||
|
||||
if($isDisplayable === false)
|
||||
continue;
|
||||
|
||||
$displayedCount++;
|
||||
|
||||
$noticeHtml = $notice->getHtml();
|
||||
|
||||
echo $noticeHtml;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* enqueue assets
|
||||
*/
|
||||
public static function enqueueAssets(){
|
||||
|
||||
HelperUC::addStyleAbsoluteUrl(GlobalsUC::$url_provider . 'assets/admin_notices.css', 'uc_admin_notices');
|
||||
HelperUC::addScriptAbsoluteUrl(GlobalsUC::$url_provider . 'assets/admin_notices.js', 'uc_admin_notices');
|
||||
}
|
||||
|
||||
/**
|
||||
* check if notices need to be initialized
|
||||
*/
|
||||
private static function shouldInitialize(){
|
||||
|
||||
if(self::$initialized === true)
|
||||
return false;
|
||||
|
||||
if(GlobalsUC::$is_admin === false)
|
||||
return false;
|
||||
|
||||
if(current_user_can('administrator') === false)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize options
|
||||
*/
|
||||
private static function initializeOptions(){
|
||||
|
||||
// Set plugin installation time
|
||||
$installTime = UCAdminNoticesOptions::getOption('install_time');
|
||||
|
||||
if(empty($installTime))
|
||||
UCAdminNoticesOptions::setOption('install_time', time());
|
||||
}
|
||||
|
||||
/**
|
||||
* check for dismiss action
|
||||
*/
|
||||
private static function checkDismissAction(){
|
||||
|
||||
$id = UniteFunctionsUC::getPostGetVariable('uc_dismiss_notice', '', UniteFunctionsUC::SANITIZE_KEY);
|
||||
|
||||
if(empty($id))
|
||||
return;
|
||||
|
||||
UCAdminNoticesManager::dismissNotice($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* register notices
|
||||
*/
|
||||
private static function registerNotices($notices){
|
||||
|
||||
foreach($notices as $notice){
|
||||
UCAdminNoticesManager::addNotice($notice);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* register hooks
|
||||
*/
|
||||
private static function registerHooks(){
|
||||
|
||||
UniteProviderFunctionsUC::addFilter('admin_notices', array(self::class, 'displayNotices'), 10, 3);
|
||||
UniteProviderFunctionsUC::addAction('admin_enqueue_scripts', array(self::class, 'enqueueAssets'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeBanner extends UCAdminNoticeAbstract{
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
public function getId(){
|
||||
|
||||
return 'black_friday_23a';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function getHtml(){
|
||||
|
||||
$linkUrl = 'https://unlimited-elements.com/pricing/';
|
||||
$linkTarget = '_blank';
|
||||
//$imageUrl = GlobalsUC::$urlPluginImages . 'bannerimage.jpg';
|
||||
$imageUrl = 'http://via.placeholder.com/1360x110';
|
||||
|
||||
$builder = $this->createBannerBuilder();
|
||||
$builder->dismissible();
|
||||
$builder->theme(UCAdminNoticeBannerBuilder::THEME_DARK);
|
||||
$builder->link($linkUrl, $linkTarget);
|
||||
$builder->image($imageUrl);
|
||||
|
||||
$html = $builder->build();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the notice
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
$this->freeOnly();
|
||||
$this->setLocation(self::LOCATION_EVERYWHERE);
|
||||
$this->setDuration(720); // 30 days in hours
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeDoubly extends UCAdminNoticeAbstract{
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
public function getId(){
|
||||
|
||||
return 'doubly';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function getHtml(){
|
||||
|
||||
$heading = __('Live Copy Paste from Unlimited Elements', 'unlimited-elements-for-elementor');
|
||||
$content = __('Did you know that now you can copy fully designed sections from Unlimited Elements to your website for FREE? <br /> If you want to try then install our new plugin called Doubly.', 'unlimited-elements-for-elementor');
|
||||
|
||||
$installText = __('Install Doubly Now', 'unlimited-elements-for-elementor');
|
||||
$installUrl = UniteFunctionsWPUC::getInstallPluginLink('doubly');
|
||||
$installUrl = UniteFunctionsUC::addUrlParams($installUrl, array('uc_dismiss_notice' => $this->getId()));
|
||||
|
||||
$builder = $this->createBuilder();
|
||||
$builder->dismissible();
|
||||
$builder->color(UCAdminNoticeBuilder::COLOR_DOUBLY);
|
||||
$builder->withHeading($heading);
|
||||
$builder->withContent($content);
|
||||
$builder->withLinkAction($installText, $installUrl);
|
||||
|
||||
$html = $builder->build();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the notice
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
$this->setDuration(48); // 2 days in hours
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice condition is allowed
|
||||
*/
|
||||
protected function isConditionAllowed(){
|
||||
|
||||
// check if the Doubly plugin is installed
|
||||
if(defined('DOUBLY_INC'))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
abstract class UCAdminNoticeAbstract{
|
||||
|
||||
const LOCATION_EVERYWHERE = 'everywhere';
|
||||
const LOCATION_DASHBOARD = 'dashboard';
|
||||
const LOCATION_PLUGIN = 'plugin';
|
||||
|
||||
private $location = self::LOCATION_EVERYWHERE;
|
||||
private $start = 0;
|
||||
private $duration = 0;
|
||||
private $freeOnly = false;
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
abstract public function getId();
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
abstract public function getHtml();
|
||||
|
||||
/**
|
||||
* create a new notice instance
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice is in the debug mode
|
||||
*/
|
||||
public function isDebug(){
|
||||
|
||||
if(GlobalsUnlimitedElements::$debugAdminNotices === true)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice should be displayed
|
||||
*/
|
||||
public function shouldDisplay(){
|
||||
|
||||
$isDebug = $this->isDebug();
|
||||
|
||||
if($isDebug === true)
|
||||
return true;
|
||||
|
||||
$isDismissed = $this->isDismissed();
|
||||
|
||||
if($isDismissed === true)
|
||||
return false;
|
||||
|
||||
$isFreeAllowed = $this->isFreeAllowed();
|
||||
|
||||
if($isFreeAllowed === false)
|
||||
return false;
|
||||
|
||||
$isLocationAllowed = $this->isLocationAllowed();
|
||||
|
||||
if($isLocationAllowed === false)
|
||||
return false;
|
||||
|
||||
$isConditionAllowed = $this->isConditionAllowed();
|
||||
|
||||
if($isConditionAllowed === false)
|
||||
return false;
|
||||
|
||||
$isScheduled = $this->isScheduled();
|
||||
|
||||
if($isScheduled === true)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* mark the notice as dismissed
|
||||
*/
|
||||
public function dismiss(){
|
||||
|
||||
$this->setOption('dismissed', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* postpone the notice for the given duration (in hours)
|
||||
*/
|
||||
public function postpone($duration){
|
||||
|
||||
$this->setOption('start_time', time() + $duration * 3600);
|
||||
$this->deleteOption('finish_time');
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the notice
|
||||
*/
|
||||
protected function init(){
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* create a new builder instance
|
||||
*/
|
||||
protected function createBuilder(){
|
||||
|
||||
$id = $this->getId();
|
||||
|
||||
$builder = new UCAdminNoticeBuilder($id);
|
||||
$builder = $this->initBuilder($builder);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* create a new banner builder instance
|
||||
*/
|
||||
protected function createBannerBuilder(){
|
||||
|
||||
$id = $this->getId();
|
||||
|
||||
$builder = new UCAdminNoticeBannerBuilder($id);
|
||||
$builder = $this->initBuilder($builder);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice condition is allowed
|
||||
*/
|
||||
protected function isConditionAllowed(){
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* enable the notice free only mode - show only in the free version
|
||||
*/
|
||||
protected function freeOnly(){
|
||||
|
||||
$this->freeOnly = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice display location
|
||||
*/
|
||||
protected function setLocation($location){
|
||||
|
||||
$this->location = $location;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice start offset in hours from the plugin installation
|
||||
*/
|
||||
protected function setStart($start){
|
||||
|
||||
$this->start = $start;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice duration offset in hours from the first display
|
||||
*/
|
||||
protected function setDuration($duration){
|
||||
|
||||
$this->duration = $duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the builder instance
|
||||
*/
|
||||
private function initBuilder($builder){
|
||||
|
||||
$isDebug = $this->isDebug();
|
||||
|
||||
if($isDebug === true){
|
||||
$debugData = $this->getDebugData();
|
||||
|
||||
$builder->debug($debugData);
|
||||
}
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the debug data of the notice
|
||||
*/
|
||||
private function getDebugData(){
|
||||
|
||||
$isFreeAllowed = $this->isFreeAllowed();
|
||||
|
||||
$id = $this->getId();
|
||||
|
||||
if($isFreeAllowed === false)
|
||||
return "Notice <b>{$id}</b> hidden - free only";
|
||||
|
||||
$isDismissed = $this->isDismissed();
|
||||
|
||||
if($isDismissed === true)
|
||||
return "Notice <b>{$id}</b> hidden - dismissed";
|
||||
|
||||
$isLocationAllowed = $this->isLocationAllowed();
|
||||
|
||||
if($isLocationAllowed === false)
|
||||
return "Notice <b>{$id}</b> hidden - incorrect location";
|
||||
|
||||
$isConditionAllowed = $this->isConditionAllowed();
|
||||
|
||||
if($isConditionAllowed === false)
|
||||
return "Notice <b>{$id}</b> hidden - false condition";
|
||||
|
||||
$dateFormat = 'j F Y H:i:s';
|
||||
$currentTime = time();
|
||||
$startTime = $this->getStartTime();
|
||||
|
||||
if($currentTime < $startTime)
|
||||
return "Notice <b>{$id}</b> hidden - scheduled (will be visible on " . date($dateFormat, $startTime) . ")";
|
||||
|
||||
$finishTime = $this->getFinishTime();
|
||||
|
||||
if($currentTime <= $finishTime)
|
||||
return "Notice <b>{$id}</b> visible (will be hidden on ". date($dateFormat, $finishTime). ")";
|
||||
|
||||
return "Notice <b>{$id}</b> hidden - permanently";
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice is dismissed
|
||||
*/
|
||||
private function isDismissed(){
|
||||
|
||||
$isDismissed = $this->getOption('dismissed', false);
|
||||
$isDismissed = UniteFunctionsUC::strToBool($isDismissed);
|
||||
|
||||
return $isDismissed;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice is allowed for the free version
|
||||
*/
|
||||
private function isFreeAllowed(){
|
||||
|
||||
if($this->freeOnly === true && GlobalsUC::$isProVersion === true)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice location is allowed
|
||||
*/
|
||||
private function isLocationAllowed(){
|
||||
|
||||
switch($this->location){
|
||||
case self::LOCATION_EVERYWHERE:
|
||||
return true;
|
||||
break;
|
||||
|
||||
case self::LOCATION_DASHBOARD:
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if($current_screen->id === 'dashboard')
|
||||
return true;
|
||||
break;
|
||||
|
||||
case self::LOCATION_PLUGIN:
|
||||
$page = UniteFunctionsUC::getGetVar('page', '', UniteFunctionsUC::SANITIZE_KEY);
|
||||
|
||||
if($page === GlobalsUnlimitedElements::PLUGIN_NAME)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the notice is scheduled
|
||||
*/
|
||||
private function isScheduled(){
|
||||
|
||||
$currentTime = time();
|
||||
$startTime = $this->getStartTime();
|
||||
$finishTime = $this->getFinishTime();
|
||||
|
||||
if($currentTime >= $startTime && $currentTime <= $finishTime)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice start time
|
||||
*/
|
||||
private function getStartTime(){
|
||||
|
||||
$installTime = intval(UCAdminNoticesOptions::getOption('install_time'));
|
||||
$startTime = $this->getOption('start_time');
|
||||
|
||||
if(empty($startTime))
|
||||
$startTime = $installTime + $this->start * 3600;
|
||||
|
||||
return $startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice finish time
|
||||
*/
|
||||
private function getFinishTime(){
|
||||
|
||||
$currentTime = time();
|
||||
$startTime = $this->getStartTime();
|
||||
|
||||
if($currentTime >= $startTime){
|
||||
$finishTime = $this->getOption('finish_time');
|
||||
|
||||
if(empty($finishTime)){
|
||||
$finishTime = $currentTime + $this->duration * 3600;
|
||||
|
||||
$this->setOption('finish_time', $finishTime);
|
||||
}
|
||||
|
||||
return $finishTime;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice option value
|
||||
*/
|
||||
private function getOption($key, $fallback = null){
|
||||
|
||||
$value = UCAdminNoticesOptions::getNoticeOption($this->getId(), $key, $fallback);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice option value
|
||||
*/
|
||||
private function setOption($key, $value){
|
||||
|
||||
UCAdminNoticesOptions::setNoticeOption($this->getId(), $key, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete the notice option value
|
||||
*/
|
||||
private function deleteOption($key){
|
||||
|
||||
UCAdminNoticesOptions::deleteNoticeOption($this->getId(), $key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeRating extends UCAdminNoticeAbstract{
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
public function getId(){
|
||||
|
||||
return 'rating';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function getHtml(){
|
||||
|
||||
$heading = __('Could you please do us a BIG favor?', 'unlimited-elements-for-elementor');
|
||||
$content = __('Leave a 5-start rating on WordPress. Help us spread the word and boost our motivation.', 'unlimited-elements-for-elementor');
|
||||
|
||||
$rateText = __('Ok, you deserve it', 'unlimited-elements-for-elementor');
|
||||
$rateUrl = GlobalsUC::URL_RATE;
|
||||
$rateVariant = UCAdminNoticeBuilder::ACTION_VARIANT_PRIMARY;
|
||||
$rateTarget = '_blank';
|
||||
|
||||
$postponeText = __('Nope, maybe later', 'unlimited-elements-for-elementor');
|
||||
$postponeDuration = 168; // 7 days in hours
|
||||
|
||||
$dismissText = __('I already did', 'unlimited-elements-for-elementor');
|
||||
|
||||
$builder = $this->createBuilder();
|
||||
$builder->dismissible();
|
||||
$builder->withHeading($heading);
|
||||
$builder->withContent($content);
|
||||
$builder->withLinkAction($rateText, $rateUrl, $rateVariant, $rateTarget);
|
||||
$builder->withPostponeAction($postponeText, $postponeDuration);
|
||||
$builder->withDismissAction($dismissText);
|
||||
|
||||
$html = $builder->build();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the notice
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
$this->setStart(240); // 10 days in hours
|
||||
$this->setDuration(240); // 10 days in hours
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticeSimpleExample extends UCAdminNoticeAbstract{
|
||||
|
||||
/**
|
||||
* get the notice identifier
|
||||
*/
|
||||
public function getId(){
|
||||
|
||||
return 'simple-example';
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice html
|
||||
*/
|
||||
public function getHtml(){
|
||||
|
||||
$heading = __('Example of a simple notice', 'unlimited-elements-for-elementor');
|
||||
$content = __('Here is the content of a simple notice.', 'unlimited-elements-for-elementor');
|
||||
|
||||
$linkText = __('Link Text', 'unlimited-elements-for-elementor');
|
||||
$linkUrl = 'https://google.com';
|
||||
$linkVariant = UCAdminNoticeBuilder::ACTION_VARIANT_PRIMARY;
|
||||
$linkTarget = '_blank';
|
||||
|
||||
$builder = $this->createBuilder();
|
||||
$builder->dismissible();
|
||||
$builder->withHeading($heading);
|
||||
$builder->withContent($content);
|
||||
$builder->withLinkAction($linkText, $linkUrl, $linkVariant, $linkTarget);
|
||||
|
||||
$html = $builder->build();
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the notice
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
$this->setLocation(self::LOCATION_PLUGIN);
|
||||
$this->setDuration(8760); // 365 days in hours
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCAdminNoticesOptions{
|
||||
|
||||
const OPTIONS_KEY = 'unlimited_elements_notices';
|
||||
|
||||
private static $optionsCache = array();
|
||||
|
||||
/**
|
||||
* get the option value
|
||||
*/
|
||||
public static function getOption($key, $fallback = null){
|
||||
|
||||
$options = self::getOptions();
|
||||
$value = UniteFunctionsUC::getVal($options['options'], $key, $fallback);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the option value
|
||||
*/
|
||||
public static function setOption($key, $value){
|
||||
|
||||
$options = self::getOptions();
|
||||
$options['options'][$key] = $value;
|
||||
|
||||
self::setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice all options
|
||||
*/
|
||||
public static function getNoticeOptions($id){
|
||||
|
||||
$options = self::getOptions();
|
||||
$noticeOptions = UniteFunctionsUC::getVal($options['notices'], $id, array());
|
||||
|
||||
return $noticeOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the notice option value
|
||||
*/
|
||||
public static function getNoticeOption($id, $key, $fallback = null){
|
||||
|
||||
$options = self::getOptions();
|
||||
$noticeOptions = self::getNoticeOptions($id);
|
||||
|
||||
$value = UniteFunctionsUC::getVal($noticeOptions, $key, $fallback);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* set the notice option value
|
||||
*/
|
||||
public static function setNoticeOption($id, $key, $value){
|
||||
|
||||
$options = self::getOptions();
|
||||
$noticeOptions = self::getNoticeOptions($id);
|
||||
|
||||
$noticeOptions[$key] = $value;
|
||||
|
||||
$options['notices'][$id] = $noticeOptions;
|
||||
|
||||
self::setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete the notice option value
|
||||
*/
|
||||
public static function deleteNoticeOption($id, $key){
|
||||
|
||||
$options = self::getOptions();
|
||||
$noticeOptions = self::getNoticeOptions($id);
|
||||
|
||||
unset($noticeOptions[$key]);
|
||||
|
||||
$options['notices'][$id] = $noticeOptions;
|
||||
|
||||
self::setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* get all options
|
||||
*/
|
||||
private static function getOptions(){
|
||||
|
||||
if(empty(self::$optionsCache)){
|
||||
self::$optionsCache = get_option(self::OPTIONS_KEY, array(
|
||||
'options' => array(),
|
||||
'notices' => array(),
|
||||
));
|
||||
}
|
||||
|
||||
return self::$optionsCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* set all options
|
||||
*/
|
||||
private static function setOptions($options){
|
||||
|
||||
self::$optionsCache = $options;
|
||||
|
||||
update_option(self::OPTIONS_KEY, $options);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
.uc-admin-notice {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uc-admin-notice.notice-doubly {
|
||||
border-color: #ff6a00;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-dismiss {
|
||||
font-size: 13px;
|
||||
line-height: 1em;
|
||||
text-decoration: none;
|
||||
padding: 12px 12px 12px 24px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-dismiss:hover,
|
||||
.uc-admin-notice .uc-notice-dismiss:focus {
|
||||
color: #cc0000;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-dismiss::before {
|
||||
content: "\f153";
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-family: dashicons;
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
margin-top: -8px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 4px;
|
||||
transition: color 0.05s ease;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-wrapper {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding-top: 24px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-logo {
|
||||
display: block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 12px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-heading {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
line-height: 1.25em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-content {
|
||||
font-size: 14px;
|
||||
line-height: 1.5em;
|
||||
margin: 8px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-actions {
|
||||
margin: 16px 0 0 0;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-actions .button + .button {
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
.uc-admin-notice .uc-notice-debug {
|
||||
font-size: 12px;
|
||||
line-height: 1.5em;
|
||||
color: #757575;
|
||||
margin: 16px 0 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-dismiss {
|
||||
text-indent: -9999em;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner.uc-admin-notice--theme-dark .uc-notice-dismiss {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner.uc-admin-notice--theme-light .uc-notice-dismiss {
|
||||
color: #1d2327;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-dismiss:hover,
|
||||
.uc-admin-notice--banner .uc-notice-dismiss:focus {
|
||||
color: #ea3384;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-dismiss::before {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
font-size: 24px;
|
||||
line-height: 24px;
|
||||
text-indent: 0;
|
||||
margin-top: 0;
|
||||
top: 8px;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-link {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.uc-admin-notice--banner .uc-notice-debug {
|
||||
margin: 0;
|
||||
padding: 12px;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
// Handle notice dismiss & postpone actions
|
||||
$(document).on('click', '.uc-admin-notice [data-action="dismiss"], .uc-admin-notice [data-action="postpone"]', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $action = $(this);
|
||||
var $root = $action.closest('.uc-admin-notice');
|
||||
var url = $action.attr('data-ajax-url');
|
||||
|
||||
$root.slideUp(200, function () {
|
||||
$root.remove();
|
||||
});
|
||||
|
||||
$.post(url);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,51 @@
|
||||
.ue-gutenberg-settings-error {
|
||||
display: none;
|
||||
font-size: var(--ue-font-size-small);
|
||||
line-height: var(--ue-line-height-small);
|
||||
color: var(--ue-color-danger);
|
||||
padding: 0 16px 16px 16px;
|
||||
}
|
||||
|
||||
.ue-gutenberg-settings-spinner {
|
||||
text-align: center;
|
||||
padding: 0 16px 16px 16px;
|
||||
}
|
||||
|
||||
.ue-gutenberg-settings-spinner > svg {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-loader {
|
||||
display: none;
|
||||
background: rgba(var(--ue-color-light-rgb), 0.6);
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-loader > svg {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-placeholder {
|
||||
background: var(--ue-color-gray-lightest);
|
||||
text-align: center;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.ue-gutenberg-widget-placeholder > svg {
|
||||
margin: 0;
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
(function (wp) {
|
||||
var wbe = wp.blockEditor;
|
||||
var wc = wp.components;
|
||||
var wd = wp.data;
|
||||
var we = wp.element;
|
||||
var el = we.createElement;
|
||||
|
||||
// trigger block focus in case widget prevents clicks (carousels etc.)
|
||||
jQuery(document).on("click", ".ue-gutenberg-widget-wrapper", function () {
|
||||
jQuery(this).closest("[tabindex]").focus();
|
||||
});
|
||||
|
||||
// prevent link clicks inside widgets
|
||||
jQuery(document).on("click", ".ue-gutenberg-widget-wrapper a", function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
var edit = function (props) {
|
||||
var previewUrl = props.attributes._preview;
|
||||
|
||||
if (previewUrl)
|
||||
return el("img", { src: previewUrl, style: { width: "100%", height: "auto" } });
|
||||
|
||||
var blockProps = wbe.useBlockProps();
|
||||
var widgetContentState = we.useState(null);
|
||||
var settingsVisibleState = we.useState(false);
|
||||
var settingsContentState = we.useState(null);
|
||||
|
||||
var widgetRef = we.useRef(null);
|
||||
var widgetLoaderRef = we.useRef(null);
|
||||
var widgetRequestRef = we.useRef(null);
|
||||
var keepWidgetContentRef = we.useRef(false);
|
||||
var ucSettingsRef = we.useRef(new UniteSettingsUC());
|
||||
var ucHelperRef = we.useRef(new UniteCreatorHelper());
|
||||
|
||||
var isEditorSidebarOpened = wd.useSelect(function (select) {
|
||||
return select("core/edit-post").isEditorSidebarOpened();
|
||||
});
|
||||
|
||||
var activeGeneralSidebarName = wd.useSelect(function (select) {
|
||||
return select("core/edit-post").getActiveGeneralSidebarName();
|
||||
});
|
||||
|
||||
var previewDeviceType = wd.useSelect(function (select) {
|
||||
// since version 6.5
|
||||
var editor = select("core/editor");
|
||||
|
||||
if (editor.getDeviceType)
|
||||
return editor.getDeviceType();
|
||||
|
||||
// fallback
|
||||
return select("core/edit-post").__experimentalGetPreviewDeviceType();
|
||||
});
|
||||
|
||||
var widgetId = "ue-gutenberg-widget-" + props.clientId;
|
||||
var settingsId = "ue-gutenberg-settings-" + props.clientId;
|
||||
var settingsTempId = settingsId + "-temp";
|
||||
var settingsErrorId = settingsId + "-error";
|
||||
|
||||
var settingsVisible = settingsVisibleState[0];
|
||||
var setSettingsVisible = settingsVisibleState[1];
|
||||
|
||||
var settingsContent = settingsContentState[0];
|
||||
var setSettingsContent = settingsContentState[1];
|
||||
|
||||
var widgetContent = widgetContentState[0];
|
||||
var setWidgetContent = widgetContentState[1];
|
||||
|
||||
var ucSettings = ucSettingsRef.current;
|
||||
var ucHelper = ucHelperRef.current;
|
||||
|
||||
var initSettings = function () {
|
||||
ucSettings.destroy();
|
||||
|
||||
var settingsElement = getSettingsElement();
|
||||
|
||||
if (!settingsElement)
|
||||
return;
|
||||
|
||||
ucSettings.init(settingsElement);
|
||||
ucSettings.setSelectorWrapperID(widgetId);
|
||||
ucSettings.setResponsiveType(previewDeviceType.toLowerCase());
|
||||
|
||||
ucSettings.setEventOnChange(function () {
|
||||
saveSettings();
|
||||
});
|
||||
|
||||
ucSettings.setEventOnSelectorsChange(function () {
|
||||
keepWidgetContentRef.current = true;
|
||||
|
||||
saveSettings();
|
||||
|
||||
var css = ucSettings.getSelectorsCss();
|
||||
var includes = ucSettings.getSelectorsIncludes();
|
||||
|
||||
jQuery(widgetRef.current).find("[name=uc_selectors_css]").text(css);
|
||||
|
||||
if (includes) {
|
||||
var windowElement = getPreviewWindowElement();
|
||||
|
||||
ucHelper.putIncludes(windowElement, includes);
|
||||
}
|
||||
});
|
||||
|
||||
ucSettings.setEventOnResponsiveTypeChange(function (event, type) {
|
||||
var deviceType = type.charAt(0).toUpperCase() + type.substring(1);
|
||||
|
||||
wd.dispatch("core/edit-post").__experimentalSetPreviewDeviceType(deviceType);
|
||||
});
|
||||
|
||||
// restore current settings, otherwise apply current
|
||||
var values = getSettings();
|
||||
|
||||
if (values !== null)
|
||||
ucSettings.setValues(values);
|
||||
else
|
||||
saveSettings();
|
||||
};
|
||||
|
||||
var getSettings = function () {
|
||||
return props.attributes.data ? JSON.parse(props.attributes.data) : null;
|
||||
};
|
||||
|
||||
var saveSettings = function () {
|
||||
props.setAttributes({
|
||||
_rootId: ucHelper.getRandomString(5),
|
||||
data: JSON.stringify(ucSettings.getSettingsValues()),
|
||||
});
|
||||
};
|
||||
|
||||
var getSettingsElement = function () {
|
||||
if (!settingsContent)
|
||||
return;
|
||||
|
||||
var settingsElement = jQuery("#" + settingsId);
|
||||
var settingsTempElement = jQuery("#" + settingsTempId);
|
||||
|
||||
settingsTempElement.remove();
|
||||
|
||||
if (settingsElement.length)
|
||||
return settingsElement;
|
||||
|
||||
settingsTempElement = jQuery("<div id='" + settingsTempId + "' />")
|
||||
.hide()
|
||||
.html(settingsContent)
|
||||
.appendTo("body");
|
||||
|
||||
return settingsTempElement;
|
||||
};
|
||||
|
||||
var getPreviewWindowElement = function () {
|
||||
return window.frames["editor-canvas"] || window;
|
||||
};
|
||||
|
||||
var loadSettingsContent = function () {
|
||||
g_ucAdmin.setErrorMessageID(settingsErrorId);
|
||||
|
||||
g_ucAdmin.ajaxRequest("get_addon_settings_html", {
|
||||
id: props.attributes._id,
|
||||
config: getSettings(),
|
||||
}, function (response) {
|
||||
var html = g_ucAdmin.getVal(response, "html");
|
||||
|
||||
setSettingsContent(html);
|
||||
});
|
||||
};
|
||||
|
||||
var loadWidgetContent = function () {
|
||||
if (!widgetContent) {
|
||||
// load existing widgets from the page
|
||||
for (var index in g_gutenbergParsedBlocks) {
|
||||
var block = g_gutenbergParsedBlocks[index];
|
||||
|
||||
if (block.name === props.name) {
|
||||
setWidgetContent(block.html);
|
||||
|
||||
delete g_gutenbergParsedBlocks[index];
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (widgetRequestRef.current !== null)
|
||||
widgetRequestRef.current.abort();
|
||||
|
||||
var loaderElement = jQuery(widgetLoaderRef.current);
|
||||
|
||||
loaderElement.show();
|
||||
|
||||
widgetRequestRef.current = g_ucAdmin.ajaxRequest("get_addon_output_data", {
|
||||
id: props.attributes._id,
|
||||
root_id: props.attributes._rootId,
|
||||
settings: getSettings(),
|
||||
selectors: true,
|
||||
}, function (response) {
|
||||
var html = g_ucAdmin.getVal(response, "html");
|
||||
var includes = g_ucAdmin.getVal(response, "includes");
|
||||
var windowElement = getPreviewWindowElement();
|
||||
|
||||
ucHelper.putIncludes(windowElement, includes, function () {
|
||||
setWidgetContent(html);
|
||||
});
|
||||
}).always(function () {
|
||||
loaderElement.hide();
|
||||
});
|
||||
};
|
||||
|
||||
we.useEffect(function () {
|
||||
// load the settings on the block mount
|
||||
loadSettingsContent();
|
||||
|
||||
// remove loaded styles from the page
|
||||
jQuery("#unlimited-elements-styles").remove();
|
||||
|
||||
return function () {
|
||||
// destroy the settings on the block unmount
|
||||
ucSettings.destroy();
|
||||
};
|
||||
}, []);
|
||||
|
||||
we.useEffect(function () {
|
||||
// settings are visible if:
|
||||
// - the block is selected
|
||||
// - the sidebar is opened
|
||||
// - the "block" tab is selected
|
||||
setSettingsVisible(
|
||||
props.isSelected
|
||||
&& isEditorSidebarOpened
|
||||
&& activeGeneralSidebarName === "edit-post/block"
|
||||
);
|
||||
}, [props.isSelected, isEditorSidebarOpened, activeGeneralSidebarName]);
|
||||
|
||||
we.useEffect(function () {
|
||||
if (ucSettings.isInited())
|
||||
ucSettings.setResponsiveType(previewDeviceType.toLowerCase());
|
||||
}, [previewDeviceType]);
|
||||
|
||||
we.useEffect(function () {
|
||||
if (!settingsVisible)
|
||||
return;
|
||||
|
||||
initSettings();
|
||||
}, [settingsVisible]);
|
||||
|
||||
we.useEffect(function () {
|
||||
if (!settingsContent)
|
||||
return;
|
||||
|
||||
initSettings();
|
||||
}, [settingsContent]);
|
||||
|
||||
we.useEffect(function () {
|
||||
if (!widgetContent)
|
||||
return;
|
||||
|
||||
// insert the widget html manually for the inline script to work
|
||||
jQuery(widgetRef.current).html(widgetContent);
|
||||
}, [widgetContent]);
|
||||
|
||||
we.useEffect(function () {
|
||||
if (keepWidgetContentRef.current) {
|
||||
keepWidgetContentRef.current = false;
|
||||
} else {
|
||||
loadWidgetContent();
|
||||
}
|
||||
}, [props.attributes.data]);
|
||||
|
||||
var settings = el(
|
||||
wbe.InspectorControls, {},
|
||||
el("div", { className: "ue-gutenberg-settings-error", id: settingsErrorId }),
|
||||
settingsContent && el("div", { id: settingsId, dangerouslySetInnerHTML: { __html: settingsContent } }),
|
||||
!settingsContent && el("div", { className: "ue-gutenberg-settings-spinner" }, el(wc.Spinner)),
|
||||
);
|
||||
|
||||
var widget = el(
|
||||
"div", { className: "ue-gutenberg-widget-wrapper" },
|
||||
widgetContent && el("div", { className: "ue-gutenberg-widget-content", id: widgetId, ref: widgetRef }),
|
||||
widgetContent && el("div", { className: "ue-gutenberg-widget-loader", ref: widgetLoaderRef }, el(wc.Spinner)),
|
||||
!widgetContent && el("div", { className: "ue-gutenberg-widget-placeholder" }, el(wc.Spinner)),
|
||||
);
|
||||
|
||||
return el("div", blockProps, settings, widget);
|
||||
};
|
||||
|
||||
for (var name in g_gutenbergBlocks) {
|
||||
var block = g_gutenbergBlocks[name];
|
||||
var args = jQuery.extend(block, { edit: edit });
|
||||
|
||||
// convert the svg icon to element
|
||||
if (args.icon && args.icon.indexOf("<svg ") === 0)
|
||||
args.icon = el("span", { dangerouslySetInnerHTML: { __html: args.icon } });
|
||||
|
||||
wp.blocks.registerBlockType(name, args);
|
||||
}
|
||||
})(wp);
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 376 B |
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 208 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 207 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 332 B |
|
After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
@@ -0,0 +1,539 @@
|
||||
/*! jQuery UI - v1.9.2 - 2012-12-05
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
|
||||
----------------------------------*/
|
||||
.unite-ui .ui-helper-hidden { display: none; }
|
||||
.unite-ui .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
.unite-ui .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.unite-ui .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.unite-ui .ui-helper-clearfix:after { clear: both; }
|
||||
.unite-ui .ui-helper-clearfix { zoom: 1; }
|
||||
.unite-ui .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.unite-ui .ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.unite-ui .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
/*
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
*/
|
||||
|
||||
.unite-ui .ui-resizable,
|
||||
.unite-ui.ui-resizable{ position: relative;}
|
||||
.unite-ui .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.unite-ui .ui-resizable-disabled .ui-resizable-handle,
|
||||
.unite-ui .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
|
||||
.unite-ui .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.unite-ui .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.unite-ui .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.unite-ui .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.unite-ui .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.unite-ui .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.unite-ui .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.unite-ui .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
.unite-ui .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.unite-ui .ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.unite-ui .ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.unite-ui .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.unite-ui .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.unite-ui .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
.unite-ui .ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .unite-ui .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
.unite-ui .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.unite-ui .ui-button, .unite-ui .ui-button:link, .unite-ui .ui-button:visited, .unite-ui .ui-button:hover, .unite-ui .ui-button:active { text-decoration: none; }
|
||||
.unite-ui .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
.unite-ui button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.unite-ui .ui-button-icons-only { width: 3.4em; }
|
||||
.unite-ui button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.unite-ui .ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.unite-ui .ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.unite-ui .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.unite-ui .ui-button-text-icon-primary .ui-button-text,
|
||||
.unite-ui .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.unite-ui .ui-button-text-icon-secondary .ui-button-text,
|
||||
.unite-ui .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.unite-ui .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
.unite-ui input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.unite-ui .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; margin-top: -8px; }
|
||||
.unite-ui .ui-button-icon-only .ui-icon { margin-left: -8px; }
|
||||
.unite-ui .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.unite-ui .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.unite-ui .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.unite-ui .ui-buttonset { margin-right: 7px; }
|
||||
.unite-ui .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
.unite-ui button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
.unite-ui .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-prev,
|
||||
.unite-ui .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-prev-hover,
|
||||
.unite-ui .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-prev span,
|
||||
.unite-ui .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.unite-ui .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.unite-ui .ui-datepicker select.ui-datepicker-month,
|
||||
.unite-ui .ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.unite-ui .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.unite-ui .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.unite-ui .ui-datepicker td { border: 0; padding: 1px; }
|
||||
.unite-ui .ui-datepicker td span,
|
||||
.unite-ui .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.unite-ui .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.unite-ui .ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.unite-ui .ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.unite-ui .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.unite-ui .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.unite-ui .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.unite-ui .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.unite-ui .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.unite-ui .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.unite-ui .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.unite-ui .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.unite-ui .ui-datepicker-rtl { direction: rtl; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.unite-ui .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.unite-ui .ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}
|
||||
|
||||
.unite-ui.ui-dialog {
|
||||
position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden;
|
||||
z-index:100102 !important;
|
||||
}
|
||||
|
||||
div.mce-inline-toolbar-grp{
|
||||
z-index: 100103 !important;
|
||||
}
|
||||
|
||||
|
||||
.unite-ui.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.unite-ui.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.unite-ui.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.unite-ui.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.unite-ui.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
|
||||
.unite-ui.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; cursor:default; }
|
||||
.unite-ui.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; cursor:default; }
|
||||
.unite-ui.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.unite-ui.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.unite-ui.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
|
||||
.unite-ui.ui-draggable-handle, .unite-ui .ui-draggable-handle { cursor: move; }
|
||||
.unite-ui .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.unite-ui .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.unite-ui .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.unite-ui .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.unite-ui .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.unite-ui .ui-menu .ui-menu-item a.ui-state-focus,
|
||||
.unite-ui .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.unite-ui .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.unite-ui .ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.unite-ui .ui-menu-icons { position: relative; }
|
||||
.unite-ui .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.unite-ui .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.unite-ui .ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
.unite-ui .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.unite-ui .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
|
||||
.unite-ui .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.unite-ui .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.unite-ui .ui-slider-horizontal { height: .8em; }
|
||||
.unite-ui .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.unite-ui .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.unite-ui .ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.unite-ui .ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.unite-ui .ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.unite-ui .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.unite-ui .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.unite-ui .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.unite-ui .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.unite-ui .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.unite-ui .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.unite-ui .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.unite-ui .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.unite-ui .ui-spinner-up { top: 0; }
|
||||
.unite-ui .ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.unite-ui .ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
.unite-ui .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.unite-ui .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.unite-ui .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.unite-ui .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.unite-ui .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.unite-ui .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.unite-ui .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.unite-ui .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.unite-ui .ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .unite-ui .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .unite-ui .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.unite-ui.ui-widget, .unite-ui .ui-widget{ font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
||||
|
||||
.unite-ui.ui-widget .ui-widget, .unite-ui .ui-widget .ui-widget { font-size: 1em; }
|
||||
.unite-ui.ui-widget input, .unite-ui .ui-widget input,
|
||||
.unite-ui.ui-widget select, .unite-ui .ui-widget select,
|
||||
.unite-ui.ui-widget textarea, .unite-ui .ui-widget textarea,
|
||||
.unite-ui.ui-widget button, .unite-ui .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
||||
.unite-ui.ui-widget-content, .unite-ui .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
||||
.unite-ui.ui-widget-content a, .unite-ui .ui-widget-content a { color: #222222; }
|
||||
.unite-ui.ui-widget-header, .unite-ui .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
||||
.unite-ui.ui-widget-header a, .unite-ui .ui-widget-header a { color: #222222; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.unite-ui .ui-state-default,
|
||||
.unite-ui .ui-widget-content .ui-state-default,
|
||||
.unite-ui .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.unite-ui .ui-state-default a,
|
||||
.unite-ui .ui-state-default a:link,
|
||||
.unite-ui .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.unite-ui .ui-state-hover,
|
||||
.unite-ui .ui-widget-content .ui-state-hover,
|
||||
.unite-ui .ui-widget-header .ui-state-hover,
|
||||
.unite-ui .ui-state-focus,
|
||||
.unite-ui .ui-widget-content .ui-state-focus,
|
||||
.unite-ui .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.unite-ui .ui-state-hover a,
|
||||
.unite-ui .ui-state-hover a:hover,
|
||||
.unite-ui .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
|
||||
.unite-ui .ui-state-active,
|
||||
.unite-ui .ui-widget-content .ui-state-active,
|
||||
.unite-ui .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.unite-ui .ui-state-active a,
|
||||
.unite-ui .ui-state-active a:link,
|
||||
.unite-ui .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.unite-ui .ui-state-highlight,
|
||||
.unite-ui .ui-widget-content .ui-state-highlight,
|
||||
.unite-ui .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
||||
.unite-ui .ui-state-highlight a,
|
||||
.unite-ui .ui-widget-content .ui-state-highlight a,
|
||||
.unite-ui .ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.unite-ui .ui-state-error,
|
||||
.unite-ui .ui-widget-content .ui-state-error,
|
||||
.unite-ui .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.unite-ui .ui-state-error a,
|
||||
.unite-ui .ui-widget-content .ui-state-error a,
|
||||
.unite-ui .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
||||
.unite-ui .ui-state-error-text,
|
||||
.unite-ui .ui-widget-content .ui-state-error-text,
|
||||
.unite-ui .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
||||
.unite-ui .ui-priority-primary,
|
||||
.unite-ui .ui-widget-content .ui-priority-primary,
|
||||
.unite-ui .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.unite-ui .ui-priority-secondary,
|
||||
.unite-ui .ui-widget-content .ui-priority-secondary,
|
||||
.unite-ui .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.unite-ui .ui-state-disabled,
|
||||
.unite-ui .ui-widget-content .ui-state-disabled,
|
||||
.unite-ui .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.unite-ui .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.unite-ui .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.unite-ui.ui-widget-content .ui-icon.
|
||||
.unite-ui .ui-widget-content .ui-icon{background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
|
||||
.unite-ui .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.unite-ui .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
|
||||
.unite-ui .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.unite-ui .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.unite-ui .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
||||
.unite-ui .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
||||
|
||||
/* positioning */
|
||||
.unite-ui .ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.unite-ui .ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.unite-ui .ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.unite-ui .ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.unite-ui .ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.unite-ui .ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.unite-ui .ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.unite-ui .ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.unite-ui .ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.unite-ui .ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.unite-ui .ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.unite-ui .ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.unite-ui .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.unite-ui .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.unite-ui .ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.unite-ui .ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.unite-ui .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.unite-ui .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.unite-ui .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.unite-ui .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.unite-ui .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.unite-ui .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.unite-ui .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.unite-ui .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.unite-ui .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.unite-ui .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.unite-ui .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.unite-ui .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.unite-ui .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.unite-ui .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.unite-ui .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.unite-ui .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.unite-ui .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.unite-ui .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.unite-ui .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.unite-ui .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.unite-ui .ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.unite-ui .ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.unite-ui .ui-icon-extlink { background-position: -32px -80px; }
|
||||
.unite-ui .ui-icon-newwin { background-position: -48px -80px; }
|
||||
.unite-ui .ui-icon-refresh { background-position: -64px -80px; }
|
||||
.unite-ui .ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.unite-ui .ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.unite-ui .ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.unite-ui .ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.unite-ui .unite-ui .ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.unite-ui .ui-icon-document { background-position: -32px -96px; }
|
||||
.unite-ui .ui-icon-document-b { background-position: -48px -96px; }
|
||||
.unite-ui .ui-icon-note { background-position: -64px -96px; }
|
||||
.unite-ui .ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.unite-ui .ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.unite-ui .ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.unite-ui .ui-icon-comment { background-position: -128px -96px; }
|
||||
.unite-ui .ui-icon-person { background-position: -144px -96px; }
|
||||
.unite-ui .ui-icon-print { background-position: -160px -96px; }
|
||||
.unite-ui .ui-icon-trash { background-position: -176px -96px; }
|
||||
.unite-ui .ui-icon-locked { background-position: -192px -96px; }
|
||||
.unite-ui .ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.unite-ui .ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.unite-ui .ui-icon-tag { background-position: -240px -96px; }
|
||||
.unite-ui .ui-icon-home { background-position: 0 -112px; }
|
||||
.unite-ui .ui-icon-flag { background-position: -16px -112px; }
|
||||
.unite-ui .ui-icon-calendar { background-position: -32px -112px; }
|
||||
.unite-ui .ui-icon-cart { background-position: -48px -112px; }
|
||||
.unite-ui .ui-icon-pencil { background-position: -64px -112px; }
|
||||
.unite-ui .ui-icon-clock { background-position: -80px -112px; }
|
||||
.unite-ui .ui-icon-disk { background-position: -96px -112px; }
|
||||
.unite-ui .ui-icon-calculator { background-position: -112px -112px; }
|
||||
.unite-ui .ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.unite-ui .ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.unite-ui .ui-icon-search { background-position: -160px -112px; }
|
||||
.unite-ui .ui-icon-wrench { background-position: -176px -112px; }
|
||||
.unite-ui .ui-icon-gear { background-position: -192px -112px; }
|
||||
.unite-ui .ui-icon-heart { background-position: -208px -112px; }
|
||||
.unite-ui .ui-icon-star { background-position: -224px -112px; }
|
||||
.unite-ui .ui-icon-link { background-position: -240px -112px; }
|
||||
.unite-ui .ui-icon-cancel { background-position: 0 -128px; }
|
||||
.unite-ui .ui-icon-plus { background-position: -16px -128px; }
|
||||
.unite-ui .ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.unite-ui .ui-icon-minus { background-position: -48px -128px; }
|
||||
.unite-ui .ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.unite-ui .ui-icon-close { background-position: -80px -128px; }
|
||||
.unite-ui .ui-icon-closethick { background-position: -96px -128px; }
|
||||
.unite-ui .ui-icon-key { background-position: -112px -128px; }
|
||||
.unite-ui .ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.unite-ui .ui-icon-scissors { background-position: -144px -128px; }
|
||||
.unite-ui .ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.unite-ui .ui-icon-copy { background-position: -176px -128px; }
|
||||
.unite-ui .ui-icon-contact { background-position: -192px -128px; }
|
||||
.unite-ui .ui-icon-image { background-position: -208px -128px; }
|
||||
.unite-ui .ui-icon-video { background-position: -224px -128px; }
|
||||
.unite-ui .ui-icon-script { background-position: -240px -128px; }
|
||||
.unite-ui .ui-icon-alert { background-position: 0 -144px; }
|
||||
.unite-ui .ui-icon-info { background-position: -16px -144px; }
|
||||
.unite-ui .ui-icon-notice { background-position: -32px -144px; }
|
||||
.unite-ui .ui-icon-help { background-position: -48px -144px; }
|
||||
.unite-ui .ui-icon-check { background-position: -64px -144px; }
|
||||
.unite-ui .ui-icon-bullet { background-position: -80px -144px; }
|
||||
.unite-ui .ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.unite-ui .ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.unite-ui .ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.unite-ui .ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.unite-ui .ui-icon-play { background-position: 0 -160px; }
|
||||
.unite-ui .ui-icon-pause { background-position: -16px -160px; }
|
||||
.unite-ui .ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.unite-ui .ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.unite-ui .ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.unite-ui .ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.unite-ui .ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.unite-ui .ui-icon-stop { background-position: -96px -160px; }
|
||||
.unite-ui .ui-icon-eject { background-position: -112px -160px; }
|
||||
.unite-ui .ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.unite-ui .ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.unite-ui .ui-icon-power { background-position: 0 -176px; }
|
||||
.unite-ui .ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.unite-ui .ui-icon-signal { background-position: -32px -176px; }
|
||||
.unite-ui .ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.unite-ui .ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.unite-ui .ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.unite-ui .ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.unite-ui .ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.unite-ui .ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.unite-ui .ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.unite-ui .ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.unite-ui .ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.unite-ui .ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.unite-ui .ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.unite-ui .ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.unite-ui .ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.unite-ui .ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.unite-ui .ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.unite-ui .ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.unite-ui .ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.unite-ui .ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.unite-ui .ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.unite-ui .ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.unite-ui .ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.unite-ui .ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.unite-ui .ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.unite-ui .ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.unite-ui .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.unite-ui .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.unite-ui .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.unite-ui .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.unite-ui .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.unite-ui .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.unite-ui.ui-corner-all, .unite-ui .ui-corner-all,
|
||||
.unite-ui.ui-corner-top, .unite-ui .ui-corner-top,
|
||||
.unite-ui.ui-corner-left, .unite-ui .ui-corner-left,
|
||||
.unite-ui.ui-corner-tl, .unite-ui .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
||||
.unite-ui.ui-corner-all, .unite-ui .ui-corner-all,
|
||||
.unite-ui.ui-corner-top, .unite-ui .ui-corner-top,
|
||||
.unite-ui.ui-corner-right, .unite-ui .ui-corner-right,
|
||||
.unite-ui.ui-corner-tr, .unite-ui .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.unite-ui.ui-corner-all, .unite-ui .ui-corner-all,
|
||||
.unite-ui.ui-corner-bottom, .unite-ui .ui-corner-bottom,
|
||||
.unite-ui.ui-corner-left, .unite-ui .ui-corner-left,
|
||||
.unite-ui.ui-corner-bl, .unite-ui .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.unite-ui.ui-corner-all, .unite-ui .ui-corner-all,
|
||||
.unite-ui.ui-corner-bottom, .unite-ui .ui-corner-bottom,
|
||||
.unite-ui.ui-corner-right, .unite-ui .ui-corner-right,
|
||||
.unite-ui.ui-corner-br, .unite-ui .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
/*
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
|
||||
*/
|
||||
.unite-ui .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
||||
@@ -0,0 +1,518 @@
|
||||
|
||||
.______________REMOVE_ELEMENTS____________{}
|
||||
|
||||
.unite-view-addons_elementor{
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.unite-view-addons_elementor .content_wrapper{
|
||||
xposition:fixed;
|
||||
xtop:50px;
|
||||
}
|
||||
|
||||
.unite-view-addons_elementor .unite_header_wrapper{
|
||||
xposition:fixed;
|
||||
}
|
||||
|
||||
.toplevel_page_unlimitedelements .update-nag{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.unite-plugin-version-line.unite-view-addons_elementor{
|
||||
xdisplay:none;
|
||||
}
|
||||
|
||||
body.unite-view-addons_elementor #footer-thankyou,
|
||||
body.unite-view-addons_elementor #footer-upgrade{
|
||||
xdisplay:none;
|
||||
}
|
||||
|
||||
body.unite-view-addons_elementor .ui-widget-overlay{
|
||||
background-color:#000000 !important;
|
||||
opacity:0.7;
|
||||
}
|
||||
|
||||
|
||||
.______________GENERAL_LINKS____________{}
|
||||
|
||||
a[href="admin.php?page=blox_page_builder"]{
|
||||
color:#F04C40 !important;
|
||||
}
|
||||
|
||||
a[href="admin.php?page=blox_page_builder"]:hover{
|
||||
color:#F2665C !important;
|
||||
}
|
||||
|
||||
/*
|
||||
a.uc-link-gounlimited{
|
||||
color:#128F0F !important;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
a.uc-link-gounlimited:hover{
|
||||
color:#1BD317 !important;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
.______________HELPERS____________{}
|
||||
|
||||
.ue-flex-center {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.______________GENERAL____________{}
|
||||
|
||||
.unite-div-debug{
|
||||
padding-left:180px;
|
||||
}
|
||||
|
||||
.unite-view-wrapper {
|
||||
margin-top: 0;
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
||||
body.uc-blank-preview .unite-view-wrapper {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
body.uc-blank-preview .unite-div-debug {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
body.post-type-page .unite-div-debug {
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
left: 180px;
|
||||
width: 600px;
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid lightgray;
|
||||
padding: 5px;
|
||||
z-index: 999999;
|
||||
}
|
||||
|
||||
.uc-update-plugin-wrapper{
|
||||
text-align:right;
|
||||
padding-top:10px;
|
||||
}
|
||||
|
||||
.ue-root {
|
||||
font-family: "Inter", sans-serif;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 1.3em;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ue-root * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ue-root a {
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
transition: all 200ms;
|
||||
}
|
||||
|
||||
.ue-content-wrapper {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* @media (max-width: 600px) { */
|
||||
/* .ue-content-wrapper { */
|
||||
/* padding: 20px; */
|
||||
/* } */
|
||||
/* } */
|
||||
|
||||
|
||||
.______________BUTTONS____________{}
|
||||
|
||||
.ue-btn {
|
||||
display: inline-flex;
|
||||
padding: 16px 28px;
|
||||
border-radius: 8px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.ue-btn:hover {
|
||||
color: #ffffff;
|
||||
background-color: #2959f9;
|
||||
}
|
||||
|
||||
.ue-btn img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.ue-btn {
|
||||
padding: 10px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.______________HEADER____________{}
|
||||
|
||||
.ue-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ue-header-logo {
|
||||
width: 224px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.ue-header-buttons {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-view-demo-btn {
|
||||
color: #2959f9;
|
||||
border: 1px solid #2959f9;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-view-demo-btn:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-view-demo-btn svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: #2959f9;
|
||||
transition: all 200ms;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-view-demo-btn:hover svg {
|
||||
fill: #ffffff;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-go-pro-btn {
|
||||
background: linear-gradient(196deg, #2959f9 20.27%, #6111df 73.21%);
|
||||
color: #ffffff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-go-pro-btn:hover {
|
||||
background: linear-gradient(196deg, #2959f9 20.27%, #2959f9 73.21%);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ue-header-buttons .ue-go-pro-btn svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: #ffffff;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.ue-header {
|
||||
flex-wrap: wrap;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.ue-header-logo {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.ue-header-buttons {
|
||||
gap: 10px
|
||||
}
|
||||
}
|
||||
|
||||
.______________BLACK-FRIDAY____________{}
|
||||
|
||||
|
||||
.ue-header__bf{
|
||||
background-color:#000000 !important;
|
||||
|
||||
padding-top:10px;
|
||||
padding-bottom:0px;
|
||||
|
||||
align-items:stretch;
|
||||
}
|
||||
|
||||
.ue-header__inner{
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
align-items:stretch;
|
||||
width:100%;
|
||||
|
||||
background-image:url('http://via.placeholder.com/831x110');
|
||||
background-repeat:no-repeat;
|
||||
background-size:contain;
|
||||
background-position:300px bottom;
|
||||
|
||||
}
|
||||
|
||||
.ue-header__bf .ue-header__logo{
|
||||
|
||||
margin-top:20px;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
.ue-header__bf .ue-go-pro-btn{
|
||||
|
||||
background:linear-gradient(196deg, #ffffff 20.27%, #fafafa 73.21%);
|
||||
color:#2959f9;
|
||||
}
|
||||
.ue-header__bf .ue-go-pro-btn svg path{
|
||||
fill: #2959f9;
|
||||
}
|
||||
|
||||
.ue-header__bf .ue-go-pro-btn:hover svg path{
|
||||
fill: #ffffff;
|
||||
}
|
||||
|
||||
.ue-header__bf .ue-view-demo-btn{
|
||||
display:none;
|
||||
border-color:#ffffff;
|
||||
color:#ffffff;
|
||||
}
|
||||
|
||||
.ue-header__bf .ue-view-demo-btn svg path{
|
||||
fill: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.______________MENU____________{}
|
||||
|
||||
.ue-menu {
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
gap: 16px;
|
||||
padding: 14px;
|
||||
border-radius: 12px;
|
||||
background: #ffffff;
|
||||
margin-bottom: 20px;
|
||||
flex-wrap: wrap
|
||||
}
|
||||
|
||||
.ue-menu-item {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
font-size: 16px;
|
||||
color: #797b80;
|
||||
border-radius: 8px;
|
||||
transition: all 200ms;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ue-menu-item svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
fill: #797b80;
|
||||
transition: all 200ms;
|
||||
}
|
||||
|
||||
.ue-menu-item.ue-active {
|
||||
color: #2959f9;
|
||||
background-color: rgba(41, 89, 249, 0.04);
|
||||
}
|
||||
|
||||
.ue-menu-item.ue-active svg {
|
||||
fill: #2959f9;
|
||||
}
|
||||
|
||||
.ue-menu-item:hover {
|
||||
color: #07080f;
|
||||
background: rgba(7, 8, 15, 0.02);
|
||||
}
|
||||
|
||||
.ue-menu-item:hover svg {
|
||||
fill: #07080f;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.ue-menu {
|
||||
flex-direction: column;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.______________DIALOG_IMAGE_SELECT____________{}
|
||||
|
||||
.uc-dialog-image-select-inner{
|
||||
height:350px;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
.uc-dialog-image-select-bottom{
|
||||
text-align:center;
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
#uc_dialog_image_select_button{
|
||||
margin-top:15px;
|
||||
margin-bottom:10px;
|
||||
font-size:16px;
|
||||
font-weight:bold;
|
||||
height:34px;
|
||||
line-height:35px;
|
||||
padding-left:12px;
|
||||
padding-right:12px;
|
||||
}
|
||||
|
||||
|
||||
.______________LAYOUTS_LIST____________{}
|
||||
|
||||
.wrap .page-title-action.uc-button-catalog,
|
||||
.wrap .page-title-action.uc-button-import{
|
||||
margin-left:30px;
|
||||
color:#515151;
|
||||
}
|
||||
|
||||
.wrap .page-title-action.uc-button-catalog{
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
|
||||
.wrap .page-title-action.uc-button-catalog:hover,
|
||||
.wrap .page-title-action.uc-button-import:hover{
|
||||
background-color:#DEDEDE;
|
||||
border-color:#CDCDCD;
|
||||
}
|
||||
|
||||
.row-actions .loader_text,
|
||||
.row-actions .blox_edit_page_visual .uc-button-visualedit{
|
||||
color:#000000;
|
||||
}
|
||||
|
||||
.row-actions .blox_edit_page_visual .uc-button-visualedit:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
body.edit-php .unite_error_message,
|
||||
body.edit-php .unite_success_message{
|
||||
position:fixed;
|
||||
bottom:5px;
|
||||
right:5px;
|
||||
width:auto;
|
||||
max-width:500px;
|
||||
min-width:200px;
|
||||
}
|
||||
|
||||
.______________POSTS_PAGE____________{}
|
||||
|
||||
body.uc-blox-page #postdivrich,
|
||||
body.uc-blox-page .editor-block-list__layout{
|
||||
visibility:hidden;
|
||||
opacity:0;
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
.uc-edit-post-blox-page-wrapper{
|
||||
display:none;
|
||||
margin-bottom:30px;
|
||||
padding-bottom:30px;
|
||||
border-bottom:1px dashed gray;
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
body.gutenberg-editor-page .uc-edit-post-blox-page-wrapper{
|
||||
padding-left:20px;
|
||||
padding-top:100px;
|
||||
}
|
||||
|
||||
.uc-edit-post-blox-page-wrapper .uc-blox-title{
|
||||
padding-bottom:20px;
|
||||
font-size:18px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.uc-edit-post-blox-page-wrapper .uc-blox-title .uc-blox-subtitle{
|
||||
font-size:14px;
|
||||
font-weight:normal;
|
||||
padding-top:8px;
|
||||
}
|
||||
|
||||
.uc-edit-post-blox-page-wrapper .uc-blox-title.uc-title-blox-landing-page{
|
||||
display:none;
|
||||
}
|
||||
|
||||
body.uc-blox-landing-page .uc-blox-title.uc-title-blox-landing-page{
|
||||
display:block;
|
||||
}
|
||||
|
||||
body.uc-blox-landing-page .uc-blox-title.uc-title-bloxpage{
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
body.uc-blox-page .uc-edit-post-button-to-blox{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
body.uc-blox-page .uc-edit-post-blox-page-wrapper{
|
||||
display:block;
|
||||
}
|
||||
|
||||
.uc-edit-post-blox-page-wrapper.uc-hidden{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.uc-edit-post-button-return-to-wp{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
body.uc-blox-page .uc-edit-post-button-return-to-wp{
|
||||
display:inline-block !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.______________LAYOUTS_IMPORT_METABOX____________{}
|
||||
|
||||
.uc-metabox-import-layout{
|
||||
padding-top:10px;
|
||||
height:40px;
|
||||
}
|
||||
|
||||
.______________EDITOR_SETTING____________{}
|
||||
|
||||
.unite-editor-setting-wrapper.unite-editor-wp{
|
||||
min-width:500px;
|
||||
}
|
||||
|
||||
.unite-settings-sidebar .unite-editor-wp{
|
||||
min-width:0px !important;
|
||||
}
|
||||
|
||||
.______________DASHBOARD_WIDGET____________{}
|
||||
|
||||
.blox-dashboard-widget-wrapper .uc-dashboard-section{
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.uc-dashboard-widget-release-iframe{
|
||||
margin-top:5px;
|
||||
width:100%;
|
||||
min-height:300px;
|
||||
border:1px solid lightgray;
|
||||
}
|
||||
|
||||
.uc-dashboard-widget-release-log{
|
||||
margin-top:10px;
|
||||
}
|
||||
@@ -0,0 +1,922 @@
|
||||
|
||||
//global variables
|
||||
var g_dataProviderUC = {
|
||||
pathSelectImages: null,
|
||||
pathSelectImagesBase:null,
|
||||
urlSelectImagesBase:null,
|
||||
objBrowserImages: null,
|
||||
objBrowserAudio: null
|
||||
};
|
||||
|
||||
function UniteProviderAdminUC(){
|
||||
|
||||
var t = this;
|
||||
var g_parent;
|
||||
|
||||
var g_temp = {
|
||||
keyUrlAssets: "[url_assets]/",
|
||||
};
|
||||
|
||||
/**
|
||||
* open new add image dialog
|
||||
*/
|
||||
function openNewMediaDialog(title,onInsert,isMultiple, type){
|
||||
|
||||
if(isMultiple == undefined)
|
||||
isMultiple = false;
|
||||
|
||||
// Media Library params
|
||||
var frame = wp.media({
|
||||
//frame: 'post',
|
||||
//state: 'insert',
|
||||
title : title,
|
||||
multiple : isMultiple,
|
||||
library : { type : type},
|
||||
button : { text : 'Insert' }
|
||||
});
|
||||
|
||||
// Runs on select
|
||||
frame.on('select',function(){
|
||||
var objSettings = frame.state().get('selection').first().toJSON();
|
||||
|
||||
var selection = frame.state().get('selection');
|
||||
var arrImages = [];
|
||||
|
||||
if(isMultiple == true){ //return image object when multiple
|
||||
selection.map( function( attachment ) {
|
||||
var objImage = attachment.toJSON();
|
||||
var obj = {};
|
||||
obj.url = objImage.url;
|
||||
obj.id = objImage.id;
|
||||
arrImages.push(obj);
|
||||
});
|
||||
onInsert(arrImages);
|
||||
}else{ //return image url and id - when single
|
||||
onInsert(objSettings.url, objSettings.id);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Open ML
|
||||
frame.open();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open new image dialog
|
||||
*/
|
||||
function openNewImageDialog(title, onInsert, isMultiple){
|
||||
|
||||
openNewMediaDialog(title, onInsert, isMultiple, "image");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open audio select dialog
|
||||
*/
|
||||
function openAudioDialog(title, onInsert, isMultiple){
|
||||
|
||||
openNewMediaDialog(title, onInsert, isMultiple, "audio");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open old add image dialog
|
||||
*/
|
||||
function openOldImageDialog(title,onInsert){
|
||||
var params = "type=image&post_id=0&TB_iframe=true";
|
||||
|
||||
params = encodeURI(params);
|
||||
|
||||
tb_show(title,'media-upload.php?'+params);
|
||||
|
||||
window.send_to_editor = function(html) {
|
||||
tb_remove();
|
||||
var urlImage = jQuery(html).attr('src');
|
||||
if(!urlImage || urlImage == undefined || urlImage == "")
|
||||
var urlImage = jQuery('img',html).attr('src');
|
||||
|
||||
onInsert(urlImage,""); //return empty id, it can be changed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* test media editor
|
||||
*/
|
||||
function testMediaEditor(){
|
||||
|
||||
/*
|
||||
trace("open dialog");
|
||||
trace(wp.media.gallery);
|
||||
trace(wp.media);
|
||||
|
||||
var frameStates = {
|
||||
create: 'gallery',
|
||||
add: 'gallery-library',
|
||||
edit: 'gallery-edit'
|
||||
};
|
||||
|
||||
// Open the media dialog
|
||||
|
||||
var attachments = wp.media.query({
|
||||
orderby: 'post__in',
|
||||
order: 'ASC',
|
||||
type: 'image',
|
||||
});
|
||||
|
||||
var objSelection = new wp.media.model.Selection(attachments.models, {
|
||||
props: attachments.props.toJSON(),
|
||||
multiple: true
|
||||
});
|
||||
|
||||
|
||||
var options = {
|
||||
title: 'Add Gallery',
|
||||
state:"gallery", //gallery-library, gallery-edit
|
||||
library: {
|
||||
orderby:"date",
|
||||
query:"true"
|
||||
},
|
||||
multiple: true,
|
||||
modal:true,
|
||||
mode:["select"],
|
||||
// selection: objSelection,
|
||||
uploader:true
|
||||
};
|
||||
|
||||
//var objFrame = wp.media(options);
|
||||
//objFrame.open();
|
||||
|
||||
|
||||
/*
|
||||
wp.media()
|
||||
// On select, get the selected images
|
||||
.on('select', function() {
|
||||
|
||||
trace("select");
|
||||
|
||||
})
|
||||
// Open the dialog
|
||||
.open(options);
|
||||
|
||||
var objFrame = wp.media.editor.open( null, options );
|
||||
objFrame.on("select",function(){
|
||||
|
||||
trace("select!!!");
|
||||
|
||||
});
|
||||
|
||||
//wp.media.gallery.edit('[gallery ids=""]');
|
||||
return(false);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* open "add image" dialog
|
||||
*/
|
||||
this.openAddImageDialog = function(title, onInsert, isMultiple, source){
|
||||
|
||||
if(source == "addon"){
|
||||
openAddonImageSelectDialog(title, onInsert);
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(typeof wp != "undefined" && typeof wp.media != "undefined")
|
||||
openNewImageDialog(title,onInsert,isMultiple);
|
||||
else{
|
||||
openOldImageDialog(title,onInsert);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* open "add image" dialog
|
||||
*/
|
||||
this.openAddMp3Dialog = function(title, onInsert, isMultiple, source){
|
||||
|
||||
|
||||
if(typeof wp == "undefined" || typeof wp.media == "undefined"){
|
||||
trace("the audio select dialog could not be opened");
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(source == "addon"){
|
||||
openAddonAudioSelectDialog(title, onInsert);
|
||||
return(false);
|
||||
}else{
|
||||
|
||||
openAudioDialog(title,onInsert,isMultiple);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* get shortcode
|
||||
*/
|
||||
this.getShortcode = function(alias){
|
||||
|
||||
var shortcode = "[uniteaddon "+alias +"]";
|
||||
|
||||
if(alias == "")
|
||||
shortcode = "";
|
||||
|
||||
return(shortcode);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* clear setting
|
||||
*/
|
||||
this.clearSetting = function(type, objInput, dataname){
|
||||
|
||||
switch(type){
|
||||
case "select_post_taxonomy":
|
||||
case "select_post_type":
|
||||
|
||||
defaultValue = objInput.data(dataname);
|
||||
objInput.val(defaultValue);
|
||||
break;
|
||||
default:
|
||||
return(false);
|
||||
break;
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init setting events
|
||||
*/
|
||||
this.initSettingEvents = function(type, objInput){
|
||||
|
||||
switch(type){
|
||||
case "select_post_taxonomy":
|
||||
initTaxonomyTypeSetting(objInput);
|
||||
break;
|
||||
case "select_post_type":
|
||||
|
||||
initPostTypeSetting(objInput);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* set setting value
|
||||
*/
|
||||
this.setSettingValue = function(type, objInput, value){
|
||||
|
||||
switch(type){
|
||||
case "select_post_taxonomy":
|
||||
case "select_post_type":
|
||||
|
||||
objInput.val(value);
|
||||
objInput.trigger("change");
|
||||
break;
|
||||
default:
|
||||
return(false);
|
||||
break;
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init update plugin button
|
||||
*/
|
||||
function initUpdatePlugin(){
|
||||
|
||||
var objButton = jQuery("#uc_button_update_plugin");
|
||||
|
||||
if(objButton.length == 0)
|
||||
return(false);
|
||||
|
||||
//init update plugin button
|
||||
objButton.click(function(){
|
||||
|
||||
jQuery("#dialog_update_plugin").dialog({
|
||||
dialogClass:"unite-ui",
|
||||
minWidth:600,
|
||||
minHeight:400,
|
||||
modal:true,
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init internal image select dialog
|
||||
*/
|
||||
function initMediaSelectDialog(type){
|
||||
|
||||
if(typeof UCAssetsManager == "undefined")
|
||||
return(false);
|
||||
|
||||
|
||||
switch(type){
|
||||
case "image":
|
||||
var dialogID = "#uc_dialog_image_select";
|
||||
var browserID = "#uc_dialogimage_browser";
|
||||
|
||||
g_dataProviderUC.objBrowserImages = new UCAssetsManager();
|
||||
|
||||
var browser = g_dataProviderUC.objBrowserImages;
|
||||
var inputID = "#uc_dialog_image_select_url";
|
||||
var buttonID = "#uc_dialog_image_select_button";
|
||||
break;
|
||||
case "audio":
|
||||
|
||||
var dialogID = "#uc_dialog_audio_select";
|
||||
var browserID = "#uc_dialogaudio_browser";
|
||||
|
||||
g_dataProviderUC.objBrowserAudio = new UCAssetsManager();
|
||||
|
||||
var browser = g_dataProviderUC.objBrowserAudio;
|
||||
var inputID = "#uc_dialog_audio_select_url";
|
||||
var buttonID = "#uc_dialog_audio_select_button";
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new Error("wrong type: "+type);
|
||||
break;
|
||||
}
|
||||
|
||||
//init assets browser
|
||||
var browserImagesWrapper = jQuery(browserID);
|
||||
|
||||
if(browserImagesWrapper.length == 0)
|
||||
return(false);
|
||||
|
||||
browser.init(browserImagesWrapper);
|
||||
|
||||
//update folder for next time open
|
||||
browser.eventOnUpdateFilelist(function(){
|
||||
|
||||
var path = browser.getActivePath();
|
||||
|
||||
t.setPathSelectImages(path);
|
||||
});
|
||||
|
||||
//on select some file
|
||||
browser.eventOnSelectOperation(function(event, objItem){
|
||||
|
||||
//get relative url
|
||||
var urlRelative = objItem.file;
|
||||
|
||||
if(g_dataProviderUC.pathSelectImagesBase){
|
||||
urlRelative = objItem.url.replace(g_dataProviderUC.pathSelectImagesBase+"/", "");
|
||||
}
|
||||
|
||||
var objInput = jQuery(inputID);
|
||||
|
||||
objItem.url_assets_relative = g_temp.keyUrlAssets + urlRelative;
|
||||
|
||||
objInput.val(urlRelative);
|
||||
objInput.data("item", objItem).val(urlRelative);
|
||||
|
||||
//enable button
|
||||
g_ucAdmin.enableButton(buttonID);
|
||||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* on select button click - close the dialog and run oninsert function
|
||||
*/
|
||||
jQuery(buttonID).click(function(){
|
||||
|
||||
if(g_ucAdmin.isButtonEnabled(buttonID) == false)
|
||||
return(false);
|
||||
|
||||
var objDialog = jQuery(dialogID);
|
||||
var objInput = jQuery(inputID);
|
||||
|
||||
var objItem = objInput.data("item");
|
||||
|
||||
if(!objItem)
|
||||
throw new Error("please select some "+type);
|
||||
|
||||
var funcOnInsert = objDialog.data("func_oninsert");
|
||||
|
||||
if(typeof funcOnInsert != "function")
|
||||
throw new Error("on insert should be a function");
|
||||
|
||||
funcOnInsert(objItem);
|
||||
|
||||
objDialog.dialog("close");
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open addon media select dialog
|
||||
*/
|
||||
function openAddonMediaSelectDialog(title, onInsert, type){
|
||||
|
||||
switch(type){
|
||||
case "image":
|
||||
var dialogID = "#uc_dialog_image_select";
|
||||
var dialogName = "image select";
|
||||
var inputID = "#uc_dialog_image_select_url";
|
||||
var buttonID = "#uc_dialog_image_select_button";
|
||||
var objBrowser = g_dataProviderUC.objBrowserImages;
|
||||
break;
|
||||
case "audio":
|
||||
var dialogID = "#uc_dialog_audio_select";
|
||||
var dialogName = "audio select";
|
||||
var inputID = "#uc_dialog_audio_select_url";
|
||||
var buttonID = "#uc_dialog_audio_select_button";
|
||||
var objBrowser = g_dataProviderUC.objBrowserAudio;
|
||||
break;
|
||||
default:
|
||||
throw new Error("Wrong dialog type:"+type);
|
||||
break;
|
||||
}
|
||||
|
||||
var objDialog = jQuery(dialogID);
|
||||
if(objDialog.length == 0)
|
||||
throw new Error("dialog "+dialogName+" not found!");
|
||||
|
||||
objDialog.data("func_oninsert", onInsert);
|
||||
objDialog.data("obj_browser", objBrowser);
|
||||
|
||||
|
||||
objDialog.dialog({
|
||||
minWidth:900,
|
||||
minHeight:450,
|
||||
modal:true,
|
||||
title:title,
|
||||
open:function(){
|
||||
|
||||
var objDialog = jQuery(this);
|
||||
var objBrowser = objDialog.data("obj_browser");
|
||||
|
||||
//clear the input
|
||||
var objInput = jQuery(inputID);
|
||||
objInput.data("url","").val("");
|
||||
|
||||
//disable the button
|
||||
g_ucAdmin.disableButton(buttonID);
|
||||
|
||||
//objBrowser =
|
||||
|
||||
//set base start path (even if null)
|
||||
objBrowser.setCustomStartPath(g_dataProviderUC.pathSelectImagesBase);
|
||||
|
||||
var loadPath = g_dataProviderUC.pathSelectImages;
|
||||
if(!loadPath)
|
||||
loadPath = g_pathAssetsUC;
|
||||
|
||||
objBrowser.loadPath(loadPath, true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open addon image select dialog
|
||||
*/
|
||||
function openAddonImageSelectDialog(title, onInsert){
|
||||
|
||||
openAddonMediaSelectDialog(title, onInsert, "image");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open addon image select dialog
|
||||
*/
|
||||
function openAddonAudioSelectDialog(title, onInsert){
|
||||
|
||||
openAddonMediaSelectDialog(title, onInsert, "audio");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convert url assets related to full url
|
||||
*/
|
||||
this.urlAssetsToFull = function(url){
|
||||
|
||||
if(!url)
|
||||
return(url);
|
||||
|
||||
|
||||
if(!g_dataProviderUC.urlSelectImagesBase)
|
||||
return(url);
|
||||
|
||||
var key = g_temp.keyUrlAssets;
|
||||
|
||||
if(url.indexOf(key) == -1)
|
||||
return(url);
|
||||
|
||||
url = url.replace(key, g_dataProviderUC.urlSelectImagesBase);
|
||||
|
||||
return(url);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set select images path
|
||||
*/
|
||||
this.setPathSelectImages = function(path, basePath, baseUrl){
|
||||
|
||||
if(basePath)
|
||||
g_dataProviderUC.pathSelectImagesBase = basePath;
|
||||
|
||||
if(baseUrl)
|
||||
g_dataProviderUC.urlSelectImagesBase = baseUrl;
|
||||
|
||||
if(path)
|
||||
g_dataProviderUC.pathSelectImages = path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set the parent - ucAdmin
|
||||
*/
|
||||
this.setParent = function(parent){
|
||||
g_parent = parent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open activation dialog
|
||||
*/
|
||||
function openActivateDialog(){
|
||||
|
||||
g_parent.openCommonDialog("uc_dialog_activate_catalog",function(){
|
||||
|
||||
jQuery("#uc_dialog_activate_catalog_text").focus();
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init activate
|
||||
*/
|
||||
function initActivateDialog(){
|
||||
|
||||
//--- top activate button
|
||||
|
||||
var objButtonActivate = jQuery("#uc_button_activate_catalog");
|
||||
|
||||
if(objButtonActivate.length == 0)
|
||||
return(false);
|
||||
|
||||
objButtonActivate.click(openActivateDialog);
|
||||
|
||||
//--- dialog activate button
|
||||
|
||||
jQuery("#uc_dialog_activate_catalog_action").click(function(){
|
||||
|
||||
var code = jQuery("#uc_dialog_activate_catalog_text").val();
|
||||
|
||||
var data = {
|
||||
code: code
|
||||
};
|
||||
|
||||
if(g_ucCatalogAddonType)
|
||||
data["addontype"] = g_ucCatalogAddonType;
|
||||
|
||||
g_parent.dialogAjaxRequest("uc_dialog_activate_catalog","activate_catalog_codecanyon",data);
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init the provider admin object
|
||||
*/
|
||||
this.init = function(){
|
||||
|
||||
initUpdatePlugin();
|
||||
|
||||
initMediaSelectDialog("image");
|
||||
initMediaSelectDialog("audio");
|
||||
|
||||
initActivateDialog();
|
||||
|
||||
}
|
||||
|
||||
function _______EDITORS_SETTING_____(){}
|
||||
|
||||
|
||||
/**
|
||||
* get first editor options
|
||||
*/
|
||||
function initEditor_tinyMCE_GetOptions(objEditorsOptions) {
|
||||
if (jQuery.isEmptyObject(objEditorsOptions))
|
||||
return {};
|
||||
|
||||
for (var key in objEditorsOptions) {
|
||||
var options = objEditorsOptions[key];
|
||||
|
||||
if (options !== null)
|
||||
return options;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* trigger change on editor, pass back
|
||||
*/
|
||||
function onEditorChange(editor, objSettings){
|
||||
|
||||
var objInput = editor.getElement();
|
||||
objInput = jQuery(objInput);
|
||||
objSettings.triggerKeyupEvent(objInput);
|
||||
}
|
||||
|
||||
/**
|
||||
* init tinymce editor
|
||||
*/
|
||||
function initEditor_tinyMCE(inputID, objSettings) {
|
||||
//init editor
|
||||
var options = initEditor_tinyMCE_GetOptions(window.tinyMCEPreInit.mceInit);
|
||||
|
||||
options = jQuery.extend({}, options, {
|
||||
resize: "vertical",
|
||||
height: 200,
|
||||
id: inputID,
|
||||
selector: "#" + inputID,
|
||||
});
|
||||
|
||||
options.setup = function (editor) {
|
||||
editor.on("Change", function () {
|
||||
onEditorChange(editor, objSettings);
|
||||
});
|
||||
|
||||
editor.on("keyup", function () {
|
||||
onEditorChange(editor, objSettings);
|
||||
});
|
||||
};
|
||||
|
||||
window.tinyMCEPreInit.mceInit[inputID] = options;
|
||||
|
||||
tinyMCE.init(options);
|
||||
|
||||
//init quicktags
|
||||
var optionsQT = initEditor_tinyMCE_GetOptions(window.tinyMCEPreInit.qtInit);
|
||||
|
||||
optionsQT = jQuery.extend({}, optionsQT, {
|
||||
id: inputID,
|
||||
});
|
||||
|
||||
window.tinyMCEPreInit.qtInit[inputID] = optionsQT;
|
||||
|
||||
quicktags(optionsQT);
|
||||
QTags._buttonsInit();
|
||||
|
||||
window.wpActiveEditor = inputID;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init editors - run function after timeout
|
||||
*/
|
||||
function initEditors_afterTimeout(objSettings, arrEditorNames, isForce) {
|
||||
if (typeof window.tinyMCEPreInit === "undefined" && arrEditorNames.length)
|
||||
throw new Error("Init " + arrEditorNames[0] + " editor error. no other editors found on page");
|
||||
|
||||
var idPrefix = objSettings.getIDPrefix();
|
||||
|
||||
jQuery(arrEditorNames).each(function (index, name) {
|
||||
var inputID = idPrefix + name;
|
||||
inputID = inputID.replace("#", "");
|
||||
|
||||
if (isForce === true
|
||||
|| window.tinyMCEPreInit.mceInit.hasOwnProperty(inputID) === false
|
||||
|| window.tinyMCEPreInit.mceInit[inputID] === null)
|
||||
initEditor_tinyMCE(inputID, objSettings);
|
||||
});
|
||||
}
|
||||
|
||||
function _______POST_TAXONOMY_____(){}
|
||||
|
||||
|
||||
/**
|
||||
* init taxonomy setting
|
||||
*/
|
||||
function initTaxonomyTypeSetting(selectPostType){
|
||||
|
||||
if(selectPostType.length == 0)
|
||||
return(false);
|
||||
|
||||
var objParent = selectPostType.parents(".unite_settings_wrapper");
|
||||
if(objParent.length == 0)
|
||||
objParent = selectPostType.parents(".wpb_edit_form_elements");
|
||||
|
||||
|
||||
if(objParent.length == 0)
|
||||
throw new Error("unable to find post list setting parent");
|
||||
|
||||
var selectPostTaxonomy = objParent.find(".unite-setting-post-taxonomy");
|
||||
|
||||
if(selectPostTaxonomy.length == 0)
|
||||
return(false);
|
||||
|
||||
var dataPostTypes = selectPostType.data("arrposttypes");
|
||||
|
||||
if(typeof dataPostTypes == "string"){
|
||||
dataPostTypes = g_parent.decodeContent(dataPostTypes);
|
||||
dataPostTypes = JSON.parse(dataPostTypes);
|
||||
}
|
||||
|
||||
selectPostType.change(function(){
|
||||
|
||||
var postType = selectPostType.val();
|
||||
var selectedTax = selectPostTaxonomy.val();
|
||||
var objTax = g_parent.getVal(dataPostTypes, postType);
|
||||
if(!objTax)
|
||||
return(true);
|
||||
|
||||
var objOptions = selectPostTaxonomy.find("option");
|
||||
var firstVisibleOption = null;
|
||||
|
||||
jQuery.each(objOptions, function(index, option){
|
||||
|
||||
var objOption = jQuery(option);
|
||||
var optionTax = objOption.prop("value");
|
||||
|
||||
var taxFound = objTax.hasOwnProperty(optionTax);
|
||||
|
||||
if(taxFound == true && firstVisibleOption == null)
|
||||
firstVisibleOption = optionTax;
|
||||
|
||||
if(taxFound == true)
|
||||
objOption.show();
|
||||
else
|
||||
objOption.hide();
|
||||
|
||||
});
|
||||
|
||||
var isCurrentTaxRelevant = objTax.hasOwnProperty(selectedTax);
|
||||
if(isCurrentTaxRelevant == false && firstVisibleOption){
|
||||
selectPostTaxonomy.val(firstVisibleOption);
|
||||
}
|
||||
|
||||
}); //end onchange
|
||||
|
||||
|
||||
selectPostType.trigger("change");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function _______POST_LIST_____(){}
|
||||
|
||||
|
||||
/**
|
||||
* init post lists
|
||||
*/
|
||||
function initPostTypeSetting(selectPostType){
|
||||
|
||||
if(selectPostType.length == 0)
|
||||
return(false);
|
||||
|
||||
var objParent = selectPostType.parents(".unite_settings_wrapper");
|
||||
if(objParent.length == 0)
|
||||
objParent = selectPostType.parents(".wpb_edit_form_elements");
|
||||
|
||||
if(objParent.length == 0)
|
||||
throw new Error("unable to find post list setting parent");
|
||||
|
||||
var selectPostCategory = objParent.find(".unite-setting-post-category");
|
||||
|
||||
if(selectPostCategory.length == 0)
|
||||
return(false);
|
||||
|
||||
var dataPostTypes = selectPostType.data("arrposttypes");
|
||||
if(typeof dataPostTypes == "string"){
|
||||
dataPostTypes = g_parent.decodeContent(dataPostTypes);
|
||||
dataPostTypes = JSON.parse(dataPostTypes);
|
||||
}
|
||||
|
||||
selectPostType.change(function(){
|
||||
|
||||
var arrPostTypes = selectPostType.val();
|
||||
|
||||
//force array always
|
||||
if(jQuery.isArray(arrPostTypes) == false)
|
||||
arrPostTypes = [arrPostTypes];
|
||||
|
||||
selectPostCategory.html("");
|
||||
|
||||
var selectedID = selectPostCategory.val();
|
||||
var isSomeCatSelected = false;
|
||||
var htmlOptions = "";
|
||||
|
||||
htmlOptions += "<option value=''>[All Categories]</option>"
|
||||
|
||||
for(var postType of arrPostTypes){
|
||||
|
||||
var objPostType = g_parent.getVal(dataPostTypes, postType);
|
||||
if(!objPostType)
|
||||
continue;
|
||||
|
||||
var objCats = objPostType["cats"];
|
||||
if(!objCats)
|
||||
continue;
|
||||
|
||||
jQuery.each(objCats, function(catID, catText){
|
||||
|
||||
var catShowText = g_parent.htmlspecialchars(catText);
|
||||
|
||||
var selected = "";
|
||||
if(selectedID == catID){
|
||||
selected = " selected='selected'";
|
||||
isSomeCatSelected = true;
|
||||
}
|
||||
|
||||
htmlOptions += "<option value='"+catID+"' "+selected+">"+catShowText+"</option>"
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
selectPostCategory.html(htmlOptions);
|
||||
|
||||
if(isSomeCatSelected == false)
|
||||
selectPostCategory.val("");
|
||||
|
||||
});
|
||||
|
||||
selectPostType.trigger("change");
|
||||
}
|
||||
|
||||
|
||||
function _______END_POST_LISTS_____(){}
|
||||
|
||||
/**
|
||||
* init editors, if the editors not inited, init them
|
||||
*/
|
||||
this.initEditors = function (objSettings, isForce) {
|
||||
var arrEditorNames = objSettings.getFieldNamesByType("editor_tinymce");
|
||||
|
||||
if (arrEditorNames.length === 0)
|
||||
return;
|
||||
|
||||
// init on the next tick to pick the input value
|
||||
setTimeout(function () {
|
||||
initEditors_afterTimeout(objSettings, arrEditorNames, isForce);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* destroy editors
|
||||
*/
|
||||
this.destroyEditors = function (objSettings) {
|
||||
var arrEditorNames = objSettings.getFieldNamesByType("editor_tinymce");
|
||||
|
||||
if (arrEditorNames.length === 0)
|
||||
return;
|
||||
|
||||
var idPrefix = objSettings.getIDPrefix();
|
||||
|
||||
jQuery.each(arrEditorNames, function (index, name) {
|
||||
var editorID = idPrefix + name;
|
||||
editorID = editorID.replace("#", "");
|
||||
|
||||
var objEditor = tinyMCE.EditorManager.get(editorID);
|
||||
|
||||
if (objEditor) {
|
||||
try {
|
||||
if (tinymce.majorVersion === "4")
|
||||
window.tinyMCE.execCommand("mceRemoveEditor", !0, editorID);
|
||||
else
|
||||
window.tinyMCE.execCommand("mceRemoveControl", !0, editorID);
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
|
||||
window.tinyMCEPreInit.mceInit[editorID] = null;
|
||||
window.tinyMCEPreInit.qtInit[editorID] = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,606 @@
|
||||
|
||||
if(typeof trace == "undefined"){
|
||||
function trace(str){
|
||||
console.log(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* general settings class
|
||||
*/
|
||||
function UCGeneralSettings(){
|
||||
var t = this;
|
||||
var g_currentManager;
|
||||
var g_objCurrentSettings = null, g_objSettingsWrapper;
|
||||
var g_objTooltip, g_options, g_objVCDialogChoose;
|
||||
|
||||
if(!g_ucAdmin)
|
||||
var g_ucAdmin = new UniteAdminUC();
|
||||
|
||||
|
||||
/**
|
||||
* encode some content
|
||||
*/
|
||||
function encodeContent(value){
|
||||
|
||||
//turn to string if object
|
||||
if(typeof value == "object")
|
||||
value = JSON.stringify(value);
|
||||
|
||||
return base64_encode(rawurlencode(value));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* decode some content
|
||||
*/
|
||||
function decodeContent(value){
|
||||
return rawurldecode(base64_decode(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* escape html
|
||||
*/
|
||||
function escapeHtml(text) {
|
||||
|
||||
if(!text)
|
||||
return(text);
|
||||
if(typeof text != "string")
|
||||
return(text);
|
||||
|
||||
return text
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* get vc option
|
||||
*/
|
||||
function getOption(option){
|
||||
|
||||
if(!g_options)
|
||||
return(null);
|
||||
|
||||
var value = g_ucAdmin.getVal(g_options, option);
|
||||
|
||||
return(value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* default parse setting function
|
||||
*/
|
||||
function parseVcSetting(param){
|
||||
|
||||
var settingName = param.name;
|
||||
var objSettingWrapper = g_objSettingsWrapper.find("#uc_vc_setting_wrapper_" + settingName);
|
||||
|
||||
if(objSettingWrapper.length == 0)
|
||||
throw new Error("the setting wrapper not found: "+settingName);
|
||||
|
||||
var objValues = g_objCurrentSettings.getSettingsValues(objSettingWrapper);
|
||||
|
||||
if(objValues.hasOwnProperty(settingName) == false)
|
||||
throw new Error("Value for setting: "+settingName+" not found");
|
||||
|
||||
var value = objValues[settingName];
|
||||
|
||||
switch(param.type){
|
||||
case "uc_textarea":
|
||||
case "uc_editor":
|
||||
value = encodeContent(value);
|
||||
break;
|
||||
default:
|
||||
value = escapeHtml(value);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return(value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init visual composer items
|
||||
*/
|
||||
this.initVCItems = function(){
|
||||
|
||||
g_currentManager = new UCManagerAdmin();
|
||||
g_currentManager.initManager();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init visual composer settings
|
||||
* the div init issome div inside the settings container
|
||||
*/
|
||||
this.initVCSettings = function(objDivInit){
|
||||
|
||||
//fix z-index of vc window for tinymce editor
|
||||
var objEditElement = jQuery("#vc_ui-panel-edit-element");
|
||||
if(objEditElement.length)
|
||||
objEditElement.css("z-index","60000");
|
||||
|
||||
|
||||
var objParent = objDivInit.parents(".vc_edit-form-tab");
|
||||
if(objParent.length == 0)
|
||||
objParent = objDivInit.parents(".wpb_edit_form_elements");
|
||||
|
||||
if(objParent.length == 0)
|
||||
throw new Error("settings container not found");
|
||||
|
||||
//set prefix
|
||||
var idPrefix = null;
|
||||
var objSettingsWrapper = objParent.find(".uc_vc_setting_wrapper:first-child");
|
||||
if(objSettingsWrapper.length)
|
||||
idPrefix = objSettingsWrapper.data("idprefix");
|
||||
|
||||
g_objSettingsWrapper = objParent;
|
||||
|
||||
g_objCurrentSettings = new UniteSettingsUC();
|
||||
g_objCurrentSettings.setIDPrefix(idPrefix);
|
||||
g_objCurrentSettings.init(g_objSettingsWrapper);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* open import layout dialog
|
||||
*/
|
||||
function openImportLayoutDialog(){
|
||||
|
||||
jQuery("#dialog_import_layouts_file").val("");
|
||||
|
||||
var options = {minWidth:700};
|
||||
|
||||
g_ucAdmin.openCommonDialog("#uc_dialog_import_layouts", null, options);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set post editor contnet
|
||||
*/
|
||||
function setPostEditorContent(text){
|
||||
|
||||
if(typeof tinymce == "undefined" )
|
||||
return(false);
|
||||
|
||||
var editor = tinymce.get( 'content' );
|
||||
if( editor && editor instanceof tinymce.Editor ) {
|
||||
editor.setContent( text );
|
||||
editor.save( { no_events: true } );
|
||||
}
|
||||
else {
|
||||
jQuery('textarea#content').val( text );
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set visual composer content to the editor
|
||||
*/
|
||||
function setVCContent(content){
|
||||
|
||||
if(typeof window.vc.storage == "undefined")
|
||||
return(false);
|
||||
|
||||
vc.storage.setContent(content);
|
||||
if(vc.app.status == "shown")
|
||||
vc.app.show();
|
||||
else
|
||||
vc.app.switchComposer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* destroy settings if available
|
||||
*/
|
||||
function checkDestroySettings(){
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
if(g_objCurrentSettings){
|
||||
g_objCurrentSettings.destroy();
|
||||
g_objCurrentSettings = null;
|
||||
}
|
||||
|
||||
if(g_currentManager){
|
||||
|
||||
g_currentManager.destroy();
|
||||
|
||||
}
|
||||
|
||||
},200);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function _______INIT_____(){}
|
||||
|
||||
|
||||
/**
|
||||
* init visual composer attributes
|
||||
*/
|
||||
function initVCAtts(){
|
||||
|
||||
var objParse = {parse:parseVcSetting};
|
||||
|
||||
//text field
|
||||
vc.atts.uc_textfield = objParse;
|
||||
vc.atts.uc_number = objParse;
|
||||
vc.atts.uc_textarea = objParse;
|
||||
vc.atts.uc_radioboolean = objParse;
|
||||
vc.atts.uc_checkbox = objParse;
|
||||
vc.atts.uc_dropdown = objParse;
|
||||
vc.atts.uc_colorpicker = objParse;
|
||||
vc.atts.uc_image = objParse;
|
||||
vc.atts.uc_mp3 = objParse;
|
||||
vc.atts.uc_editor = objParse;
|
||||
vc.atts.uc_icon = objParse;
|
||||
|
||||
|
||||
//items
|
||||
vc.atts.uc_items = {
|
||||
parse:function(param){
|
||||
if(!g_currentManager)
|
||||
return("");
|
||||
|
||||
var itemsData = g_currentManager.getItemsDataJson();
|
||||
|
||||
itemsData = encodeContent(itemsData);
|
||||
|
||||
return(itemsData);
|
||||
}
|
||||
};
|
||||
|
||||
//fonts
|
||||
vc.atts.uc_fonts = {
|
||||
parse:function(param){
|
||||
|
||||
return(fontsData);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init post title
|
||||
*/
|
||||
function initPostTitle(objButton){
|
||||
var initPostTitle = objButton.data("init_post_title");
|
||||
if(!initPostTitle )
|
||||
return(false);
|
||||
|
||||
var inputTitle = jQuery("#title").val();
|
||||
if(!inputTitle)
|
||||
jQuery("#title").val(initPostTitle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* import vc layouts
|
||||
*/
|
||||
function initImportVcLayout(){
|
||||
|
||||
var objButton = jQuery("#uc_button_import_layout");
|
||||
|
||||
initPostTitle(objButton);
|
||||
|
||||
g_ucAdmin.enableButton(objButton);
|
||||
|
||||
if(objButton.length == 0)
|
||||
return(false);
|
||||
|
||||
objButton.click(openImportLayoutDialog);
|
||||
|
||||
jQuery("#uc_dialog_import_layouts_action").click(function(){
|
||||
|
||||
var data = {};
|
||||
|
||||
var isOverwrite = jQuery("#dialog_import_layouts_file_overwrite").is(":checked");
|
||||
|
||||
//set postID if available
|
||||
var objPostID = jQuery("#post_ID");
|
||||
var postID = null;
|
||||
if(objPostID.length)
|
||||
postID = objPostID.val();
|
||||
|
||||
data.postid = postID;
|
||||
data.title = jQuery("#title").val();
|
||||
data.overwrite_addons = isOverwrite;
|
||||
|
||||
var objData = new FormData();
|
||||
var jsonData = JSON.stringify(data);
|
||||
objData.append("data", jsonData);
|
||||
|
||||
g_ucAdmin.addFormFilesToData("dialog_import_layouts_form", objData);
|
||||
|
||||
g_ucAdmin.dialogAjaxRequest("uc_dialog_import_layouts", "import_vc_layout", objData,function(response){
|
||||
|
||||
jQuery("#uc_dialog_import_layouts_success").show();
|
||||
|
||||
if(response.url_reload){
|
||||
var url = response.url_reload;
|
||||
url = g_ucAdmin.convertAmpSign(url);
|
||||
location.href = url;
|
||||
}else{
|
||||
setVCContent(response.content);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* catch vc elements panel close action and destroy settings if exists
|
||||
*/
|
||||
function initSettingsDestroy(){
|
||||
|
||||
var isFrontEditor = getOption("is_front_editor");
|
||||
|
||||
var objEditElement = jQuery("#vc_ui-panel-edit-element");
|
||||
var objButtons = objEditElement.find(".vc_ui-panel-footer .vc_ui-button");
|
||||
|
||||
if(isFrontEditor === true){ //on front editor take only cancel button
|
||||
|
||||
var objCloseButton = objButtons.filter('[data-vc-ui-element="button-close"]');
|
||||
objCloseButton.click(checkDestroySettings);
|
||||
|
||||
}else{
|
||||
objButtons.click(checkDestroySettings);
|
||||
}
|
||||
|
||||
var objTopButton = objEditElement.find(".vc_ui-panel-header-controls .vc_ui-close-button");
|
||||
objTopButton.click(checkDestroySettings);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* init settings destroy
|
||||
*/
|
||||
function initVCIntegration(){
|
||||
|
||||
g_objVCDialogChoose = jQuery("#vc_ui-panel-add-element");
|
||||
|
||||
g_currentManager = null;
|
||||
|
||||
initVCAtts();
|
||||
|
||||
//init options
|
||||
if(g_ucVCOptions)
|
||||
g_options = JSON.parse(g_ucVCOptions);
|
||||
|
||||
initSettingsDestroy();
|
||||
|
||||
initImportVcLayout();
|
||||
|
||||
initThumbPresentation();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function _______TOOLTIPS_THUMBS____(){}
|
||||
|
||||
|
||||
/**
|
||||
* get preview image by addon id
|
||||
*/
|
||||
function getPreviewImage(addonID){
|
||||
|
||||
var obj = g_ucAdmin.getVal(vc_mapper, addonID);
|
||||
if(!obj)
|
||||
return(null);
|
||||
|
||||
var urlPreview = g_ucAdmin.getVal(obj, "preview");
|
||||
|
||||
if(!urlPreview)
|
||||
return(null);
|
||||
|
||||
return(urlPreview);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init vc thumbs
|
||||
*/
|
||||
function initTooltips(categoryAllOnly){
|
||||
|
||||
if(!vc_mapper)
|
||||
return(false);
|
||||
|
||||
if(g_objTooltip)
|
||||
return(false);
|
||||
|
||||
//create tooltip
|
||||
var html = '<div id="uc_manager_addon_preview" class="uc-vcaddon-preview-wrapper" style="display:none"></div>';
|
||||
jQuery("body").append(html);
|
||||
|
||||
g_objTooltip = jQuery("#uc_manager_addon_preview");
|
||||
|
||||
jQuery("body").on("mouseenter",".vc_shortcode-link.uc-addon_nav", function(){
|
||||
|
||||
var objAddonNav = jQuery(this);
|
||||
|
||||
if(categoryAllOnly === true){
|
||||
var objParentAll = objAddonNav.parents(".vc_filter-all");
|
||||
if(objParentAll.length == 0)
|
||||
return(false);
|
||||
}
|
||||
|
||||
var addonID = objAddonNav.attr("id");
|
||||
|
||||
var urlPreview = getPreviewImage(addonID);
|
||||
|
||||
if(!urlPreview)
|
||||
return(false);
|
||||
|
||||
checkShowTooltip(objAddonNav, urlPreview);
|
||||
|
||||
});
|
||||
|
||||
jQuery("body").on("mouseleave",".vc_shortcode-link.uc-addon_nav",function(){
|
||||
g_objTooltip.hide();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get nav item pos
|
||||
*/
|
||||
function getNavItemPos(objItem){
|
||||
|
||||
var offset = objItem.offset();
|
||||
|
||||
//var offsetWrapper = g_objWrapper.offset();
|
||||
//offset.top -= offsetWrapper.top;
|
||||
//offset.left -= offsetWrapper.left;
|
||||
|
||||
return(offset);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* check if the item has tooltip
|
||||
*/
|
||||
function checkShowTooltip(objItem, urlPreview){
|
||||
|
||||
if(!g_objTooltip)
|
||||
return(false);
|
||||
|
||||
if(!urlPreview)
|
||||
return(false);
|
||||
|
||||
//show tooltip
|
||||
g_objTooltip.show();
|
||||
|
||||
var gapTop = 0;
|
||||
var gapLeft = 10;
|
||||
|
||||
var itemWidth = objItem.width();
|
||||
var tooltipHeight = g_objTooltip.height();
|
||||
var tooltipWidth = g_objTooltip.width();
|
||||
|
||||
//var maxLeft = g_objWrapper.width() - tooltipWidth;
|
||||
|
||||
var pos = getNavItemPos(objItem);
|
||||
pos.top = pos.top - tooltipHeight + gapTop;
|
||||
pos.left = pos.left + itemWidth - gapLeft;
|
||||
|
||||
//if(pos.left > maxLeft)
|
||||
//pos.left = maxLeft;
|
||||
|
||||
//set position and image
|
||||
|
||||
var objCss = {top:pos.top+"px",left:pos.left+"px"};
|
||||
objCss["background-image"] = "url('"+urlPreview+"')";
|
||||
|
||||
g_objTooltip.css(objCss);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init thumbs presentation
|
||||
*/
|
||||
function initThumbs(){
|
||||
|
||||
g_objVCDialogChoose.addClass("uc-vc-dialog-thumbs");
|
||||
|
||||
//add thumbs
|
||||
g_objVCDialogChoose.find(".uc-addon_nav").each(function(index, item){
|
||||
|
||||
var objItem = jQuery(item);
|
||||
var addonID = objItem.attr("id");
|
||||
var urlPreview = getPreviewImage(addonID);
|
||||
|
||||
var style = "";
|
||||
if(urlPreview)
|
||||
style = "style=\"background-image:url('"+urlPreview+"')\"";
|
||||
|
||||
var spanTitle = objItem.find("span");
|
||||
if(spanTitle.length){
|
||||
|
||||
objItem.prepend("<div "+style+"></div>");
|
||||
|
||||
}else{ //replace text by thumb
|
||||
|
||||
var text = objItem.text();
|
||||
var html = objItem.html();
|
||||
|
||||
html = html.replace(text, "<div "+style+"></div><span>"+text+"</span>");
|
||||
|
||||
objItem.html(html);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init thumbs presentation in vc select addon dialog
|
||||
*/
|
||||
function initThumbPresentation(){
|
||||
|
||||
if(!g_objVCDialogChoose || g_objVCDialogChoose.length == 0)
|
||||
return(false);
|
||||
|
||||
//init tooltips
|
||||
var tooltipsType = getOption("thumbs_type");
|
||||
|
||||
switch(tooltipsType){
|
||||
case "tooltip":
|
||||
initTooltips();
|
||||
break;
|
||||
case "thumb":
|
||||
initThumbs();
|
||||
initTooltips(true);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* global init function
|
||||
*/
|
||||
this.init = function(){
|
||||
|
||||
//init vc attrs
|
||||
if(typeof vc != "undefined" && vc.atts){
|
||||
initVCIntegration();
|
||||
}
|
||||
|
||||
//trace(objEditElement);
|
||||
//trace(window.Vc_postSettingsEditor);
|
||||
//trace(window.vc);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var g_ucObjGeneralSettings = new UCGeneralSettings();
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
g_ucObjGeneralSettings.init();
|
||||
|
||||
});
|
||||
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Addon Creator for Blox
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2017 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
|
||||
class AddonLibraryCreatorPluginUC extends UniteCreatorPluginBase{
|
||||
|
||||
protected $extraInitParams = array();
|
||||
|
||||
private $version = "1.0.3";
|
||||
private $pluginName = "create_addons";
|
||||
private $title = "Addon Creator for Blox";
|
||||
private $description = "Give the ability to create, duplicate and export custom addons";
|
||||
private $objAddonType, $addonType, $textSingle, $textPlural;
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$pathPlugin = dirname(__FILE__)."/";
|
||||
|
||||
parent::__construct($pathPlugin);
|
||||
|
||||
$this->extraInitParams["silent_mode"] = true;
|
||||
|
||||
$this->textSingle = "Addon";
|
||||
$this->textPlural = "Addons";
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add menu items to manager single menu
|
||||
*/
|
||||
public function addItems_managerMenuSingle($arrMenu){
|
||||
|
||||
$arrNewItems = array();
|
||||
$arrNewItems[] = array("key"=>"duplicate_item",
|
||||
"text"=>esc_html__("Duplicate","unlimited-elements-for-elementor"),
|
||||
"insert_after"=>"remove_item");
|
||||
|
||||
$arrNewItems[] = array("key"=>"export_addon",
|
||||
"text"=>esc_html__("Export ","unlimited-elements-for-elementor").$this->textSingle,
|
||||
"insert_after"=>"test_addon_blank");
|
||||
|
||||
$arrMenu = UniteFunctionsUC::insertToAssocArray($arrMenu, $arrNewItems);
|
||||
|
||||
|
||||
return($arrMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* add menu items to manager single menu
|
||||
*/
|
||||
public function addItems_managerMenuMultiple($arrMenu){
|
||||
|
||||
$arrNewItems = array();
|
||||
$arrNewItems[] = array("key"=>"duplicate_item",
|
||||
"text"=>esc_html__("Duplicate","unlimited-elements-for-elementor"),
|
||||
"insert_after"=>"bottom");
|
||||
|
||||
$arrMenu = UniteFunctionsUC::insertToAssocArray($arrMenu, $arrNewItems);
|
||||
|
||||
|
||||
return($arrMenu);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add items to menu field
|
||||
*/
|
||||
public function addItems_managerMenuField($arrMenu){
|
||||
|
||||
$arrNewItems[] = array("key"=>"add_addon",
|
||||
"text"=>esc_html__("Add Widget","unlimited-elements-for-elementor"),
|
||||
"insert_after"=>"top");
|
||||
|
||||
$arrMenu = UniteFunctionsUC::insertToAssocArray($arrMenu, $arrNewItems);
|
||||
|
||||
return($arrMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* add items to menu field
|
||||
*/
|
||||
public function addItems_managerMenuCategory($arrMenu){
|
||||
|
||||
$arrNewItems[] = array("key"=>"export_cat_addons",
|
||||
"text"=>esc_html__("Export Category ","unlimited-elements-for-elementor").$this->textPlural,
|
||||
"insert_after"=>"bottom");
|
||||
|
||||
$arrMenu = UniteFunctionsUC::insertToAssocArray($arrMenu, $arrNewItems);
|
||||
|
||||
return($arrMenu);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* draw item buttons 1
|
||||
*/
|
||||
public function drawItemButtons2(){
|
||||
?>
|
||||
|
||||
<a data-action="duplicate_item" type="button" class="unite-button-secondary button-disabled uc-button-item"><?php esc_html_e("Duplicate","unlimited-elements-for-elementor")?></a>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* draw item buttons 1
|
||||
*/
|
||||
public function drawItemButtons3(){
|
||||
|
||||
$textExport = esc_html__("Export ", "unlimited-elements-for-elementor").$this->textSingle;
|
||||
|
||||
?>
|
||||
|
||||
<a data-action="export_addon" type="button" class="unite-button-secondary button-disabled uc-button-item uc-single-item"><?php echo UniteProviderFunctionsUC::escAddParam($textExport)?></a>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* edit globals
|
||||
*/
|
||||
public function editGlobals(){
|
||||
|
||||
GlobalsUC::$permisison_add = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* on manager init
|
||||
*/
|
||||
public function onManagerInit($objManager){
|
||||
|
||||
$this->objAddonType = $objManager->getObjAddonType();
|
||||
|
||||
$this->addonType = $this->objAddonType->typeName;
|
||||
|
||||
$this->textSingle = $this->objAddonType->textSingle;
|
||||
$this->textPlural = $this->objAddonType->textPlural;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init the plugin
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
|
||||
$this->register($this->pluginName, $this->title, $this->version, $this->description, $this->extraInitParams);
|
||||
|
||||
$this->addAction(self::ACTION_MODIFY_ADDONS_MANAGER, "onManagerInit");
|
||||
|
||||
$this->addFilter(self::FILTER_MANAGER_MENU_SINGLE, "addItems_managerMenuSingle");
|
||||
$this->addFilter(self::FILTER_MANAGER_MENU_MULTIPLE, "addItems_managerMenuMultiple");
|
||||
$this->addFilter(self::FILTER_MANAGER_MENU_FIELD, "addItems_managerMenuField");
|
||||
$this->addFilter(self::FILTER_MANAGER_MENU_CATEGORY, "addItems_managerMenuCategory");
|
||||
|
||||
$this->addAction(self::ACTION_MANAGER_ITEM_BUTTONS2, "drawItemButtons2");
|
||||
$this->addAction(self::ACTION_MANAGER_ITEM_BUTTONS3, "drawItemButtons3");
|
||||
|
||||
|
||||
$this->addAction(self::ACTION_EDIT_GLOBALS, "editGlobals");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//run the plugin
|
||||
|
||||
$filepathProvider = dirname(__FILE__)."/../plugin_provider.php";
|
||||
if(file_exists($filepathProvider)){
|
||||
|
||||
require $filepathProvider;
|
||||
new AddonLibraryCreatorPluginProviderUC();
|
||||
|
||||
}else{
|
||||
$objPlugin = new AddonLibraryCreatorPluginUC();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author unlimited-elements.com
|
||||
* @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
|
||||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* */
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UniteCreatorAddonType_Elementor extends UniteCreatorAddonType{
|
||||
|
||||
|
||||
/**
|
||||
* init the addon type
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
parent::init();
|
||||
|
||||
$this->typeName = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR;
|
||||
$this->isBasicType = false;
|
||||
|
||||
$this->allowWebCatalog = true;
|
||||
$this->allowManagerWebCatalog = true;
|
||||
$this->catalogKey = "addons";
|
||||
$this->arrCatalogExcludeCats = array("basic");
|
||||
|
||||
$this->textPlural = __("Widgets", "unlimited-elements-for-elementor");
|
||||
$this->textSingle = __("Widget", "unlimited-elements-for-elementor");
|
||||
$this->textShowType = __("Elementor Widget", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->browser_textBuy = esc_html__("Go Pro", "unlimited-elements-for-elementor");
|
||||
$this->browser_textHoverPro = __("Upgrade to PRO version <br> to use this widget", "unlimited-elements-for-elementor");
|
||||
$this->browser_urlPreview = "https://unlimited-elements.com/widget-preview/?widget=[name]";
|
||||
|
||||
$urlLicense = "https://unlimited-elements.com/pricing/";
|
||||
|
||||
$urlBuyInsidePlugin = admin_url("admin.php?".GlobalsUnlimitedElements::SLUG_BUY_BROWSER);
|
||||
|
||||
$this->browser_urlBuyPro = $urlBuyInsidePlugin;
|
||||
|
||||
$responseAssets = UniteProviderFunctionsUC::setAssetsPath("ac_assets", true);
|
||||
|
||||
$this->pathAssets = UniteFunctionsUC::getVal($responseAssets, "path_assets");
|
||||
$this->urlAssets = UniteFunctionsUC::getVal($responseAssets, "url_assets");
|
||||
|
||||
$this->addonView_urlBack = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_ADDONS_ELEMENTOR);
|
||||
$this->addonView_showSmallIconOption = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author unlimited-elements.com
|
||||
* @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
|
||||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* */
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UniteCreatorAddonType_Elementor_Template extends UniteCreatorAddonType_Layout{
|
||||
|
||||
|
||||
/**
|
||||
* init the addon type
|
||||
*/
|
||||
protected function initChild(){
|
||||
|
||||
parent::initChild();
|
||||
|
||||
$this->typeName = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR_TEMPLATE;
|
||||
|
||||
$this->isBasicType = false;
|
||||
$this->layoutTypeForCategory = $this->typeName;
|
||||
$this->displayType = self::DISPLAYTYPE_MANAGER;
|
||||
|
||||
$this->allowDuplicateTitle = false;
|
||||
$this->defaultBlankTemplate = false;
|
||||
|
||||
$this->allowWebCatalog = true;
|
||||
$this->allowManagerWebCatalog = true;
|
||||
$this->allowManagerLocalLayouts = false;
|
||||
|
||||
$this->showDescriptionField = false;
|
||||
|
||||
$this->allowNoCategory = false;
|
||||
$this->defaultCatTitle = __("Main", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->postType = GlobalsUnlimitedElements::POSTTYPE_UNLIMITED_ELEMENS_LIBRARY;
|
||||
$this->isBloxPage = false;
|
||||
|
||||
$this->catalogKey = "elementor_template";
|
||||
|
||||
//$this->arrCatalogExcludeCats = array("basic");
|
||||
|
||||
$this->textPlural = __("Templates", "unlimited-elements-for-elementor");
|
||||
$this->textSingle = __("Template", "unlimited-elements-for-elementor");
|
||||
$this->textShowType = __("Elementor Template", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->browser_textBuy = esc_html__("Activate Plugin", "unlimited-elements-for-elementor");
|
||||
$this->browser_textHoverPro = __("This template is available<br>when the plugin is activated.", "unlimited-elements-for-elementor");
|
||||
|
||||
$urlLicense = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR);
|
||||
$this->browser_urlBuyPro = $urlLicense;
|
||||
|
||||
$responseAssets = UniteProviderFunctionsUC::setAssetsPath("ac_assets", true);
|
||||
|
||||
$this->pathAssets = UniteFunctionsUC::getVal($responseAssets, "path_assets");
|
||||
$this->urlAssets = UniteFunctionsUC::getVal($responseAssets, "url_assets");
|
||||
|
||||
$this->addonView_urlBack = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_TEMPLATES_ELEMENTOR);
|
||||
|
||||
$this->hasParents = true;
|
||||
|
||||
$this->isWebCatalogMode = true;
|
||||
$this->allowNoCategory = true;
|
||||
|
||||
UniteProviderFunctionsUC::doAction("uc_init_elementor_template_addontype", $this);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init by master plugin
|
||||
*/
|
||||
public function initByMaster(){
|
||||
|
||||
$this->allowWebCatalog = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
function UniteCreatorElementorTemplateLibraryAdmin(){
|
||||
|
||||
var t = this;
|
||||
|
||||
|
||||
/**
|
||||
* put import button
|
||||
*/
|
||||
function putImportButton(){
|
||||
|
||||
var objButton = jQuery("#uc_button_import_layout");
|
||||
objButton.remove();
|
||||
|
||||
var objButtonCloned = objButton.clone();
|
||||
|
||||
var objAdminBarButtonsNew = jQuery(".e-admin-top-bar__main-area-buttons");
|
||||
|
||||
if(objAdminBarButtonsNew.length){
|
||||
|
||||
objAdminBarButtonsNew.append(objButtonCloned);
|
||||
|
||||
}else{
|
||||
var objHeaderEnd = jQuery(".wp-header-end");
|
||||
objHeaderEnd.before(objButtonCloned);
|
||||
}
|
||||
|
||||
|
||||
//set event
|
||||
objButtonCloned.click(onToggleButtonClick);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put import area
|
||||
*/
|
||||
function putImportArea(){
|
||||
|
||||
var objAnchor = jQuery("h1.wp-heading-inline");
|
||||
var objForm = jQuery("#uc_import_layout_area");
|
||||
var objFormClone = objForm.clone();
|
||||
|
||||
objAnchor.after(objFormClone);
|
||||
}
|
||||
|
||||
/**
|
||||
* toggle import area
|
||||
*/
|
||||
function onToggleButtonClick(){
|
||||
|
||||
jQuery("#uc_import_layout_area").toggle();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init integration
|
||||
*/
|
||||
this.init = function(){
|
||||
|
||||
setTimeout(putImportButton, 500);
|
||||
|
||||
putImportArea();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
var objAdmin = new UniteCreatorElementorTemplateLibraryAdmin();
|
||||
|
||||
objAdmin.init();
|
||||
});
|
||||
@@ -0,0 +1,175 @@
|
||||
@CHARSET "ISO-8859-1";
|
||||
|
||||
|
||||
.elementor-panel .uc-notip:after{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.elementor-panel .uc-button-edit-html{
|
||||
margin-top:5px;
|
||||
}
|
||||
|
||||
.elementor-panel .uc-elementor-control-disabled input[type='text']{
|
||||
background-color:#f9f9f9;
|
||||
color:#928D8C;
|
||||
}
|
||||
|
||||
.elementor-panel .unite-setting-post-type{
|
||||
height:70px;
|
||||
min-width:135px !important;
|
||||
}
|
||||
|
||||
|
||||
/* --- icons --- */
|
||||
|
||||
.elementor-panel .uc-default-widget-icon::after{
|
||||
background-image:url('../images/widget-icon.svg');
|
||||
}
|
||||
|
||||
.elementor-panel .ue-widget-icon{
|
||||
min-width:40px;
|
||||
min-height:23px;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.elementor-panel .ue-widget-icon::after{
|
||||
xcontent:"UE";
|
||||
content:url(../images/logo-mini.svg);
|
||||
opacity:0.5;
|
||||
position:absolute;
|
||||
top:4px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
font-size:10px;
|
||||
color:#3451A0;
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
box-sizing:border-box;
|
||||
text-align:right;
|
||||
padding-right:4px;
|
||||
}
|
||||
|
||||
.elementor-panel .ue-widget-icon.ue-dark-mode::after{
|
||||
filter: brightness(4) invert(100%);
|
||||
content:url(../images/logo-mini-dark.svg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.elementor-panel .ue-wi-svg::after{
|
||||
height:44px;
|
||||
background-size:auto 34px;
|
||||
background-position:center bottom;
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
|
||||
.elementor-panel .ue-wi-svg::before{
|
||||
opacity:0;
|
||||
}
|
||||
|
||||
.elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.uc-wi-preview::after{
|
||||
content:"";
|
||||
display:block;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
background-color:#ffffff;
|
||||
z-index:10;
|
||||
|
||||
font-size:11px;
|
||||
font-weight:normal;
|
||||
font-style:normal;
|
||||
padding-top:70px;
|
||||
|
||||
line-height:14px;
|
||||
text-align:center;
|
||||
|
||||
box-shadow: inset 0 -22px 6px -6px rgba(255, 255, 255, 1);
|
||||
|
||||
background-position:center 2px;
|
||||
background-size:contain;
|
||||
background-repeat:no-repeat;
|
||||
|
||||
font-family:Roboto, Arial, Helvetica, Verdana, sans-serif;
|
||||
|
||||
color:inherit;
|
||||
|
||||
overflow:hidden;
|
||||
filter:none;
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
.elementor-panel .elementor-element-wrapper:hover .ue-widget-icon.ue-dark-mode.uc-wi-preview::after{
|
||||
background-color:#404349;
|
||||
box-shadow: inset 0 -22px 6px -6px rgba(64, 67, 73, 0.9);
|
||||
}
|
||||
|
||||
.elementor-panel .uc-panel-ajax-loader{
|
||||
display:inline-block;
|
||||
background-image:url(../images/loader.gif);
|
||||
background-repeat:no-repeat;
|
||||
background-position:left center;
|
||||
padding-left:22px;
|
||||
direction:ltr;
|
||||
line-height:1.5em;
|
||||
font-size:11px;
|
||||
padding-top:3px;
|
||||
padding-bottom:3px;
|
||||
|
||||
}
|
||||
|
||||
/* button edit post */
|
||||
.elementor-panel .uc-button-edit-wrapper{
|
||||
padding-top:5px;
|
||||
padding-right:5px;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.elementor-panel .uc-button-edit-wrapper a{
|
||||
font-size:11px !important;
|
||||
font-weight:normal !important;
|
||||
color:#6d7882 !important;
|
||||
}
|
||||
|
||||
.elementor-panel .uc-button-edit-wrapper a:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
.elementor-panel .uc-notification-control{
|
||||
background-color:#fef8ee;
|
||||
border-left:2px solid #f0b848;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
.uc-notification-control.uc-dark-mode{
|
||||
color:#ffffff;
|
||||
background-color:#393e44;
|
||||
border-left:2px solid #d5c5a6;
|
||||
|
||||
}
|
||||
|
||||
.uc-notification-control.uc-dark-mode a{
|
||||
color:#ffffff;
|
||||
}
|
||||
|
||||
.uc-notification-control.uc-dark-mode a:hover{
|
||||
color:blue;
|
||||
}
|
||||
|
||||
.uc-edit-template-button{
|
||||
position:relative;
|
||||
padding-top:5px;
|
||||
}
|
||||
|
||||
.uc-edit-template-button__link{
|
||||
position:absolute;
|
||||
top:-7px;
|
||||
right:0px;
|
||||
font-size:12px;
|
||||
font-weight:normal !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
@CHARSET "ISO-8859-1";
|
||||
|
||||
.unlimited-elements-background-overlay{
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
z-index:0;
|
||||
}
|
||||
|
||||
.unlimited-elements-background-overlay.uc-bg-front{
|
||||
z-index:999;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
|
||||
window.g_ueSettingsAPI = null;
|
||||
|
||||
function UnlimitedElementsWidgetSettingsAPI(){
|
||||
|
||||
var g_id, g_frontAPI;
|
||||
|
||||
function trace(str){
|
||||
console.log(str);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* on event
|
||||
*/
|
||||
this.on = function(name, func){
|
||||
|
||||
if(typeof func !== "function")
|
||||
throw new Error("settings api error - second parameter of event: "+name+"should be a function");
|
||||
|
||||
g_frontAPI.onEvent(name, function(event, data){
|
||||
|
||||
if(!data)
|
||||
return(false);
|
||||
|
||||
var model = data.model;
|
||||
|
||||
if(!model)
|
||||
return(false);
|
||||
|
||||
if(model.id != g_id)
|
||||
return(false);
|
||||
|
||||
var attributes = model.settings.attributes;
|
||||
|
||||
//run the event function
|
||||
func(attributes);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init the api
|
||||
*/
|
||||
this.init = function(objWidget){
|
||||
|
||||
if(!objWidget || objWidget.length == 0)
|
||||
return(false);
|
||||
|
||||
var objParent = objWidget.parents(".elementor-element.elementor-element-edit-mode");
|
||||
|
||||
if(objParent.length == 0)
|
||||
throw new Error("settings api error - parent element not found");
|
||||
|
||||
var elementType = objParent.data("element_type");
|
||||
|
||||
g_id = objParent.data("id");
|
||||
|
||||
if(elementType != "widget")
|
||||
throw new Error("settings api error - wrong element type");
|
||||
|
||||
if(!window.g_ueSettingsAPI)
|
||||
throw new Error("settings api error - main api not inited");
|
||||
|
||||
g_frontAPI = window.g_ueSettingsAPI;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get editor api by id
|
||||
*/
|
||||
function ueGetEditorSettingsAPI(widgetID){
|
||||
|
||||
var objWidget = jQuery("#"+widgetID);
|
||||
|
||||
if(objWidget.length == 0)
|
||||
throw new Error("settings api error, no widget found by id: "+widgetID);
|
||||
|
||||
var objWidgetAPI = new UnlimitedElementsWidgetSettingsAPI();
|
||||
|
||||
objWidgetAPI.init(objWidget);
|
||||
|
||||
return(objWidgetAPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ucDocReady(fn) {
|
||||
// see if DOM is already available
|
||||
if (document.readyState === "complete" || document.readyState === "interactive") {
|
||||
// call on next available tick
|
||||
setTimeout(fn, 1);
|
||||
} else {
|
||||
document.addEventListener("DOMContentLoaded", fn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ucDocReady(function(){
|
||||
|
||||
window.parent.g_objUCElementorEditorAdmin.initFrontEndInteraction(window, elementorFrontend);
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Scheme_Color;
|
||||
|
||||
class ElementorWidgetTest extends Widget_Base {
|
||||
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-posts-ticker';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return array('general-elements');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* register controls
|
||||
*/
|
||||
protected function register_controls() {
|
||||
|
||||
$this->start_controls_section(
|
||||
'section_content', array(
|
||||
'label' => __('Content', 'hello-world'),
|
||||
)
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'title', array(
|
||||
'label' => __('Title', 'hello-world'),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
)
|
||||
);
|
||||
|
||||
$this->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Controls_Manager::TEXT
|
||||
Controls_Manager::NUMBER
|
||||
Controls_Manager::ANIMATION
|
||||
Controls_Manager::BOX_SHADOW
|
||||
Controls_Manager::BUTTON
|
||||
Controls_Manager::CHOOSE
|
||||
Controls_Manager::SWITCHER
|
||||
Controls_Manager::CODE
|
||||
Controls_Manager::DATE_TIME
|
||||
Controls_Manager::DIMENSIONS
|
||||
Controls_Manager::DIVIDER
|
||||
Controls_Manager::FONT
|
||||
Controls_Manager::GALLERY
|
||||
Controls_Manager::HEADING
|
||||
Controls_Manager::HIDDEN
|
||||
Controls_Manager::HOVER_ANIMATION
|
||||
Controls_Manager::ICON
|
||||
Controls_Manager::IMAGE_DIMENSIONS
|
||||
Controls_Manager::MEDIA
|
||||
Controls_Manager::TEXT_SHADOW
|
||||
Controls_Manager::TEXTAREA
|
||||
Controls_Manager::URL
|
||||
Controls_Manager::TABS
|
||||
Controls_Manager::RAW_HTML
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Control_UC_AUDIO extends Base_Data_Control {
|
||||
|
||||
/**
|
||||
* Retrieve code control type.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Control type.
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'uc_mp3';
|
||||
}
|
||||
|
||||
/**
|
||||
* get hr default settings
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* get content template
|
||||
*/
|
||||
public function content_template() {
|
||||
$control_uid = $this->get_control_uid();
|
||||
?>
|
||||
<div class="elementor-control-field uc-control-field-audio">
|
||||
<label for="<?php echo esc_attr($control_uid); ?>" class="elementor-control-title">{{{ data.label }}}</label>
|
||||
<div class="elementor-control-input-wrapper">
|
||||
<input id="<?php echo esc_attr($control_uid); ?>" type="text" class="tooltip-target" data-tooltip="{{ data.title }}" title="{{ data.title }}" data-setting="{{ data.name }}" placeholder="{{ data.placeholder }}" />
|
||||
<input type="button" class="uc-button-choose-audio uc-button-control" value="<?php esc_html_e("Choose Audio","unlimited-elements-for-elementor")?>">
|
||||
<div class='uc-audio-control-text'></div>
|
||||
</div>
|
||||
</div>
|
||||
<# if ( data.description ) { #>
|
||||
<div class="elementor-control-field-description">{{{ data.description }}}</div>
|
||||
<# } #>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor select control.
|
||||
*
|
||||
* A base control for creating select control. Displays a simple select box.
|
||||
* It accepts an array in which the `key` is the option value and the `value` is
|
||||
* the option name.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Control_UC_CustomCode extends Base_Data_Control {
|
||||
|
||||
/**
|
||||
* Get select control type.
|
||||
*
|
||||
* Retrieve the control type, in this case `select`.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Control type.
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'uc_custom_code';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get select control default settings.
|
||||
*
|
||||
* Retrieve the default settings of the select control. Used to return the
|
||||
* default settings while initializing the select control.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Control default settings.
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return [
|
||||
'options' => [],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Render select control output in the editor.
|
||||
*
|
||||
* Used to generate the control HTML in the editor using Underscore JS
|
||||
* template. The variables for the class are available using `data` JS
|
||||
* object.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*/
|
||||
public function content_template() {
|
||||
|
||||
$control_uid = $this->get_control_uid();
|
||||
|
||||
?>
|
||||
<div class="elementor-control-field">
|
||||
<div id="<?php echo $control_uid; ?>" data-setting="{{ data.name }}" {{data.addparams}} data-codetype="{{data.codetype}}" class="uc-custom-code" style="display:none" ></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
class Control_UC_HR extends Base_Data_Control {
|
||||
|
||||
/**
|
||||
* Retrieve code control type.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Control type.
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'uc_hr';
|
||||
}
|
||||
|
||||
/**
|
||||
* get hr default settings
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* get content template
|
||||
*/
|
||||
public function content_template() {
|
||||
$control_uid = $this->get_control_uid();
|
||||
?>
|
||||
<div class="elementor-control-field">
|
||||
<hr class="{{{ data.class }}}">
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor select control.
|
||||
*
|
||||
* A base control for creating select control. Displays a simple select box.
|
||||
* It accepts an array in which the `key` is the option value and the `value` is
|
||||
* the option name.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Control_UC_SelectSpecial extends Base_Data_Control {
|
||||
|
||||
/**
|
||||
* Get select control type.
|
||||
*
|
||||
* Retrieve the control type, in this case `select`.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Control type.
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'uc_select_special';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get select control default settings.
|
||||
*
|
||||
* Retrieve the default settings of the select control. Used to return the
|
||||
* default settings while initializing the select control.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access protected
|
||||
*
|
||||
* @return array Control default settings.
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return [
|
||||
'options' => [],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Render select control output in the editor.
|
||||
*
|
||||
* Used to generate the control HTML in the editor using Underscore JS
|
||||
* template. The variables for the class are available using `data` JS
|
||||
* object.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*/
|
||||
public function content_template() {
|
||||
|
||||
$control_uid = $this->get_control_uid();
|
||||
|
||||
?>
|
||||
<div class="elementor-control-field">
|
||||
<# if ( data.label ) {#>
|
||||
<label for="<?php echo $control_uid; ?>" class="elementor-control-title">{{{ data.label }}}</label>
|
||||
<# } #>
|
||||
<div class="elementor-control-input-wrapper">
|
||||
<select id="<?php echo $control_uid; ?>" data-setting="{{ data.name }}" {{data.addparams}} multiple>
|
||||
<#
|
||||
var printOptions = function( options ) {
|
||||
_.each( options, function( option_title, option_value ) { #>
|
||||
<option value="{{ option_value }}">{{{ option_title }}}</option>
|
||||
<# } );
|
||||
};
|
||||
|
||||
if ( data.groups ) {
|
||||
for ( var groupIndex in data.groups ) {
|
||||
var groupArgs = data.groups[ groupIndex ];
|
||||
if ( groupArgs.options ) { #>
|
||||
<optgroup label="{{ groupArgs.label }}">
|
||||
<# printOptions( groupArgs.options ) #>
|
||||
</optgroup>
|
||||
<# } else if ( _.isString( groupArgs ) ) { #>
|
||||
<option value="{{ groupIndex }}">{{{ groupArgs }}}</option>
|
||||
<# }
|
||||
}
|
||||
} else {
|
||||
printOptions( data.options );
|
||||
}
|
||||
#>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<# if ( data.description ) { #>
|
||||
<div class="elementor-control-field-description">{{{ data.description }}}</div>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace Elementor;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Elementor icon control.
|
||||
*
|
||||
* A base control for creating an icon control. Displays a font icon select box
|
||||
* field. The control accepts `include` or `exclude` arguments to set a partial
|
||||
* list of icons.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Control_UC_Shape extends Base_Data_Control {
|
||||
|
||||
/**
|
||||
* Retrieve code control type.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*
|
||||
* @return string Control type.
|
||||
*/
|
||||
public function get_type() {
|
||||
return 'uc_shape_picker';
|
||||
}
|
||||
|
||||
/**
|
||||
* get hr default settings
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* get content template
|
||||
*/
|
||||
public function content_template() {
|
||||
$control_uid = $this->get_control_uid();
|
||||
?>
|
||||
<div class="elementor-control-field uc-control-field-shape">
|
||||
<label for="<?php echo esc_attr($control_uid); ?>" class="elementor-control-title">{{{ data.label }}}</label>
|
||||
<div class="elementor-control-input-wrapper">
|
||||
<input id="<?php echo esc_attr($control_uid); ?>" type="text" class="tooltip-target" data-tooltip="{{ data.title }}" title="{{ data.title }}" data-setting="{{ data.name }}" placeholder="{{ data.placeholder }}" style='display:none'/>
|
||||
|
||||
<div class="uc-button-choose-shape uc-button-control" ><?php esc_html_e("Choose Shape","unlimited-elements-for-elementor")?></div>
|
||||
|
||||
<div class="uc-shape-picker-dialog-container">
|
||||
container
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<# if ( data.description ) { #>
|
||||
<div class="elementor-control-field-description">{{{ data.description }}}</div>
|
||||
<# } #>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use ElementorPro\Modules\DynamicTags\Tags\Base\Tag;
|
||||
use ElementorPro\Modules\DynamicTags\Module;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class UnlimitedElementsDynamicTag_TimeStamp extends Tag {
|
||||
|
||||
public function get_name() {
|
||||
return 'uc-current-timestamp';
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return __( 'Current Time Stamp', 'unlimited-elements-for-elementor' );
|
||||
}
|
||||
|
||||
public function get_group() {
|
||||
return Module::SITE_GROUP;
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ Module::TEXT_CATEGORY ];
|
||||
}
|
||||
|
||||
|
||||
public function render() {
|
||||
|
||||
$stamp = time();
|
||||
|
||||
echo $stamp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UniteCreatorElementorBackgroundWidget extends UniteCreatorElementorWidget {
|
||||
|
||||
|
||||
/**
|
||||
* set the addon
|
||||
*/
|
||||
public function __construct($data = array(), $args = null){
|
||||
//skip constructor
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set the addon
|
||||
*/
|
||||
public function initBGWidget($objAddon, $objControls){
|
||||
|
||||
$this->isBGWidget = true;
|
||||
|
||||
$this->objAddon = $objAddon;
|
||||
$this->objControls = $objControls;
|
||||
}
|
||||
|
||||
/**
|
||||
* modify background widget params
|
||||
*/
|
||||
protected function modifyBGWidgetParams($params){
|
||||
|
||||
$alias = $this->objAddon->getAlias();
|
||||
|
||||
$condition = array(UniteCreatorElementorIntegrate::CONTROL_BACKGROUND_TYPE=>$alias);
|
||||
|
||||
foreach($params as $key=>$param){
|
||||
|
||||
//modify nmae
|
||||
$name = UniteFunctionsUC::getVal($param, "name");
|
||||
if(empty($name))
|
||||
continue;
|
||||
|
||||
$param["name"] = $alias."_".$name;
|
||||
$param["elementor_condition"] = $condition;
|
||||
|
||||
//modify condition
|
||||
$conditionAttribute = UniteFunctionsUC::getVal($param, "condition_attribute");
|
||||
if(!empty($conditionAttribute))
|
||||
$param["condition_attribute"] = $alias."_".$conditionAttribute;
|
||||
|
||||
$params[$key] = $param;
|
||||
}
|
||||
|
||||
|
||||
return($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* add no params heading
|
||||
*/
|
||||
private function addNoParamsBGHeading(){
|
||||
|
||||
$alias = $this->objAddon->getAlias();
|
||||
|
||||
$condition = array(UniteCreatorElementorIntegrate::CONTROL_BACKGROUND_TYPE=>$alias);
|
||||
|
||||
$name = $alias."_no_params";
|
||||
|
||||
$this->objControls->add_control(
|
||||
$name,
|
||||
array(
|
||||
'label' => __( 'No settings for this background', 'unlimited_elements' ),
|
||||
'type' => \Elementor\Controls_Manager::HEADING,
|
||||
'condition'=>$condition
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* register background controls
|
||||
*/
|
||||
public function registerBGControls(){
|
||||
|
||||
if(empty($this->objAddon))
|
||||
return(false);
|
||||
|
||||
$isItemsEnabled = $this->objAddon->isHasItems();
|
||||
$itemsType = $this->objAddon->getItemsType();
|
||||
|
||||
$params = $this->objAddon->getProcessedMainParams();
|
||||
|
||||
$isItemsEnabled = $this->objAddon->isHasItems();
|
||||
$itemsType = $this->objAddon->getItemsType();
|
||||
|
||||
$isAddItems = false;
|
||||
if($isItemsEnabled == true && $itemsType != UniteCreatorAddon::ITEMS_TYPE_IMAGE)
|
||||
$isAddItems = true;
|
||||
|
||||
|
||||
if(empty($params)){
|
||||
|
||||
$this->addNoParamsBGHeading();
|
||||
return(false);
|
||||
}
|
||||
|
||||
$params = $this->modifyBGWidgetParams($params);
|
||||
|
||||
$params = $this->addDynamicAttributes($params);
|
||||
|
||||
foreach($params as $param){
|
||||
|
||||
$type = UniteFunctionsUC::getVal($param, "type");
|
||||
|
||||
if($type == UniteCreatorDialogParam::PARAM_POSTS_LIST){
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->addElementorParamUC($param);
|
||||
}
|
||||
|
||||
if($isAddItems == true)
|
||||
$this->addItemsControlsUC($itemsType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get background settings by section settings
|
||||
*/
|
||||
public function getBGSettings($arrSettings, $bgType){
|
||||
|
||||
$arrBGSettings = array();
|
||||
$typeSearch = $bgType."_";
|
||||
|
||||
foreach($arrSettings as $key => $value){
|
||||
|
||||
if(strpos($key, $typeSearch) !== 0)
|
||||
continue;
|
||||
|
||||
$addonKey = UniteFunctionsUC::replaceFirstSubstring($key, $bgType."_", "");
|
||||
|
||||
$arrBGSettings[$addonKey] = $value;
|
||||
}
|
||||
|
||||
return($arrBGSettings);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Core\Base\Document;
|
||||
use Elementor\DB;
|
||||
use Elementor\Core\Settings\Manager as SettingsManager;
|
||||
use Elementor\Core\Settings\Page\Model;
|
||||
use Elementor\Editor;
|
||||
use Elementor\Modules\Library\Documents\Library_Document;
|
||||
use Elementor\Plugin;
|
||||
use Elementor\Settings;
|
||||
use Elementor\Utils;
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
use Elementor\Widget_Base;
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
|
||||
class UniteCreatorElementorControls{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* get repeater default items
|
||||
*/
|
||||
private function getRepeaterDefaultItems($objAddon){
|
||||
|
||||
if(GlobalsUnlimitedElements::$isImporting == true)
|
||||
return(array());
|
||||
|
||||
|
||||
$arrItems = array();
|
||||
|
||||
$urlImages = GlobalsUC::$urlPluginImages;
|
||||
|
||||
$arrItems[] = array("item_type"=>"image",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery1.jpg") );
|
||||
|
||||
$arrItems[] = array("item_type"=>"image",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery2.jpg") );
|
||||
|
||||
$arrItems[] = array("item_type"=>"youtube",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery3.jpg"),
|
||||
"url_youtube"=>"qrO4YZeyl0I"
|
||||
);
|
||||
|
||||
$arrItems[] = array("item_type"=>"image",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery5.jpg") );
|
||||
|
||||
$arrItems[] = array("item_type"=>"vimeo",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery4.jpg"),
|
||||
"vimeo_id"=>"581014653");
|
||||
|
||||
$arrItems[] = array("item_type"=>"html5",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery6.jpg"),
|
||||
"url_html5"=> "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4");
|
||||
|
||||
$arrItems[] = array("item_type"=>"image",
|
||||
"image"=> array("id"=>0,"url"=>$urlImages."gallery1.jpg") );
|
||||
|
||||
|
||||
return($arrItems);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add repeater control
|
||||
*/
|
||||
public function addGalleryImageVideoRepeater($objControls, $textPrefix, $name, $listingParam, $objAddon){
|
||||
|
||||
$isEnableVideo = UniteFunctionsUC::getVal($listingParam, "gallery_enable_video");
|
||||
|
||||
$arrDefaultItems = $this->getRepeaterDefaultItems($objAddon);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$objControls->start_controls_section(
|
||||
'uc_section_listing_gallery_repeater', array(
|
||||
'label' => $textPrefix.__(" Items", "unlimited-elements-for-elementor"),
|
||||
'condition'=>array($name."_source"=>"image_video_repeater")
|
||||
)
|
||||
);
|
||||
|
||||
// ---- item type ---------
|
||||
|
||||
if($isEnableVideo == true):
|
||||
|
||||
$repeater->add_control(
|
||||
'item_type',
|
||||
array(
|
||||
'label' => __( 'Item Type', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'image',
|
||||
'options' => array(
|
||||
'image' => __( 'Image', 'unlimited-elements-for-elementor' ),
|
||||
'youtube' => __( 'Youtube', 'unlimited-elements-for-elementor' ),
|
||||
'vimeo' => __( 'Vimeo', 'unlimited-elements-for-elementor' ),
|
||||
'wistia' => __( 'Wistia', 'unlimited-elements-for-elementor' ),
|
||||
'html5' => __( 'HTML5 Video', 'unlimited-elements-for-elementor' ),
|
||||
'iframe' => __( 'Iframe', 'unlimited-elements-for-elementor' )
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
//--------- youtube url --------
|
||||
|
||||
$repeater->add_control(
|
||||
'url_youtube',
|
||||
array(
|
||||
'label' => __( 'Youtube Url or ID', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( 'qrO4YZeyl0I', 'unlimited-elements-for-elementor' ),
|
||||
'description'=>'For example: https://www.youtube.com/watch?v=qrO4YZeyl0I or qrO4YZeyl0I',
|
||||
'separator'=>'before',
|
||||
'label_block'=>true,
|
||||
'condition'=>array('item_type'=>'youtube')
|
||||
)
|
||||
);
|
||||
|
||||
//--------- vimeo id --------
|
||||
|
||||
$repeater->add_control(
|
||||
'vimeo_id',
|
||||
array(
|
||||
'label' => __( 'Vimeo Video ID or Url', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( '581014653', 'unlimited-elements-for-elementor' ),
|
||||
'description'=>__('For example: 581014653, or https://vimeo.com/581014653','unlimited-elements-for-elementor'),
|
||||
'separator'=>'before',
|
||||
'label_block'=>true,
|
||||
'condition'=>array('item_type'=>'vimeo')
|
||||
)
|
||||
);
|
||||
|
||||
//--------- wistia --------
|
||||
|
||||
$repeater->add_control(
|
||||
'wistia_id',
|
||||
array(
|
||||
'label' => __( 'Wistia Video ID', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( '9oedgxuciv', 'unlimited-elements-for-elementor' ),
|
||||
'description'=>__('For example: 9oedgxuciv','unlimited-elements-for-elementor'),
|
||||
'separator'=>'before',
|
||||
'label_block'=>true,
|
||||
'condition'=>array('item_type'=>'wistia')
|
||||
)
|
||||
);
|
||||
|
||||
//--------- html5 video --------
|
||||
|
||||
$repeater->add_control(
|
||||
'url_html5',
|
||||
array(
|
||||
'label' => __( 'MP4 Video Url', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', 'unlimited-elements-for-elementor' ),
|
||||
'description'=>__('Enter url of the mp4 video in current or external site. Example: http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4','unlimited-elements-for-elementor'),
|
||||
'separator'=>'before',
|
||||
'label_block'=>true,
|
||||
'condition'=>array('item_type'=>'html5')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
//--------- iframe video --------
|
||||
|
||||
$repeater->add_control(
|
||||
'url_iframe',
|
||||
array(
|
||||
'label' => __( 'Iframe URL', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( 'https://google.com', 'unlimited-elements-for-elementor' ),
|
||||
'description'=>__('Enter any url, that the iframe will load','unlimited-elements-for-elementor'),
|
||||
'separator'=>'before',
|
||||
'label_block'=>true,
|
||||
'condition'=>array('item_type'=>'iframe')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
endif; //enable video
|
||||
|
||||
|
||||
//--------- image --------
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
array(
|
||||
'label' => __( 'Choose Image', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'separator'=>'before',
|
||||
'default' => array(
|
||||
'url' => Utils::get_placeholder_image_src(),
|
||||
),
|
||||
'dynamic'=>array('active'=>true),
|
||||
'recursive'=>true
|
||||
)
|
||||
);
|
||||
|
||||
//--------- image heading --------
|
||||
if($isEnableVideo == true)
|
||||
$repeater->add_control(
|
||||
'image_heading_text',
|
||||
array(
|
||||
'label' => __( 'This image will be used for gallery thumbnail and video placeholder', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'condition'=>array('item_type!'=>'image')
|
||||
)
|
||||
);
|
||||
|
||||
//--------- title --------
|
||||
|
||||
$repeater->add_control(
|
||||
'title',
|
||||
array(
|
||||
'label' => __( 'Item Title', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
||||
'label_block'=>true,
|
||||
'separator'=>'before',
|
||||
'dynamic'=>array('active'=>true),
|
||||
'recursive'=>true
|
||||
)
|
||||
);
|
||||
|
||||
//--------- description --------
|
||||
|
||||
$repeater->add_control(
|
||||
'description',
|
||||
array(
|
||||
'label' => __( 'Item Description', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'default' => __( '', 'unlimited-elements-for-elementor' ),
|
||||
'label_block'=>true,
|
||||
'dynamic'=>array('active'=>true),
|
||||
'recursive'=>true
|
||||
)
|
||||
);
|
||||
|
||||
$arrControl["recursive"] = true;
|
||||
|
||||
//--------- link --------
|
||||
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
array(
|
||||
'label' => __( 'Item Link', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'default' => array(
|
||||
'url' => '',
|
||||
'is_external' => true,
|
||||
'nofollow' => false),
|
||||
'label_block'=>true,
|
||||
'dynamic'=>array('active'=>true),
|
||||
'recursive'=>true
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
$objControls->add_control(
|
||||
$name.'_items',
|
||||
array(
|
||||
'label' => __( 'Gallery Items', 'unlimited-elements-for-elementor' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => $arrDefaultItems,
|
||||
'title_field' => '{{{ title }}}',
|
||||
)
|
||||
);
|
||||
|
||||
$objControls->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="194px" height="194px" viewBox="0 0 194 194" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient x1="1.4609375%" y1="98.5390625%" x2="98.5390625%" y2="1.4609375%" id="linearGradient-1-ue">
|
||||
<stop stop-color="#6F00D8" offset="0%"></stop>
|
||||
<stop stop-color="#1C6AFF" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="40,000" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="3-copy" transform="translate(-147.000000, -203.000000)" fill-rule="nonzero">
|
||||
<g id="logo" transform="translate(147.000000, 203.000000)">
|
||||
<g id="Group">
|
||||
<circle id="Oval" fill="url(#linearGradient-1-ue)" cx="97" cy="97" r="97"></circle>
|
||||
<path d="M154,117.823529 C154,113.015747 150.317473,109.117647 145.776766,109.117647 L127.556567,109.117647 C123.01586,109.117647 119.333333,113.015747 119.333333,117.823529 C119.333333,122.631312 123.01586,126.529412 127.556567,126.529412 L145.776766,126.529412 C150.317473,126.529412 154,122.631312 154,117.823529 M154,85.1764707 C154,80.3699531 150.318669,76.4705881 145.775571,76.4705881 L127.557762,76.4705881 C123.01586,76.4705881 119.333333,80.3699531 119.333333,85.1764707 C119.333333,89.9842532 123.01586,93.882353 127.557762,93.882353 L145.775571,93.882353 C150.318669,93.882353 154,89.9842532 154,85.1764707 M81.3879446,116.004046 L81.3879446,83.3692218 C81.3879446,71.9700259 90.3985869,62.6965765 101.473284,62.6965765 L145.888772,62.6965765 C150.36816,62.6965765 154,58.9583198 154,54.3488949 C154,49.7382568 150.36816,46 145.888772,46 L101.473284,46 C81.4539566,46 65.1666665,62.7633094 65.1666665,83.3692218 L65.1666665,116.004046 C65.1666665,120.614684 68.7985072,124.352941 73.277895,124.352941 C77.7572828,124.352941 81.3879446,120.614684 81.3879446,116.004046 M73.8339314,157 C63.9940097,157 54.744866,153.045872 47.7882757,145.865974 C40.8316856,138.683608 37,129.135925 37,118.978395 L37,84.9652362 C37,80.2741067 40.6845889,76.4705881 45.2290352,76.4705881 C49.7734812,76.4705881 53.4580701,80.2741067 53.4580701,84.9652362 L53.4580701,118.978395 C53.4580701,124.597874 55.5772172,129.879098 59.4256456,133.851745 C63.2728777,137.82439 68.3901634,140.011938 73.8339314,140.011938 C85.0682803,140.011938 94.2085965,130.576596 94.2085965,118.978395 L94.2085965,84.9652362 C94.2085965,80.2741067 97.8931854,76.4705881 102.437632,76.4705881 C106.982078,76.4705881 110.666667,80.2741067 110.666667,84.9652362 L110.666667,118.978395 C110.666667,139.94404 94.1428216,157 73.8339314,157" id="Fill-1" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="13px" height="13px" viewBox="0 0 13 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="40,000" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="mini" transform="translate(-253.000000, -156.000000)" fill="#000000">
|
||||
<path d="M266,163.972656 C266,163.439826 265.590031,163.007812 265.084523,163.007812 L263.056102,163.007812 C262.550594,163.007812 262.140625,163.439826 262.140625,163.972656 C262.140625,164.505487 262.550594,164.9375 263.056102,164.9375 L265.084523,164.9375 C265.590031,164.9375 266,164.505487 266,163.972656 M266,160.316406 C266,159.783716 265.590164,159.351562 265.08439,159.351562 L263.056235,159.351562 C262.550594,159.351562 262.140625,159.783716 262.140625,160.316406 C262.140625,160.849237 262.550594,161.28125 263.056235,161.28125 L265.08439,161.28125 C265.590164,161.28125 266,160.849237 266,160.316406 M257.947367,163.712943 L257.947367,160.117286 C257.947367,158.861339 258.946642,157.839604 260.174819,157.839604 L265.10047,157.839604 C265.597231,157.839604 266,157.427729 266,156.919869 C266,156.411876 265.597231,156 265.10047,156 L260.174819,156 C257.954688,156 256.148438,157.846957 256.148438,160.117286 L256.148438,163.712943 C256.148438,164.220937 256.551206,164.632812 257.047968,164.632812 C257.544729,164.632812 257.947367,164.220937 257.947367,163.712943 M257.113348,168.289062 C256.014496,168.289062 254.981619,167.850216 254.204757,167.053361 C253.427895,166.256231 253,165.196588 253,164.069261 L253,160.294335 C253,159.773693 253.411468,159.351562 253.918959,159.351562 C254.42645,159.351562 254.837919,159.773693 254.837919,160.294335 L254.837919,164.069261 C254.837919,164.692935 255.07457,165.279068 255.504334,165.71997 C255.933966,166.160871 256.505427,166.403654 257.113348,166.403654 C258.367919,166.403654 259.388644,165.35648 259.388644,164.069261 L259.388644,160.294335 C259.388644,159.773693 259.800112,159.351562 260.307603,159.351562 C260.815094,159.351562 261.226562,159.773693 261.226562,160.294335 L261.226562,164.069261 C261.226562,166.396119 259.381299,168.289062 257.113348,168.289062" id="Fill-1-Copy"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="13px" height="13px" viewBox="0 0 13 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 64 (93537) - https://sketch.com -->
|
||||
<title>Fill 1 Copy</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="40,000" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="mini" transform="translate(-253.000000, -156.000000)" fill="#3324F5">
|
||||
<path d="M266,163.972656 C266,163.439826 265.590031,163.007812 265.084523,163.007812 L263.056102,163.007812 C262.550594,163.007812 262.140625,163.439826 262.140625,163.972656 C262.140625,164.505487 262.550594,164.9375 263.056102,164.9375 L265.084523,164.9375 C265.590031,164.9375 266,164.505487 266,163.972656 M266,160.316406 C266,159.783716 265.590164,159.351562 265.08439,159.351562 L263.056235,159.351562 C262.550594,159.351562 262.140625,159.783716 262.140625,160.316406 C262.140625,160.849237 262.550594,161.28125 263.056235,161.28125 L265.08439,161.28125 C265.590164,161.28125 266,160.849237 266,160.316406 M257.947367,163.712943 L257.947367,160.117286 C257.947367,158.861339 258.946642,157.839604 260.174819,157.839604 L265.10047,157.839604 C265.597231,157.839604 266,157.427729 266,156.919869 C266,156.411876 265.597231,156 265.10047,156 L260.174819,156 C257.954688,156 256.148438,157.846957 256.148438,160.117286 L256.148438,163.712943 C256.148438,164.220937 256.551206,164.632812 257.047968,164.632812 C257.544729,164.632812 257.947367,164.220937 257.947367,163.712943 M257.113348,168.289062 C256.014496,168.289062 254.981619,167.850216 254.204757,167.053361 C253.427895,166.256231 253,165.196588 253,164.069261 L253,160.294335 C253,159.773693 253.411468,159.351562 253.918959,159.351562 C254.42645,159.351562 254.837919,159.773693 254.837919,160.294335 L254.837919,164.069261 C254.837919,164.692935 255.07457,165.279068 255.504334,165.71997 C255.933966,166.160871 256.505427,166.403654 257.113348,166.403654 C258.367919,166.403654 259.388644,165.35648 259.388644,164.069261 L259.388644,160.294335 C259.388644,159.773693 259.800112,159.351562 260.307603,159.351562 C260.815094,159.351562 261.226562,159.773693 261.226562,160.294335 L261.226562,164.069261 C261.226562,166.396119 259.381299,168.289062 257.113348,168.289062" id="Fill-1-Copy"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 432 432" style="enable-background:new 0 0 432 432;" xml:space="preserve">
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="_x34_0_x2C_000">
|
||||
<g id="loading-copy" transform="translate(-188.000000, -88.000000)">
|
||||
<g id="Combined-Shape">
|
||||
<path d="M404,520c-57.7,0-111.9-22.5-152.7-63.3c-40.8-40.8-63.3-95-63.3-152.7s22.5-111.9,63.3-152.7
|
||||
C292.1,110.5,346.3,88,404,88c57.7,0,111.9,22.5,152.7,63.3c40.8,40.8,63.3,95,63.3,152.7s-22.5,111.9-63.3,152.7
|
||||
C515.9,497.5,461.7,520,404,520z M404,96c-114.7,0-208,93.3-208,208c0,114.7,93.3,208,208,208s208-93.3,208-208
|
||||
C612,189.3,518.7,96,404,96z M352.1,438.8c-21.7,0-42.1-8.7-57.5-24.5c-15.3-15.8-23.8-36.8-23.8-59.1v-71.2
|
||||
c0-12,9.5-21.8,21.3-21.8s21.3,9.8,21.3,21.8v71.2c0,10.7,4,20.8,11.4,28.4c7.3,7.5,17,11.7,27.3,11.7c21.4,0,38.7-18,38.7-40
|
||||
v-71.2c0-12,9.5-21.8,21.3-21.8s21.3,9.8,21.3,21.8v71.2C433.3,401.3,396.9,438.8,352.1,438.8z M292.1,270.1
|
||||
c-7.3,0-13.3,6.2-13.3,13.8v71.2c0,20.2,7.6,39.2,21.5,53.5c13.8,14.3,32.2,22.1,51.8,22.1c40.4,0,73.2-33.9,73.2-75.6v-71.2
|
||||
c0-7.6-5.9-13.8-13.3-13.8s-13.3,6.2-13.3,13.8v71.2c0,26.5-21,48-46.7,48c-12.5,0-24.3-5-33.1-14.1
|
||||
c-8.8-9.1-13.6-21.1-13.6-33.9v-71.2C305.4,276.3,299.4,270.1,292.1,270.1z M502.8,375.1h-38.4c-11.8,0-21.3-10-21.3-22.3
|
||||
s9.6-22.3,21.3-22.3h38.4c11.8,0,21.3,10,21.3,22.3S514.6,375.1,502.8,375.1z M464.4,338.5c-7.4,0-13.3,6.4-13.3,14.3
|
||||
s6,14.3,13.3,14.3h38.4c7.4,0,13.3-6.4,13.3-14.3s-6-14.3-13.3-14.3H464.4z M350.8,370.4c-11.6,0-21-9.6-21-21.5v-68.3
|
||||
c0-45.3,36-82.2,80.2-82.2h93.2c11.6,0,21,9.6,21,21.5c0,11.8-9.4,21.5-21,21.5H410c-21,0-38.1,17.6-38.1,39.2v68.3
|
||||
C371.8,360.7,362.4,370.4,350.8,370.4z M410,206.5c-39.8,0-72.2,33.3-72.2,74.2v68.3c0,7.4,5.8,13.5,13,13.5c7.2,0,13-6,13-13.5
|
||||
v-68.3c0-26.1,20.7-47.2,46.1-47.2h93.2c7.2,0,13-6,13-13.5c0-7.4-5.8-13.5-13-13.5H410z M502.8,306.7h-38.4
|
||||
c-11.8,0-21.3-10-21.3-22.3s9.6-22.3,21.3-22.3h38.4c11.8,0,21.3,10,21.3,22.3S514.6,306.7,502.8,306.7z M464.4,270.1
|
||||
c-7.4,0-13.3,6.4-13.3,14.3s6,14.3,13.3,14.3h38.4c7.4,0,13.3-6.4,13.3-14.3s-6-14.3-13.3-14.3H464.4z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,883 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2016 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
class UniteCreatorElementorPagination{
|
||||
|
||||
const SHOW_DEBUG = false; //please turn it off
|
||||
|
||||
/**
|
||||
* get data of the controls
|
||||
*/
|
||||
private function getPaginationControlsData($postListParam){
|
||||
|
||||
$disablePagination = UniteFunctionsUC::getVal($postListParam, "disable_pagination");
|
||||
$disablePagination = UniteFunctionsUC::strToBool($disablePagination);
|
||||
|
||||
if($disablePagination == true)
|
||||
return(null);
|
||||
|
||||
$condition = UniteFunctionsUC::getVal($postListParam, "condition");
|
||||
|
||||
$isFilterable = UniteFunctionsUC::getVal($postListParam, "is_filterable");
|
||||
$isFilterable = UniteFunctionsUC::strToBool($isFilterable);
|
||||
|
||||
$enableAjax = UniteFunctionsUC::getVal($postListParam, "enable_ajax");
|
||||
$enableAjax = UniteFunctionsUC::strToBool($enableAjax);
|
||||
|
||||
$paramName = UniteFunctionsUC::getVal($postListParam, "name");
|
||||
|
||||
$data = array();
|
||||
|
||||
$textSection = esc_html__("Posts Pagination", "unlimited-elements-for-elementor");
|
||||
|
||||
if($isFilterable == true)
|
||||
$textSection = esc_html__("Posts Pagination and Filtering", "unlimited-elements-for-elementor");
|
||||
|
||||
if($enableAjax == true)
|
||||
$textSection = esc_html__("Posts Pagination and Filtering", "unlimited-elements-for-elementor");
|
||||
|
||||
$data["section"] = array(
|
||||
"name"=>"section_pagination",
|
||||
"label"=>$textSection,
|
||||
"condition"=>$condition,
|
||||
);
|
||||
|
||||
$arrSettings = array(
|
||||
|
||||
array(
|
||||
"name"=>"pagination_heading",
|
||||
"type"=>UniteCreatorDialogParam::PARAM_HEADING,
|
||||
"label"=>__( 'When turned on, the pagination will appear in archive or single pages, you have option to use the "Posts Pagination" widget for all the styling options', "unlimited-elements-for-elementor"),
|
||||
"default"=>""
|
||||
),
|
||||
|
||||
array(
|
||||
"name"=>"pagination_type",
|
||||
"type"=>UniteCreatorDialogParam::PARAM_DROPDOWN,
|
||||
"label"=>__( 'Pagination', "unlimited-elements-for-elementor"),
|
||||
"default"=>"",
|
||||
'options' => array(
|
||||
'' => __( 'None', "unlimited-elements-for-elementor"),
|
||||
'numbers' => __( 'Numbers', "unlimited-elements-for-elementor"),
|
||||
'pagination_widget' => __( 'Using Pagination Widget', "unlimited-elements-for-elementor")
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
if($enableAjax == true){
|
||||
|
||||
$arrAjaxSettings = array(
|
||||
|
||||
array(
|
||||
"name"=>$paramName.'_isajax',
|
||||
"type"=>UniteCreatorDialogParam::PARAM_RADIOBOOLEAN,
|
||||
"label"=>__( 'Enable Post Filtering', "unlimited-elements-for-elementor"),
|
||||
"default"=>"",
|
||||
'label_on' => __( 'Yes', 'unlimited-elements-for-elementor' ),
|
||||
'label_off' => __( 'No', 'unlimited-elements-for-elementor' ),
|
||||
'return_value' => 'true',
|
||||
'separator' => 'before',
|
||||
'description'=>__('When turned on, you can use all the post filters widgets like tabs filter, load more etc with this grid', 'unlimited-elements-for-elementor')
|
||||
),
|
||||
|
||||
array(
|
||||
"name"=>$paramName.'_ajax_seturl',
|
||||
"type"=>UniteCreatorDialogParam::PARAM_DROPDOWN,
|
||||
"label"=>__( 'Filters Behaviour', "unlimited-elements-for-elementor"),
|
||||
"default"=>"ajax",
|
||||
'options' => array(
|
||||
'ajax' => __( 'Ajax', "unlimited-elements-for-elementor"),
|
||||
//'url' => __( 'Url Change Only', "unlimited-elements-for-elementor"),
|
||||
'mixed' => __( 'Ajax and Url Change', "unlimited-elements-for-elementor"),
|
||||
'mixed_back' => __( 'Ajax, Url Change and Back Button', "unlimited-elements-for-elementor")
|
||||
),
|
||||
'condition' => array($paramName.'_isajax'=>"true"),
|
||||
'description'=>__('Choose the filters behaviour for the current grid. If third mode selected - after ajax it will remember the current grid and filters state in the url so you can get back to it later', 'unlimited-elements-for-elementor')
|
||||
),
|
||||
|
||||
array(
|
||||
"name"=>$paramName.'_filtering_group',
|
||||
"type"=>UniteCreatorDialogParam::PARAM_DROPDOWN,
|
||||
"label"=>__( 'Group', "unlimited-elements-for-elementor"),
|
||||
"default"=>"",
|
||||
'options' => array(
|
||||
'' => __( '[No Group]', "unlimited-elements-for-elementor"),
|
||||
'group1' => __( 'Group1', "unlimited-elements-for-elementor"),
|
||||
'group2' => __( 'Group2', "unlimited-elements-for-elementor"),
|
||||
'group3' => __( 'Group3', "unlimited-elements-for-elementor"),
|
||||
'group4' => __( 'Group4', "unlimited-elements-for-elementor"),
|
||||
'group5' => __( 'Group5', "unlimited-elements-for-elementor")
|
||||
),
|
||||
'condition' => array($paramName.'_isajax'=>"true"),
|
||||
'description' => __( 'Allow filtering group of widgets at once', "unlimited-elements-for-elementor")
|
||||
),
|
||||
|
||||
array(
|
||||
"name"=>$paramName.'_disable_other_hooks',
|
||||
"type"=>UniteCreatorDialogParam::PARAM_RADIOBOOLEAN,
|
||||
'label' => __( 'Disable Third Party Modifications', "unlimited-elements-for-elementor"),
|
||||
"default"=>"",
|
||||
'return_value' => 'yes',
|
||||
'separator' => 'before',
|
||||
'condition' => array($paramName.'_isajax'=>"true"),
|
||||
'description'=>__('Disable other themes or plugins hooks so their code so they will not influence on the query', 'unlimited-elements-for-elementor')
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
$arrSettings = array_merge($arrSettings, $arrAjaxSettings);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$data["settings"] = $arrSettings;
|
||||
|
||||
return($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add content controls
|
||||
*/
|
||||
private function addElementorControls_content($widget, $postListParam){
|
||||
|
||||
$data = $this->getPaginationControlsData($postListParam);
|
||||
|
||||
if(empty($data))
|
||||
return(false);
|
||||
|
||||
|
||||
$arrSection = UniteFunctionsUC::getVal($data, "section");
|
||||
$textSection = UniteFunctionsUC::getVal($arrSection, "label");
|
||||
|
||||
$nameSection = UniteFunctionsUC::getVal($arrSection, "name");
|
||||
$condition = UniteFunctionsUC::getVal($arrSection, "condition");
|
||||
|
||||
|
||||
$arrSectionSettings = array(
|
||||
'label' => $textSection,
|
||||
);
|
||||
|
||||
if(!empty($condition))
|
||||
$arrSectionSettings["condition"] = $condition;
|
||||
|
||||
$widget->start_controls_section(
|
||||
$nameSection, $arrSectionSettings
|
||||
);
|
||||
|
||||
$arrControls = UniteFunctionsUC::getVal($data, "settings");
|
||||
|
||||
foreach($arrControls as $control){
|
||||
|
||||
$type = UniteFunctionsUC::getVal($control, "type");
|
||||
$name = UniteFunctionsUC::getVal($control, "name");
|
||||
$label = UniteFunctionsUC::getVal($control, "label");
|
||||
$default = UniteFunctionsUC::getVal($control, "default");
|
||||
$options = UniteFunctionsUC::getVal($control, "options");
|
||||
$description = UniteFunctionsUC::getVal($control, "description");
|
||||
$condition = UniteFunctionsUC::getVal($control, "condition");
|
||||
|
||||
switch($type){
|
||||
case UniteCreatorDialogParam::PARAM_HEADING:
|
||||
|
||||
$widget->add_control(
|
||||
$name,
|
||||
array(
|
||||
'label' => $label,
|
||||
'type' => \Elementor\Controls_Manager::HEADING,
|
||||
'default' => ''
|
||||
)
|
||||
);
|
||||
|
||||
break;
|
||||
case UniteCreatorDialogParam::PARAM_DROPDOWN:
|
||||
|
||||
$widget->add_control(
|
||||
$name,
|
||||
array(
|
||||
'label' => $label,
|
||||
'type' => \Elementor\Controls_Manager::SELECT,
|
||||
'default' => $default,
|
||||
'options' => $options,
|
||||
'condition' => $condition,
|
||||
'description' => $description
|
||||
)
|
||||
);
|
||||
|
||||
break;
|
||||
case UniteCreatorDialogParam::PARAM_RADIOBOOLEAN:
|
||||
|
||||
$returnValue = UniteFunctionsUC::getVal($control, "return_value");
|
||||
|
||||
$widget->add_control(
|
||||
$name,
|
||||
array(
|
||||
'label' => $label,
|
||||
'type' => \Elementor\Controls_Manager::SWITCHER,
|
||||
'label_on' => __( 'Yes', 'unlimited-elements-for-elementor' ),
|
||||
'label_off' => __( 'No', 'unlimited-elements-for-elementor' ),
|
||||
'return_value' => $returnValue,
|
||||
'default' => '',
|
||||
'separator' => 'before',
|
||||
'condition' => $condition,
|
||||
'description'=>$description
|
||||
)
|
||||
);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
UniteFunctionsUC::throwError("Wrong setting type: $type");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$widget->end_controls_section();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* add elementor controls
|
||||
*/
|
||||
public function addElementorSectionControls($widget, $postListParam = null){
|
||||
|
||||
$this->addElementorControls_content($widget,$postListParam);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* add unite settings section
|
||||
*/
|
||||
public function addUniteSettingsSection(UniteCreatorSettings $settings, $postListParam = null){
|
||||
|
||||
$data = $this->getPaginationControlsData($postListParam);
|
||||
|
||||
if(empty($data))
|
||||
return(false);
|
||||
|
||||
$arrSection = UniteFunctionsUC::getVal($data, "section");
|
||||
|
||||
$textSection = UniteFunctionsUC::getVal($arrSection, "label");
|
||||
$nameSection = UniteFunctionsUC::getVal($arrSection, "name");
|
||||
|
||||
$sectionCondition = UniteFunctionsUC::getVal($arrSection, "condition");
|
||||
|
||||
$settings->addSap($textSection, $nameSection);
|
||||
|
||||
//add section control by condition
|
||||
|
||||
if(!empty($sectionCondition)){
|
||||
|
||||
$controlParent = UniteFunctionsUC::getFirstNotEmptyKey($sectionCondition);
|
||||
|
||||
$controlValues = UniteFunctionsUC::getVal($sectionCondition, $controlParent);
|
||||
|
||||
$settings->addControl($controlParent, $nameSection, "show", $controlValues, true);
|
||||
}
|
||||
|
||||
|
||||
$arrControls = UniteFunctionsUC::getVal($data, "settings");
|
||||
|
||||
foreach($arrControls as $control){
|
||||
|
||||
$type = UniteFunctionsUC::getVal($control, "type");
|
||||
$name = UniteFunctionsUC::getVal($control, "name");
|
||||
$label = UniteFunctionsUC::getVal($control, "label");
|
||||
$default = UniteFunctionsUC::getVal($control, "default");
|
||||
$options = UniteFunctionsUC::getVal($control, "options");
|
||||
$description = UniteFunctionsUC::getVal($control, "description");
|
||||
$condition = UniteFunctionsUC::getVal($control, "condition");
|
||||
|
||||
$arrParams = array();
|
||||
$arrParams["description"] = $description;
|
||||
|
||||
switch($type){
|
||||
case UniteCreatorDialogParam::PARAM_HEADING:
|
||||
|
||||
$settings->addStaticText($label, $name);
|
||||
|
||||
break;
|
||||
case UniteCreatorDialogParam::PARAM_DROPDOWN:
|
||||
|
||||
$options = array_flip($options);
|
||||
|
||||
$settings->addSelect($name, $options, $label, $default, $arrParams);
|
||||
|
||||
break;
|
||||
case UniteCreatorDialogParam::PARAM_RADIOBOOLEAN:
|
||||
|
||||
$returnValue = UniteFunctionsUC::getVal($control, "return_value");
|
||||
|
||||
$default = UniteFunctionsUC::strToBool($default);
|
||||
|
||||
$arrParams["return_value"] = $returnValue;
|
||||
|
||||
$settings->addRadioBoolean($name, $label, $default, "Yes","No", $arrParams);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
UniteFunctionsUC::throwError("Wrong setting type: $type");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//add conditions
|
||||
|
||||
if(!empty($condition))
|
||||
$settings->addControl_byElementorConditions($name, $condition);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put pagination
|
||||
*/
|
||||
public function getHTMLPaginationByElementor($arrValues, $isArchivePage){
|
||||
|
||||
$paginationType = UniteFunctionsUC::getVal($arrValues, "pagination_type");
|
||||
|
||||
if($paginationType != "numbers")
|
||||
return(false);
|
||||
|
||||
if(is_front_page() == true)
|
||||
return(false);
|
||||
|
||||
$options = array();
|
||||
$options["prev_next"] = false;
|
||||
|
||||
//$options["mid_size"] = 2;
|
||||
//$options["prev_text"] = __( 'Newer', "unlimited-elements-for-elementor");
|
||||
//$options["next_text"] = __( 'Older', "unlimited-elements-for-elementor");
|
||||
//$options["total"] = 10;
|
||||
//$options["current"] = 3;
|
||||
|
||||
if($isArchivePage == true){
|
||||
|
||||
$options = $this->getArchivePageOptions($options);
|
||||
|
||||
$pagination = get_the_posts_pagination($options);
|
||||
}
|
||||
else{
|
||||
|
||||
$options = $this->getSinglePageOptions($options);
|
||||
|
||||
if(isset($options["current"]) == false)
|
||||
return(false);
|
||||
|
||||
$pagination = paginate_links($options);
|
||||
}
|
||||
|
||||
$html = "<div class='uc-posts-pagination'>$pagination</div>";
|
||||
|
||||
return($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* get archive options
|
||||
*/
|
||||
private function getArchivePageOptions($options){
|
||||
|
||||
//output demo pagination
|
||||
$isEditMode = GlobalsProviderUC::$isInsideEditor;
|
||||
if($isEditMode == true){
|
||||
$options["total"] = 5;
|
||||
$options["current"] = 2;
|
||||
return($options);
|
||||
}
|
||||
|
||||
return($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* get ucpage from get options
|
||||
*/
|
||||
private function getUCPageFromGET(){
|
||||
|
||||
$ucpage = UniteFunctionsUC::getGetVar("ucpage","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
|
||||
$ucpage = (int)$ucpage;
|
||||
|
||||
if(empty($ucpage))
|
||||
return(null);
|
||||
|
||||
return($ucpage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get current page
|
||||
*/
|
||||
private function getCurrentPage(){
|
||||
|
||||
//return by ucpage in case ajax request
|
||||
|
||||
$objFilters = new UniteCreatorFiltersProcess();
|
||||
$isFrontAjax = $objFilters->isFrontAjaxRequest();
|
||||
|
||||
if($isFrontAjax == true){
|
||||
|
||||
$ucpage = $this->getUCPageFromGET();
|
||||
|
||||
if(!empty($ucpage))
|
||||
return($ucpage);
|
||||
}
|
||||
|
||||
$currentPage = 1;
|
||||
if(!empty(GlobalsProviderUC::$lastPostQuery_page)){
|
||||
|
||||
$currentPage = GlobalsProviderUC::$lastPostQuery_page;
|
||||
}
|
||||
else{
|
||||
$currentPage = get_query_var("page");
|
||||
}
|
||||
|
||||
$currentPage = (int)$currentPage;
|
||||
|
||||
return($currentPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* get total pages from current query
|
||||
*/
|
||||
private function getTotalPages(){
|
||||
|
||||
if(empty(GlobalsProviderUC::$lastPostQuery))
|
||||
return(0);
|
||||
|
||||
$numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
|
||||
if($numPages <= 1)
|
||||
return(0);
|
||||
|
||||
$numPages = (int)$numPages;
|
||||
|
||||
return($numPages);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get single page options
|
||||
*/
|
||||
private function getSinglePageOptions($options, $forceFormat = null, $isDebug = false){
|
||||
|
||||
//output demo pagination
|
||||
$isEditMode = GlobalsProviderUC::$isInsideEditor;
|
||||
|
||||
if($isEditMode == true){
|
||||
|
||||
if(self::SHOW_DEBUG == true){
|
||||
dmp("edit mode!!!");
|
||||
}
|
||||
|
||||
$options["total"] = 5;
|
||||
$options["current"] = 2;
|
||||
return($options);
|
||||
}
|
||||
|
||||
if(empty(GlobalsProviderUC::$lastPostQuery)){
|
||||
|
||||
if($isDebug == true)
|
||||
dmp("no last post query");
|
||||
|
||||
return($options);
|
||||
}
|
||||
|
||||
|
||||
$numPages = GlobalsProviderUC::$lastPostQuery->max_num_pages;
|
||||
if($numPages <= 1){
|
||||
|
||||
if($isDebug == true)
|
||||
dmp("no pages found");
|
||||
|
||||
return($options);
|
||||
}
|
||||
|
||||
if($isDebug == true){
|
||||
dmp("pagination query:");
|
||||
dmp(GlobalsProviderUC::$lastPostQuery->query);
|
||||
}
|
||||
|
||||
|
||||
global $wp_rewrite;
|
||||
$isUsingPermalinks = $wp_rewrite->using_permalinks();
|
||||
|
||||
if( $isUsingPermalinks == true){ //with permalinks - add /2
|
||||
|
||||
$permalink = get_permalink();
|
||||
|
||||
$isFront = is_front_page();
|
||||
$isArchive = is_archive();
|
||||
|
||||
if($isFront == true)
|
||||
$permalink = GlobalsUC::$url_site;
|
||||
|
||||
$urlCurrentPage = UniteFunctionsWPUC::getUrlCurrentPage(true);
|
||||
|
||||
if($isArchive == true)
|
||||
$permalink = $urlCurrentPage;
|
||||
|
||||
$options['base'] = trailingslashit( $permalink ) . '%_%';
|
||||
$options['format'] = user_trailingslashit( '%#%', 'single_paged' );
|
||||
|
||||
if($isFront || $isArchive || $forceFormat == "page")
|
||||
$options['format'] = user_trailingslashit( 'page/%#%', 'single_paged' );
|
||||
|
||||
}else{ //if not permalinks
|
||||
$options['format'] = '?page=%#%'; // add ?page=2
|
||||
}
|
||||
|
||||
$options["total"] = $numPages;
|
||||
|
||||
//set current page
|
||||
$currentPage = 1;
|
||||
if(!empty(GlobalsProviderUC::$lastPostQuery_page)){
|
||||
$currentPage = GlobalsProviderUC::$lastPostQuery_page;
|
||||
|
||||
if(self::SHOW_DEBUG == true){
|
||||
dmp("current: $currentPage from the lastPostQuery_page var");
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$currentPage = get_query_var("paged");
|
||||
dmp("current: $currentPage from the get_query_var");
|
||||
}
|
||||
|
||||
if(empty($currentPage))
|
||||
$currentPage = 1;
|
||||
|
||||
$options["current"] = $currentPage;
|
||||
|
||||
return($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* get has more by last post query
|
||||
*/
|
||||
private function getNextOffsetByQuery(){
|
||||
|
||||
//define has more by last post query
|
||||
$foundPosts = GlobalsProviderUC::$lastPostQuery->found_posts;
|
||||
|
||||
if(empty($foundPosts))
|
||||
return(-1);
|
||||
|
||||
$numPosts = GlobalsProviderUC::$lastPostQuery->post_count;
|
||||
|
||||
$queryVars = GlobalsProviderUC::$lastPostQuery->query_vars;
|
||||
|
||||
$offset = UniteFunctionsUC::getVal($queryVars, "offset");
|
||||
|
||||
if(empty($offset))
|
||||
$offset = 0;
|
||||
|
||||
$lastPost = $offset + $numPosts;
|
||||
|
||||
if($lastPost >= $foundPosts)
|
||||
return(-1);
|
||||
|
||||
return($lastPost);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get last request paging data
|
||||
*/
|
||||
public function getPagingData(){
|
||||
|
||||
$currentPage = $this->getCurrentPage();
|
||||
$totalPages = $this->getTotalPages();
|
||||
|
||||
$nextOffset = null;
|
||||
|
||||
if(GlobalsProviderUC::$lastPostQuery){
|
||||
|
||||
$currentOffset = GlobalsProviderUC::$lastPostQuery_offset;
|
||||
|
||||
$nextOffset = $this->getNextOffsetByQuery();
|
||||
|
||||
$hasMore = $nextOffset >= 0;
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$hasMore = false;
|
||||
if(!empty($currentPage) && !empty($totalPages) && $currentPage < $totalPages)
|
||||
$hasMore = true;
|
||||
}
|
||||
|
||||
$nextPage = $currentPage+1;
|
||||
|
||||
$output = array();
|
||||
$output["current"] = $currentPage;
|
||||
$output["next"] = $nextPage;
|
||||
$output["total"] = $totalPages;
|
||||
$output["has_more"] = $hasMore;
|
||||
|
||||
if($hasMore == true)
|
||||
$output["next_offset"] = $nextOffset;
|
||||
|
||||
|
||||
return($output);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put pagination widget html
|
||||
*/
|
||||
public function putPaginationWidgetHtml($args){
|
||||
|
||||
$putPrevNext = UniteFunctionsUC::getVal($args, "put_prev_next_buttons");
|
||||
$putPrevNext = UniteFunctionsUC::strToBool($putPrevNext);
|
||||
|
||||
$midSize = UniteFunctionsUC::getVal($args, "mid_size", 2);
|
||||
$midSize = (int)$midSize;
|
||||
|
||||
$endSize = UniteFunctionsUC::getVal($args, "end_size", 1);
|
||||
$endSize = (int)$endSize;
|
||||
|
||||
$showAll = UniteFunctionsUC::getVal($args, "show_all");
|
||||
$showAll = UniteFunctionsUC::strToBool($showAll);
|
||||
|
||||
$isShowText = UniteFunctionsUC::getVal($args, "show_text");
|
||||
$isShowText = UniteFunctionsUC::strToBool($isShowText);
|
||||
|
||||
$prevText = UniteFunctionsUC::getVal($args, "prev_text");
|
||||
$nextText = UniteFunctionsUC::getVal($args, "next_text");
|
||||
|
||||
$prevText = trim($prevText);
|
||||
$nextText = trim($nextText);
|
||||
|
||||
$isDebug = UniteFunctionsUC::getVal($args, "debug_pagination_options");
|
||||
$isDebug = UniteFunctionsUC::strToBool($isDebug);
|
||||
|
||||
if(self::SHOW_DEBUG == true)
|
||||
$isDebug = true;
|
||||
|
||||
if(GlobalsUC::$showQueryDebugByUrl == true)
|
||||
$isDebug = true;
|
||||
|
||||
$forceFormat = UniteFunctionsUC::getVal($args, "force_format");
|
||||
if($forceFormat == "none")
|
||||
$forceFormat = null;
|
||||
|
||||
//--------- prepare options
|
||||
|
||||
$options = array();
|
||||
|
||||
$options["show_all"] = $showAll;
|
||||
$options["mid_size"] = $midSize;
|
||||
$options["end_size"] = $endSize;
|
||||
|
||||
$options["prev_next"] = $putPrevNext;
|
||||
|
||||
if(!empty($prevText))
|
||||
$options["prev_text"] = $prevText;
|
||||
|
||||
if(!empty($nextText))
|
||||
$options["next_text"] = $nextText;
|
||||
|
||||
if(empty($nextText))
|
||||
$options["next_text"] = _x( 'Next', 'next set of posts' );
|
||||
|
||||
if(empty($prevText))
|
||||
$options["prev_text"] = _x( 'Previous', 'previous set of posts' );
|
||||
|
||||
//disable the text, leave only icon
|
||||
if($isShowText == false){
|
||||
|
||||
$options["next_text"] = "";
|
||||
$options["prev_text"] = "";
|
||||
}
|
||||
|
||||
//$options["total"] = 10;
|
||||
//$options["current"] = 3;
|
||||
|
||||
|
||||
//-------- put pagination html
|
||||
|
||||
$isArchivePage = UniteFunctionsWPUC::isArchiveLocation();
|
||||
|
||||
if($isDebug == true){
|
||||
echo "<div class='uc-pagination-debug'>";
|
||||
|
||||
dmp("is archive (original): ".$isArchivePage);
|
||||
|
||||
if(!empty($forceFormat))
|
||||
dmp("Force Format: ".$forceFormat);
|
||||
}
|
||||
|
||||
//on ajax - always take the last grid response - single
|
||||
|
||||
$objFilters = new UniteCreatorFiltersProcess();
|
||||
$isAjax = $objFilters->isFrontAjaxRequest();
|
||||
|
||||
if($isAjax == true)
|
||||
$isArchivePage = false;
|
||||
|
||||
//fix the archive
|
||||
|
||||
if($isArchivePage == true && !empty(GlobalsProviderUC::$lastPostQuery_paginationType) && GlobalsProviderUC::$lastPostQuery_paginationType != GlobalsProviderUC::QUERY_TYPE_CURRENT){
|
||||
|
||||
$isArchivePage = false;
|
||||
|
||||
if($isDebug == true){
|
||||
dmp("last pagination type: ");
|
||||
dmp(GlobalsProviderUC::$lastPostQuery_paginationType);
|
||||
|
||||
dmp("change to custom");
|
||||
}
|
||||
}
|
||||
|
||||
//force format yes/no
|
||||
|
||||
switch($forceFormat){
|
||||
case "archive":
|
||||
$isArchivePage = true;
|
||||
break;
|
||||
case "custom":
|
||||
$isArchivePage = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if($isArchivePage == true){
|
||||
|
||||
$options = $this->getArchivePageOptions($options);
|
||||
|
||||
$ucpage = $this->getUCPageFromGET();
|
||||
|
||||
if(!empty($ucpage))
|
||||
$options["current"] = $ucpage;
|
||||
|
||||
$pagination = get_the_posts_pagination($options);
|
||||
|
||||
//put debug
|
||||
if($isDebug == true){
|
||||
dmP("Archive Pagination");
|
||||
|
||||
global $wp_query;
|
||||
|
||||
if(!empty($wp_query)){
|
||||
|
||||
$queryVars = $wp_query->query_vars;
|
||||
|
||||
$queryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($queryVars);
|
||||
|
||||
dmp("Current query vars");
|
||||
dmp($queryVars);
|
||||
|
||||
dmp("max pages: ".$wp_query->max_num_pages);
|
||||
|
||||
//$currentPage = $this->getCurrentPage();
|
||||
//dmp("current page: ".$currentPage);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{ //on single
|
||||
|
||||
//skip for home pages
|
||||
$options = $this->getSinglePageOptions($options, $forceFormat, $isDebug);
|
||||
|
||||
if($isDebug == true){
|
||||
|
||||
dmp("custom query pagination");
|
||||
}
|
||||
|
||||
if(isset($options["current"]) == false){
|
||||
|
||||
if($isDebug == true){
|
||||
dmp("<b>Pagination Options (custom) </b>: <br>");
|
||||
dmp("No pagination found for the last query <br>");
|
||||
dmp($options);
|
||||
}
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
$pagination = paginate_links($options);
|
||||
}
|
||||
|
||||
|
||||
if($isDebug == true){
|
||||
|
||||
dmp("<b>Pagination Options</b>: ");
|
||||
dmp($options);
|
||||
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo $pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* get load more data
|
||||
*/
|
||||
public function getLoadmoreData($isEditMode = false){
|
||||
|
||||
//editor mode
|
||||
if($isEditMode == true){
|
||||
|
||||
$output = array();
|
||||
$output["attributes"] = "";
|
||||
$output["style"] = "";
|
||||
$output["more"] = true;
|
||||
|
||||
return($output);
|
||||
}
|
||||
|
||||
$arrPagingData = $this->getPagingData();
|
||||
|
||||
$hasMore = UniteFunctionsUC::getVal($arrPagingData, "has_more");
|
||||
|
||||
$nextPage = UniteFunctionsUC::getVal($arrPagingData, "next");
|
||||
|
||||
$nextOffset = UniteFunctionsUC::getVal($arrPagingData, "next_offset");
|
||||
|
||||
$attributes = "";
|
||||
$style = "";
|
||||
|
||||
if($hasMore == true){
|
||||
$attributes = "data-more=\"$hasMore\"";
|
||||
|
||||
if(!empty($nextOffset))
|
||||
$attributes .= " data-nextoffset=\"$nextOffset\" ";
|
||||
else
|
||||
$attributes .= " data-nextpage=\"$nextPage\" ";
|
||||
|
||||
}
|
||||
else
|
||||
$style = "style='display:none'";
|
||||
|
||||
|
||||
$output = array();
|
||||
$output["attributes"] = $attributes;
|
||||
$output["style"] = $style;
|
||||
$output["more"] = $hasMore;
|
||||
|
||||
|
||||
return($output);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author unlimited-elements.com / Valiano
|
||||
* @copyright (C) 2012 Unite CMS, All Rights Reserved.
|
||||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* */
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class GlobalsUnlimitedElements{
|
||||
|
||||
public static $enableDashboard = true;
|
||||
|
||||
public static $enableForms = true;
|
||||
|
||||
public static $enableGutenbergSupport = false;
|
||||
|
||||
public static $showAdminNotices = false;
|
||||
public static $debugAdminNotices = false;
|
||||
|
||||
public static $enableApiIntegrations = true;
|
||||
|
||||
public static $enableGoogleAPI = true;
|
||||
public static $enableWeatherAPI = true;
|
||||
public static $enableCurrencyAPI = true;
|
||||
|
||||
public static $enableGoogleCalendarScopes = false;
|
||||
public static $enableGoogleYoutubeScopes = false;
|
||||
|
||||
public static $enableInsideNotification = true;
|
||||
|
||||
public static $enableInstagramErrorMessage = false;
|
||||
|
||||
//public static $insideNotificationText = "BLACK FRIDAY SALE STARTS NOW! <br> Grab the PRO version for 50% off. <br> <a href='https://unlimited-elements.com/pricing/' target='_blank'>Get It Now</a> ";
|
||||
//public static $insideNotificationText = "Unlimited Elements Birthday Sale!!! <br> 50% OFF - all plans! <br> <a style='text-decoration:underline;' href='https://unlimited-elements.com/pricing/' target='_blank'>Get It Now!</a> ";
|
||||
public static $insideNotificationText = "Unlock Access To All PRO Widgets and Features. <a href='https://unlimited-elements.com/pricing/' target='_blank'>Upgrade Now</a> ";
|
||||
public static $insideNotificationUrl = "https://unlimited-elements.com/pricing/";
|
||||
|
||||
const PLUGIN_NAME = "unlimitedelements";
|
||||
const VIEW_DASHBOARD = "dashboard";
|
||||
const VIEW_ADDONS_ELEMENTOR = "addons_elementor";
|
||||
const VIEW_LICENSE_ELEMENTOR = "licenseelementor";
|
||||
const VIEW_SETTINGS_ELEMENTOR = "settingselementor";
|
||||
const VIEW_TEMPLATES_ELEMENTOR = "templates_elementor";
|
||||
const VIEW_SECTIONS_ELEMENTOR = "sections_elementor";
|
||||
const VIEW_CUSTOM_POST_TYPES = "custom_posttypes";
|
||||
const VIEW_ICONS = "svg_shapes";
|
||||
const VIEW_BACKGROUNDS = "backgrounds";
|
||||
const VIEW_FORM_ENTRIES = "form_entries";
|
||||
const VIEW_CHANGELOG = "changelog";
|
||||
|
||||
const LINK_BUY = "https://unlimited-elements.com/pricing/";
|
||||
|
||||
const SLUG_BUY_BROWSER = "page=unlimitedelements-pricing";
|
||||
|
||||
const GENERAL_SETTINGS_KEY = "unlimited_elements_general_settings";
|
||||
const ADDONSTYPE_ELEMENTOR = "elementor";
|
||||
const ADDONSTYPE_ELEMENTOR_TEMPLATE = "elementor_template";
|
||||
const ADDONSTYPE_CUSTOM_POSTTYPES = "posttype";
|
||||
|
||||
const PLUGIN_TITLE = "Unlimited Elements";
|
||||
const POSTTYPE_ELEMENTOR_LIBRARY = "elementor_library";
|
||||
const META_TEMPLATE_TYPE = '_elementor_template_type';
|
||||
const META_TEMPLATE_SOURCE = "_unlimited_template_source"; //the value is unlimited
|
||||
const META_TEMPLATE_SOURCE_NAME = "_unlimited_template_sourceid";
|
||||
|
||||
const POSTTYPE_UNLIMITED_ELEMENS_LIBRARY = "unelements_library";
|
||||
|
||||
const ALLOW_FEEDBACK_ONUNINSTALL = false;
|
||||
const EMAIL_FEEDBACK = "support@unitecms.net";
|
||||
|
||||
const FREEMIUS_PLUGIN_ID = "4036";
|
||||
|
||||
const GOOGLE_CONNECTION_URL = "https://unlimited-elements.com/google-connect/connect.php";
|
||||
const GOOGLE_CONNECTION_CLIENTID = "916742274008-sji12chck4ahgqf7c292nfg2ofp10qeo.apps.googleusercontent.com";
|
||||
|
||||
const LINK_HELP_POSTSLIST = "https://unlimited-elements.helpscoutdocs.com/article/69-post-list-query-usage";
|
||||
|
||||
const PREFIX_ANIMATION_CLASS = "ue-animation-";
|
||||
const PREFIX_TEMPLATE_PERMALINK = "unlimited-";
|
||||
|
||||
public static $enableCPT = false;
|
||||
public static $urlTemplatesList;
|
||||
public static $urlAccount;
|
||||
public static $renderingDynamicData;
|
||||
public static $currentRenderingWidget;
|
||||
public static $isImporting = false;
|
||||
|
||||
/**
|
||||
* init globals
|
||||
*/
|
||||
public static function initGlobals(){
|
||||
|
||||
if(defined("UE_ENABLE_GUTENBERG_SUPPORT"))
|
||||
self::$enableGutenbergSupport = true;
|
||||
|
||||
self::$urlTemplatesList = admin_url("edit.php?post_type=elementor_library&tabs_group=library");
|
||||
|
||||
self::$urlAccount = admin_url("admin.php?page=unlimitedelements-account");
|
||||
|
||||
UniteProviderFunctionsUC::addAction('admin_init', array("GlobalsUnlimitedElements", 'initAdminNotices'));
|
||||
|
||||
if(self::$enableGutenbergSupport == true)
|
||||
self::initGutenbergIntegration();
|
||||
|
||||
if(GlobalsUC::$is_admin == true && HelperUC::hasPermissionsFromQuery("showadminnotices"))
|
||||
self::$debugAdminNotices = true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* init the admin notices
|
||||
*/
|
||||
public static function initAdminNotices(){
|
||||
|
||||
if(GlobalsUnlimitedElements::$showAdminNotices === false)
|
||||
return;
|
||||
|
||||
UCAdminNotices::init(array(
|
||||
// new UCAdminNoticeBanner(),
|
||||
// new UCAdminNoticeSimpleExample(),
|
||||
// new UCAdminNoticeDoubly(),
|
||||
// new UCAdminNoticeRating(),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* init the Gutenberg integration
|
||||
*/
|
||||
private static function initGutenbergIntegration(){
|
||||
|
||||
$gutenbergIntegrate = UniteCreatorGutenbergIntegrate::getInstance();
|
||||
$gutenbergIntegrate->init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GlobalsUnlimitedElements::initGlobals();
|
||||
|
After Width: | Height: | Size: 395 B |
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
/**
|
||||
* @package unlimited elements plugin
|
||||
* @author UniteCMS http://unitecms.net
|
||||
* @copyright Copyright (c) 2017 UniteCMS
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
|
||||
*/
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
class UnlimitedElementsPluginUC extends UniteCreatorPluginBase{
|
||||
|
||||
protected $extraInitParams = array();
|
||||
|
||||
private $version = "1.0";
|
||||
private $pluginName = "unlimited_elements_plugin";
|
||||
private $title;
|
||||
private $description;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$pathPlugin = dirname(__FILE__)."/";
|
||||
|
||||
parent::__construct($pathPlugin);
|
||||
|
||||
$this->title = esc_html__("Unlimited Elements for Elementor", "unlimited-elements-for-elementor");
|
||||
$this->description = "Create and use widgets for Elementor Page Builder";
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* run admin
|
||||
*/
|
||||
public function runAdmin(){
|
||||
|
||||
$this->includeCommonFiles();
|
||||
$this->runCommonActions();
|
||||
|
||||
require_once GlobalsUC::$pathPlugin . "unitecreator_admin.php";
|
||||
require_once GlobalsUC::$pathProvider . "provider_admin.class.php";
|
||||
require_once $this->pathPlugin . "provider_core_admin.class.php";
|
||||
require_once $this->pathPlugin . "dialog_param_elementor.class.php";
|
||||
|
||||
$mainFilepath = GlobalsUC::$pathPlugin."unlimited_elements.php";
|
||||
|
||||
new UniteProviderCoreAdminUC_Elementor($mainFilepath);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* run front
|
||||
*/
|
||||
public function runFront(){
|
||||
|
||||
$this->includeCommonFiles();
|
||||
$this->runCommonActions();
|
||||
|
||||
require_once GlobalsUC::$pathProvider . "provider_front.class.php";
|
||||
require_once $this->pathPlugin . "provider_core_front.class.php";
|
||||
|
||||
$mainFilepath = GlobalsUC::$pathPlugin."unlimited_elements.php";
|
||||
|
||||
new UniteProviderCoreFrontUC_Elementor($mainFilepath);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* include files
|
||||
*/
|
||||
protected function includeCommonFiles(){
|
||||
|
||||
require_once $this->pathPlugin . 'globals.class.php';
|
||||
require_once $this->pathPlugin . 'addontype_elementor.class.php';
|
||||
require_once $this->pathPlugin . 'addontype_elementor_template.class.php';
|
||||
require_once $this->pathPlugin . 'helper_provider_core.class.php';
|
||||
require_once $this->pathPlugin . 'elementor/elementor_integrate.class.php';
|
||||
require_once $this->pathPlugin . 'elementor/pagination.class.php';
|
||||
require_once $this->pathPlugin . "elementor/elementor_controls.class.php";
|
||||
|
||||
if(is_admin()){
|
||||
require_once $this->pathPlugin . 'elementor/elementor_layout_exporter.class.php';
|
||||
}
|
||||
|
||||
//require_once $this->pathPlugin . 'elementor/elementor_base_override.class.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* on plugins loaded
|
||||
*/
|
||||
public function onPluginsLoaded(){
|
||||
|
||||
//register elementor template addon type
|
||||
|
||||
$objAddonTypeElementorTempalte = new UniteCreatorAddonType_Elementor_Template();
|
||||
$this->registerAddonType(GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR_TEMPLATE, $objAddonTypeElementorTempalte);
|
||||
|
||||
if(defined("UC_BOTH_VERSIONS_ACTIVE")){
|
||||
HelperUC::addAdminNotice("Both unlimited elements plugins, FREE and PRO are active! Please uninstall FREE version.");
|
||||
}
|
||||
|
||||
// Notice if the Elementor is not active
|
||||
if ( ! did_action( 'elementor/loaded' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$objIntegrate = new UniteCreatorElementorIntegrate();
|
||||
$objIntegrate->initElementorIntegration();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* modify plugin variables if the plugin is not default (blox)
|
||||
*/
|
||||
private function modifyPluginVariables(){
|
||||
|
||||
$pluginName = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
|
||||
GlobalsUC::$url_component_admin = admin_url()."admin.php?page={$pluginName}";
|
||||
GlobalsUC::$url_component_client = GlobalsUC::$url_component_admin;
|
||||
GlobalsUC::$url_component_admin_nowindow = GlobalsUC::$url_component_admin."&ucwindow=blank";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* run common actions
|
||||
*/
|
||||
protected function runCommonActions(){
|
||||
|
||||
$this->addAction("plugins_loaded", "onPluginsLoaded");
|
||||
$this->modifyPluginVariables();
|
||||
|
||||
//register elementor addon type
|
||||
|
||||
$objAddonTypeElementor = new UniteCreatorAddonType_Elementor();
|
||||
$this->registerAddonType(GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR, $objAddonTypeElementor);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init the plugin
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
$this->register($this->pluginName, $this->title, $this->version, $this->description, $this->extraInitParams);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//run the plugin
|
||||
new UnlimitedElementsPluginUC();
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
class UniteProviderCoreAdminUC_Elementor extends UniteProviderAdminUC{
|
||||
|
||||
private $objFeedback;
|
||||
|
||||
/**
|
||||
* the constructor
|
||||
*/
|
||||
public function __construct($mainFilepath){
|
||||
|
||||
$this->pluginName = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
$this->pluginTitle = esc_html__("Unlimited Elements", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->textBuy = esc_html__("Activate Plugin", "unlimited-elements-for-elementor");
|
||||
$this->linkBuy = null;
|
||||
|
||||
$this->defaultAddonType = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR;
|
||||
$this->defaultView = (GlobalsUnlimitedElements::$enableDashboard === true)
|
||||
? GlobalsUnlimitedElements::VIEW_DASHBOARD
|
||||
: GlobalsUnlimitedElements::VIEW_ADDONS_ELEMENTOR;
|
||||
|
||||
$this->arrAllowedViews = array(
|
||||
"addons_elementor",
|
||||
"licenseelementor",
|
||||
"email-test",
|
||||
"forms-logs",
|
||||
"troubleshooting-overload",
|
||||
"troubleshooting-globals",
|
||||
"troubleshooting-phpinfo",
|
||||
"troubleshooting-memory-usage",
|
||||
"troubleshooting-connectivity",
|
||||
"instagram-test",
|
||||
"testaddon",
|
||||
"testaddonnew",
|
||||
"addon",
|
||||
"addondefaults",
|
||||
"svg_shapes",
|
||||
"wpml-fields",
|
||||
"testsettings",
|
||||
GlobalsUnlimitedElements::VIEW_DASHBOARD,
|
||||
GlobalsUnlimitedElements::VIEW_BACKGROUNDS,
|
||||
GlobalsUnlimitedElements::VIEW_TEMPLATES_ELEMENTOR,
|
||||
GlobalsUnlimitedElements::VIEW_FORM_ENTRIES,
|
||||
GlobalsUnlimitedElements::VIEW_SETTINGS_ELEMENTOR,
|
||||
GlobalsUnlimitedElements::VIEW_CUSTOM_POST_TYPES,
|
||||
GlobalsUnlimitedElements::VIEW_CHANGELOG,
|
||||
);
|
||||
|
||||
HelperProviderCoreUC_EL::globalInit();
|
||||
|
||||
//set permission
|
||||
$permission = HelperProviderCoreUC_EL::getGeneralSetting("edit_permission");
|
||||
|
||||
if($permission == "editor")
|
||||
$this->setPermissionEditor();
|
||||
|
||||
parent::__construct($mainFilepath);
|
||||
}
|
||||
|
||||
/**
|
||||
* modify category settings, add consolidate addons
|
||||
*/
|
||||
public function managerAddonsModifyCategorySettings($settings, $objCat, $filterType){
|
||||
|
||||
if($filterType != UniteCreatorElementorIntegrate::ADDONS_TYPE)
|
||||
return ($settings);
|
||||
|
||||
$settings->updateSettingProperty("category_alias", "disabled", "true");
|
||||
$settings->updateSettingProperty("category_alias", "description", esc_html__("The category name is unchangable, because of the addons consolidation, if changed it could break the layout.", "unlimited-elements-for-elementor"));
|
||||
|
||||
return ($settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* modify plugins view links
|
||||
*/
|
||||
public function modifyPluginViewLinks($arrLinks){
|
||||
|
||||
if(GlobalsUC::$isProductActive == true)
|
||||
return ($arrLinks);
|
||||
|
||||
if(empty($this->linkBuy))
|
||||
return ($arrLinks);
|
||||
|
||||
$linkbuy = HelperHtmlUC::getHtmlLink($this->linkBuy, $this->textBuy, "", "uc-link-gounlimited", true);
|
||||
|
||||
$arrLinks["gounlimited"] = $linkbuy;
|
||||
|
||||
return ($arrLinks);
|
||||
}
|
||||
|
||||
/**
|
||||
* add admin menu links
|
||||
*/
|
||||
protected function addAdminMenuLinks(){
|
||||
|
||||
$urlMenuIcon = HelperProviderCoreUC_EL::$urlCore . "images/icon_menu.png";
|
||||
|
||||
$mainMenuTitle = $this->pluginTitle;
|
||||
|
||||
$this->addMenuPage($mainMenuTitle, "adminPages", $urlMenuIcon);
|
||||
|
||||
if(GlobalsUnlimitedElements::$enableDashboard === true)
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_DASHBOARD, __('Home', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_ADDONS_ELEMENTOR, __('Widgets', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
if(HelperProviderUC::isBackgroundsEnabled() === true)
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_BACKGROUNDS, __('Background Widgets', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_TEMPLATES_ELEMENTOR, __('Templates', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
if(HelperProviderUC::isFormEntriesEnabled() === true)
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_FORM_ENTRIES, __('Form Entries', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
if(HelperProviderUC::isAddonChangelogEnabled() === true)
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_CHANGELOG, __('Changelog', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_SETTINGS_ELEMENTOR, __('General Settings', "unlimited-elements-for-elementor"), "adminPages");
|
||||
|
||||
if(defined("UNLIMITED_ELEMENTS_UPRESS_VERSION")){
|
||||
if(GlobalsUC::$isProductActive == false && self::$view != GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR)
|
||||
HelperUC::addAdminNotice("The Unlimited Elements Plugin is not active. Please activate it in license page.");
|
||||
|
||||
$this->addSubMenuPage(GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR, __('Upress License', "unlimited-elements-for-elementor"), "adminPages");
|
||||
}
|
||||
|
||||
$this->addLocalFilter("plugin_action_links_" . $this->pluginFilebase, "modifyPluginViewLinks");
|
||||
|
||||
//$isFsActivated = HelperProviderUC::isActivatedByFreemius();
|
||||
|
||||
//if($isFsActivated == false)
|
||||
//$this->addSubMenuPage("licenseelementor", __('Old License Activation',"unlimited-elements-for-elementor"), "adminPages");
|
||||
}
|
||||
|
||||
/**
|
||||
* allow feedback on uninstall
|
||||
*/
|
||||
private function initFeedbackUninstall(){
|
||||
|
||||
$this->objFeedback = new UnlimitedElementsFeedbackUC();
|
||||
$this->objFeedback->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
protected function init(){
|
||||
|
||||
UniteProviderFunctionsUC::addFilter(UniteCreatorFilters::FILTER_MANAGER_ADDONS_CATEGORY_SETTINGS, array($this, "managerAddonsModifyCategorySettings"), 10, 3);
|
||||
|
||||
if(GlobalsUnlimitedElements::ALLOW_FEEDBACK_ONUNINSTALL === true)
|
||||
$this->initFeedbackUninstall();
|
||||
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
|
||||
class UniteProviderCoreFrontUC_Elementor extends UniteProviderFrontUC{
|
||||
|
||||
private $objFiltersProcess;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* the constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
HelperProviderCoreUC_EL::globalInit();
|
||||
|
||||
//run front filters process
|
||||
|
||||
$this->objFiltersProcess = new UniteCreatorFiltersProcess();
|
||||
$this->objFiltersProcess->initWPFrontFilters();
|
||||
|
||||
|
||||
/*
|
||||
$disableFilters = HelperProviderCoreUC_EL::getGeneralSetting("disable_autop_filters");
|
||||
$disableFilters = UniteFunctionsUC::strToBool($disableFilters);
|
||||
|
||||
if($disableFilters == true)
|
||||
$this->disableWpFilters();
|
||||
*/
|
||||
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<fields>
|
||||
<fieldset name="elementor" label="Widgets for Elementor">
|
||||
|
||||
<field name="el_enable"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label="<b>Enable Unlimited Elements</b>"
|
||||
description="If disabled, the Unlimited Elements will not appear in the Elementor Page Builder">
|
||||
</field>
|
||||
|
||||
<field type="bulk_control_start"
|
||||
parent="el_enable"
|
||||
ctype="show"
|
||||
value="true"
|
||||
/>
|
||||
|
||||
<field name="consolidate_addons"
|
||||
type="boolean"
|
||||
default="false"
|
||||
hidden="true"
|
||||
label=" Consolidate Widgets"
|
||||
description="Consolidate widgets, category into one addon. If consolidated, the initial design may not look as in demo, but it save memory">
|
||||
</field>
|
||||
|
||||
<field name="js_in_footer"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Js Always in Footer"
|
||||
description="Put addon javascript always in the footer of the page. If no, it will be put right after the body">
|
||||
</field>
|
||||
|
||||
<field name="js_saparate"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label=" Each JS in separate tag"
|
||||
description="if yes, each js will be put in separate tag with it's own id. good for optimization plugins">
|
||||
</field>
|
||||
|
||||
<field type="control" parent="js_in_footer" child="js_saparate" ctype="show" value="true" />
|
||||
|
||||
<field name="css_includes_to"
|
||||
type="list"
|
||||
default="body"
|
||||
label=" Include Css Files To"
|
||||
description="Choose where to include css files">
|
||||
<option value="body" text="Body Before Widget HTML" />
|
||||
<option value="footer" text="Footer" />
|
||||
</field>
|
||||
|
||||
<field name="output_wrapping_comments"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Output Wrapping HTML Comments"
|
||||
description="Output comments before and after widgets in source html output">
|
||||
</field>
|
||||
|
||||
<field name="enable_import_export"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Show Import and Export Buttons In Templates"
|
||||
description="Show special import and export buttons (import and export with images) in elementor saved templates screen">
|
||||
</field>
|
||||
|
||||
|
||||
<field name="enable_backgrounds"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Enable Background Widgets"
|
||||
description="Enable background widgets for elementor sections">
|
||||
</field>
|
||||
|
||||
<field name="enable_panel_previews"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Show Elementor Panel Widgets Previews"
|
||||
description="Show preview images of widget boxes in elementor editor side panel">
|
||||
</field>
|
||||
|
||||
<field name="show_edit_html_button"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label=" Show "Edit HTML" Button in Widget Settings"
|
||||
description="Show "Edit HTML" button in elementor panel widget settings">
|
||||
</field>
|
||||
|
||||
<field name="enable_dynamic_visibility"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label=" Enable Dynamic Visibility"
|
||||
hidden="true"
|
||||
description="">
|
||||
</field>
|
||||
|
||||
<field name="force_disable_font_awesome"
|
||||
type="list"
|
||||
default="enable"
|
||||
label=" Force Disable Font Awesome"
|
||||
description="Disable font awesome from loading from the plugin in all widgets. Sometimes good for optimization.">
|
||||
<option value="enable" text="Load Normally" />
|
||||
<option value="disable" text="Force Disable" />
|
||||
</field>
|
||||
|
||||
<field name="alphabetic_attributes"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Sort Attributes in Widgets Editor by A-Z"
|
||||
description="Sort the order of the attributes in widgets editor alphabetically">
|
||||
</field>
|
||||
|
||||
<field type="bulk_control_end" />
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="general" label="General">
|
||||
|
||||
<field name="edit_permission"
|
||||
type="list"
|
||||
default="admin"
|
||||
label="Edit Permission"
|
||||
description="The addon/assets edit will be visible to the selected user categories">
|
||||
<option value="admin" text="Admin" />
|
||||
<option value="editor" text="Editor" />
|
||||
</field>
|
||||
|
||||
<field name="enable_changelog"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Enable Changelog"
|
||||
description="Enable changelog for widgets">
|
||||
</field>
|
||||
|
||||
<field name="enable_revisions"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Enable Revisions"
|
||||
description="Enable revisions in widgets editor">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="instagram" label="Instagram">
|
||||
|
||||
<field name="instagram_integration"
|
||||
type="custom"
|
||||
custom_type="instagram_connect"
|
||||
label="unite_setting_notext">
|
||||
</field>
|
||||
|
||||
<field name="instagram_access_token"
|
||||
type="text"
|
||||
label="Instagram Access Token"
|
||||
default=""
|
||||
hidden="true"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field name="instagram_user_id"
|
||||
type="hidden"
|
||||
label="Instagram User ID"
|
||||
default=""
|
||||
>
|
||||
</field>
|
||||
|
||||
<field name="instagram_username"
|
||||
type="hidden"
|
||||
label="Instagram Username"
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="instagram_expires"
|
||||
type="hidden"
|
||||
label="Instagram Expires"
|
||||
default="">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="integrations" label="Integrations">
|
||||
|
||||
<field name="google_connect_heading"
|
||||
type="statictext"
|
||||
label="<b>Google Sheets Connect</b>">
|
||||
</field>
|
||||
|
||||
<field name="google_connect_desc"
|
||||
type="statictext"
|
||||
label="Used in Google services (Google Sheets) related widgets for reading and writing data.">
|
||||
</field>
|
||||
|
||||
<!-- label="Used in Google services (Calendar, Sheets, YouTube etc.) related widgets for reading and writing data."> */ -->
|
||||
|
||||
<field name="google_connect_integration"
|
||||
type="custom"
|
||||
custom_type="google_connect"
|
||||
label="unite_setting_notext">
|
||||
</field>
|
||||
|
||||
<field name="google_connect_credentials"
|
||||
type="hidden"
|
||||
label="Google Credentials">
|
||||
</field>
|
||||
|
||||
<field name="google_api_heading"
|
||||
type="statictext"
|
||||
label="<b>Google API</b>">
|
||||
</field>
|
||||
|
||||
<field name="google_api_key"
|
||||
type="text"
|
||||
label="Google API Key"
|
||||
description="Used in Google services (Calendar, Places, Sheets, YouTube etc.) related widgets for reading data. <a href='https://support.google.com/googleapi/answer/6158862' target='_blank'>Read this article</a> for instructions."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="google_map_heading"
|
||||
type="statictext"
|
||||
label="<b>Google Maps</b>">
|
||||
</field>
|
||||
|
||||
<field name="google_map_key"
|
||||
type="text"
|
||||
label="Google Map API Key"
|
||||
description="Used to output a map in Google Maps related widgets. <a href='https://unlimited-elements.com/docs/google-map-api-key/' target='_blank'>Read this article</a> for instructions."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="openweather_api_heading"
|
||||
type="statictext"
|
||||
label="<b>OpenWeather API</b>">
|
||||
</field>
|
||||
|
||||
<field name="openweather_api_key"
|
||||
type="text"
|
||||
label="OpenWeather API Key"
|
||||
description="Used in weather related widgets. <a href='https://openweathermap.org/api/one-call-3#start' target='_blank'>Read this article</a> for instructions. <br> It takes some time for an API key to become active. <a href='https://openweathermap.org/faq#error401' target='_blank'>Read error 401 description</a> for more details."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="openweather_api_test"
|
||||
type="custom"
|
||||
custom_type="openweather_api_test"
|
||||
label=" ">
|
||||
</field>
|
||||
|
||||
<field name="exchangerate_api_heading"
|
||||
type="statictext"
|
||||
label="<b>Exchange Rate API</b>">
|
||||
</field>
|
||||
|
||||
<field name="exchangerate_api_key"
|
||||
type="text"
|
||||
label="Exchange Rate API Key"
|
||||
description="Used in currency exchange related widgets. Get your API key <a href='https://app.exchangerate-api.com/sign-up' target='_blank'>here</a>."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="wpml_heading"
|
||||
type="statictext"
|
||||
hidden="true"
|
||||
label="<b>WPML Automatic Translation</b>">
|
||||
</field>
|
||||
|
||||
<field name="wpml_button"
|
||||
type="button"
|
||||
value="Check Widgets Fields"
|
||||
hidden="true"
|
||||
gotoview="wpml-fields"
|
||||
label="Check widgets fields that are ready for wpml automatic translation.">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="forms" label="Forms">
|
||||
|
||||
<field name="form_general_heading"
|
||||
type="statictext"
|
||||
label="<b>General</b>">
|
||||
</field>
|
||||
|
||||
<field name="enable_form_entries"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Enable Form Entries"
|
||||
description="Enable viewing and saving of form submissions.">
|
||||
</field>
|
||||
|
||||
<field name="save_form_logs"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Save Form Logs"
|
||||
description="Enable saving a log of form submissions.">
|
||||
</field>
|
||||
|
||||
<field type="control"
|
||||
parent="save_form_logs"
|
||||
child="form_logs_button"
|
||||
ctype="show"
|
||||
value="true">
|
||||
</field>
|
||||
|
||||
<field name="form_logs_button"
|
||||
type="button"
|
||||
value="Show Form Logs"
|
||||
gotoview="forms-logs"
|
||||
label=" ">
|
||||
</field>
|
||||
|
||||
<field name="form_antispam_heading"
|
||||
type="statictext"
|
||||
label="<b>Anti-spam</b>">
|
||||
</field>
|
||||
|
||||
<field name="form_antispam_enabled"
|
||||
type="boolean"
|
||||
default="true"
|
||||
label="Enable Anti-spam"
|
||||
description="Enable anti-spam to protect forms.">
|
||||
</field>
|
||||
|
||||
<field type="bulk_control_start"
|
||||
parent="form_antispam_enabled"
|
||||
ctype="show"
|
||||
value="true"
|
||||
/>
|
||||
|
||||
<field name="form_antispam_submissions_limit"
|
||||
type="text"
|
||||
label="Submissions Limit"
|
||||
description="Specify the maximum number of submissions a user can reach in the time interval. The default value is 3."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="form_antispam_submissions_period"
|
||||
type="text"
|
||||
label="Submissions Period"
|
||||
description="Specify within how many seconds a user will reach the submissions limit. The default value is 60 seconds."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field name="form_antispam_block_period"
|
||||
type="text"
|
||||
label="Block Period"
|
||||
description="Specify how many minutes a user will be blocked from submitting forms after reaching the limit. The default value is 180 minutes."
|
||||
default="">
|
||||
</field>
|
||||
|
||||
<field type="bulk_control_end" />
|
||||
|
||||
<field name="email_test_heading"
|
||||
type="statictext"
|
||||
label="<b>Email Test</b>">
|
||||
</field>
|
||||
|
||||
<field name="email_test_button"
|
||||
type="button"
|
||||
value="Send Test Email"
|
||||
gotoview="email-test"
|
||||
label="Send a test email to check your SMTP configuration.">
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="troubleshooting" label="Troubleshooting">
|
||||
|
||||
<field name="memory_limit_text"
|
||||
type="statictext"
|
||||
label="WP Memory Limit: [memory_limit]">
|
||||
</field>
|
||||
|
||||
<field name="memory_limit_text_desc"
|
||||
type="statictext"
|
||||
label="In case of insufficient memory, you can increase WordPress memory limit wp config file (wp-config.php)">
|
||||
</field>
|
||||
|
||||
<field name="enable_memory_usage_test"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Enable Memory Usage Test"
|
||||
description="Use it when you have some memory crash. <br> When enabling it it will log every addon and field register operation <br> and sugniffically slow down the editor work. Use it only for testing and turn it off after.">
|
||||
</field>
|
||||
|
||||
<field name="memory_usage_button"
|
||||
type="button"
|
||||
value="Show Memory Usage Log"
|
||||
gotoview="troubleshooting-memory-usage"
|
||||
label="Show last memory usage log <br> Run it after the editor run with the memory test"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field name="before_disable_post_content_filters"
|
||||
type="hr">
|
||||
</field>
|
||||
|
||||
<field name="disable_post_content_filters"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Disable post content output filters"
|
||||
description="Sometimes post content filters causing memory errors. Disabling them can make the page load in case stucked pages">
|
||||
</field>
|
||||
|
||||
<field name="before_show_php_message"
|
||||
type="hr">
|
||||
</field>
|
||||
|
||||
<field name="show_php_error"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Show PHP Error Message"
|
||||
description="Use it when you see some text about php error and want to see it.">
|
||||
</field>
|
||||
|
||||
<field name="enable_display_errors_ajax"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Enable Display Errors on Ajax"
|
||||
description="Enable display PHP errors and notices on ajax request.">
|
||||
</field>
|
||||
|
||||
<field name="disable_deprecated_warnings"
|
||||
type="boolean"
|
||||
default="false"
|
||||
label="Disable Deprecated Warnings"
|
||||
description="Disable deprecated warnings in wordpress on plugin load. Usefull sometimes to make things load, please turn it off after test.">
|
||||
</field>
|
||||
|
||||
<field type="control" parent="enable_memory_usage_test" child="memory_usage_button" ctype="show" value="true" />
|
||||
|
||||
<field name="troubleshooting-hr1"
|
||||
type="hr">
|
||||
</field>
|
||||
|
||||
<field name="text_overload"
|
||||
type="statictext"
|
||||
label="Overload Bug Test">
|
||||
</field>
|
||||
|
||||
<field name="text_overload_button"
|
||||
type="button"
|
||||
value="Run Test"
|
||||
gotoview="troubleshooting-overload"
|
||||
label="Test the server for overload bug, <br> run this test when the edit page get stuck for any reason <br> when the unlimited elements plugin is on."
|
||||
>
|
||||
</field>
|
||||
<field name="api-connectivity"
|
||||
type="hr">
|
||||
</field>
|
||||
<field name="text_api_connectivity"
|
||||
type="statictext"
|
||||
label="API Connectivity Test">
|
||||
</field>
|
||||
|
||||
<field name="text_connectivity_button"
|
||||
type="button"
|
||||
value="Run Test"
|
||||
gotoview="troubleshooting-connectivity"
|
||||
label="Test the api connectivity. Run it if you don't see any widgets inside the widgets catalog"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field name="phpinfo"
|
||||
type="hr">
|
||||
</field>
|
||||
<field name="text_phpinfo"
|
||||
type="statictext"
|
||||
label="Show PHP Info">
|
||||
</field>
|
||||
|
||||
<field name="text_phpinfo_button"
|
||||
type="button"
|
||||
value="Show PHP Info"
|
||||
gotoview="troubleshooting-phpinfo"
|
||||
label="Show the phpinfo - php server configuration table"
|
||||
>
|
||||
</field>
|
||||
|
||||
<field name="text_globals"
|
||||
type="statictext"
|
||||
label="Show Globals">
|
||||
</field>
|
||||
|
||||
|
||||
<field name="text_globals_button"
|
||||
type="button"
|
||||
value="Show Globals"
|
||||
gotoview="troubleshooting-globals"
|
||||
label="Show the global variables of the plugin, like base url and path"
|
||||
>
|
||||
</field>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
</fields>
|
||||
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
class UCEmptyTemplate{
|
||||
|
||||
const SHOW_DEBUG = false;
|
||||
|
||||
private $templateID;
|
||||
private $isMultiple = false;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* construct
|
||||
*/
|
||||
public function __construct(){
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* put error message
|
||||
*/
|
||||
private function putErrorMessage($message = null){
|
||||
|
||||
if(self::SHOW_DEBUG == true)
|
||||
dmp($message);
|
||||
|
||||
dmp("no output");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* render header debug
|
||||
*/
|
||||
private function renderHeader(){
|
||||
?>
|
||||
<header class="site-header">
|
||||
<p class="site-title">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<?php bloginfo( 'name' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
|
||||
</header>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* render regular post body
|
||||
*/
|
||||
private function renderRegularBody(){
|
||||
|
||||
$this->renderHeader();
|
||||
|
||||
if ( have_posts() ) :
|
||||
|
||||
while ( have_posts() ) :
|
||||
|
||||
the_post();
|
||||
the_content();
|
||||
|
||||
endwhile;
|
||||
endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* validate that template exists
|
||||
*/
|
||||
private function validateTemplateExists(){
|
||||
|
||||
if(empty($this->templateID))
|
||||
UniteFunctionsUC::throwError("no template found");
|
||||
|
||||
$template = get_post($this->templateID);
|
||||
if(empty($template))
|
||||
UniteFunctionsUC::throwError("template not found");
|
||||
|
||||
$postType = $template->post_type;
|
||||
|
||||
if($postType != "elementor_library")
|
||||
UniteFunctionsUC::throwError("bad template");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* render header part
|
||||
*/
|
||||
private function renderHeaderPart(){
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="profile" href="https://gmpg.org/xfn/11">
|
||||
<?php wp_head(); ?>
|
||||
|
||||
<style>
|
||||
html{
|
||||
margin:0px !important;
|
||||
padding:0px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* render footer part
|
||||
*/
|
||||
private function renderFooter(){
|
||||
|
||||
wp_footer();
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* render template
|
||||
*/
|
||||
private function renderTemplate(){
|
||||
|
||||
if(is_singular() == false)
|
||||
UniteFunctionsUC::throwError("not singlular");
|
||||
|
||||
UniteFunctionsUC::validateNumeric($this->templateID,"template id");
|
||||
|
||||
$this->validateTemplateExists();
|
||||
|
||||
$content = HelperProviderCoreUC_EL::getElementorTemplate($this->templateID, true);
|
||||
|
||||
$this->renderHeaderPart();
|
||||
|
||||
//$this->renderRegularBody();
|
||||
|
||||
echo $content;
|
||||
|
||||
$this->renderFooter();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* check and output debug
|
||||
*/
|
||||
private function checkOutputDebug(){
|
||||
|
||||
$isDebug = UniteFunctionsUC::getGetVar("framedebug","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
|
||||
$isDebug = UniteFunctionsUC::strToBool($isDebug);
|
||||
|
||||
if($isDebug == false)
|
||||
return(false);
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
||||
.uc-debug-holder{
|
||||
display:flex;
|
||||
justify-content:center;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.uc-debug-holder button{
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.uc-template-index{
|
||||
position:absolute;
|
||||
top:10px;
|
||||
left:10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="uc-debug-holder">
|
||||
|
||||
<div id="debug_index" class="uc-template-index"></div>
|
||||
|
||||
<button id="debug_button_prev">Prev</button>
|
||||
|
||||
<button id="debug_button_next">Next</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function trace(str){
|
||||
console.log(str);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
function setTemplateIndex(){
|
||||
|
||||
var total = jQuery(".uc-template-holder").length;
|
||||
|
||||
var active = jQuery(".uc-template-holder").not(".uc-template-hidden").index();
|
||||
|
||||
active++;
|
||||
|
||||
var text = active + " / " + total;
|
||||
|
||||
jQuery("#debug_index").html(text);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//set some item active
|
||||
function setActive(dir){
|
||||
|
||||
var objActiveTemplate = jQuery(".uc-template-holder").not(".uc-template-hidden");
|
||||
|
||||
if(objActiveTemplate.length != 1){
|
||||
|
||||
trace(objActiveTemplate);
|
||||
throw new Error("Wrong active template");
|
||||
}
|
||||
|
||||
if(dir == "prev")
|
||||
var objNextTemplate = objActiveTemplate.prev();
|
||||
else
|
||||
var objNextTemplate = objActiveTemplate.next();
|
||||
|
||||
if(objNextTemplate.length == 0)
|
||||
return(false);
|
||||
|
||||
objActiveTemplate.hide().addClass("uc-template-hidden");
|
||||
|
||||
objNextTemplate.show().removeClass("uc-template-hidden");
|
||||
|
||||
|
||||
//clone the template tag
|
||||
|
||||
var nextTemplateElement = objNextTemplate.children("template");
|
||||
|
||||
if(nextTemplateElement.length){
|
||||
|
||||
objNextTemplate.removeClass("uc-not-inited");
|
||||
|
||||
if(objNextTemplate.length > 1){
|
||||
|
||||
trace(objNextTemplate);
|
||||
throw new Error("wrong next template");
|
||||
|
||||
}
|
||||
|
||||
|
||||
var clonedContent = nextTemplateElement[0].content.cloneNode(true);
|
||||
objNextTemplate.append(clonedContent);
|
||||
|
||||
nextTemplateElement.remove();
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
jQuery("body").trigger("uc_dom_updated");
|
||||
|
||||
}, 300);
|
||||
|
||||
}
|
||||
|
||||
setTemplateIndex();
|
||||
}
|
||||
|
||||
jQuery("#debug_button_next").on("click",function(){
|
||||
|
||||
setActive("next");
|
||||
|
||||
});
|
||||
|
||||
jQuery("#debug_button_prev").on("click",function(){
|
||||
|
||||
setActive("prev");
|
||||
|
||||
});
|
||||
|
||||
setTemplateIndex();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* render multiple template for templates widget output
|
||||
*/
|
||||
private function renderMultipleTemplates(){
|
||||
|
||||
$this->isMultiple = true;
|
||||
|
||||
$arrTemplates = explode(",", $this->templateID);
|
||||
|
||||
UniteFunctionsUC::validateIDsList($this->templateID,"template ids");
|
||||
|
||||
$content = "";
|
||||
|
||||
foreach($arrTemplates as $index => $templateID){
|
||||
|
||||
$urlTemplate = UniteFunctionsWPUC::getPermalink($templateID);
|
||||
|
||||
//render in hidden mode
|
||||
|
||||
$isHidden = false;
|
||||
|
||||
if($index > 0){
|
||||
|
||||
GlobalsProviderUC::$renderJSForHiddenContent = true;
|
||||
$isHidden = true;
|
||||
|
||||
}
|
||||
|
||||
$output = HelperProviderCoreUC_EL::getElementorTemplate($templateID, true);
|
||||
|
||||
//set hidden content
|
||||
|
||||
$class = "";
|
||||
if($isHidden == true){
|
||||
|
||||
$class = " uc-template-hidden uc-not-inited";
|
||||
|
||||
$output = "\n\n<template>\n$output\n</template>\n\n";
|
||||
}
|
||||
|
||||
if(empty($output))
|
||||
$output = "template $templateID not found";
|
||||
|
||||
$urlTemplate = esc_attr($urlTemplate);
|
||||
|
||||
$content .= "<div id='uc_template_$templateID' class='uc-template-holder{$class}' data-id='$templateID' data-link='$urlTemplate'>$output</div>";
|
||||
|
||||
GlobalsProviderUC::$renderJSForHiddenContent = false;
|
||||
|
||||
}
|
||||
|
||||
//don't know why, but it's not working. need to remove this dependency
|
||||
|
||||
UniteFunctionsWPUC::removeIncludeScriptDep("elementor-frontend");
|
||||
|
||||
$this->renderHeaderPart();
|
||||
|
||||
//check debug
|
||||
|
||||
$isDebug = $this->checkOutputDebug();
|
||||
|
||||
//$this->renderRegularBody();
|
||||
if($isDebug == true)
|
||||
echo "<div class='uc-debug-templates-wrapper'>";
|
||||
|
||||
echo $content;
|
||||
|
||||
if($isDebug == true)
|
||||
echo "</div>";
|
||||
|
||||
|
||||
$this->renderFooter();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* init the template
|
||||
*/
|
||||
private function init(){
|
||||
|
||||
try{
|
||||
|
||||
show_admin_bar(false);
|
||||
|
||||
$renderTemplateID = UniteFunctionsUC::getGetVar("ucrendertemplate","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
|
||||
|
||||
$isMultiple = UniteFunctionsUC::getGetVar("multiple","",UniteFunctionsUC::SANITIZE_TEXT_FIELD);
|
||||
$isMultiple = UniteFunctionsUC::strToBool($isMultiple);
|
||||
|
||||
if(empty($renderTemplateID))
|
||||
UniteFunctionsUC::throwError("template id not found");
|
||||
|
||||
$this->templateID = $renderTemplateID;
|
||||
|
||||
if($isMultiple == true)
|
||||
$this->renderMultipleTemplates();
|
||||
else{
|
||||
|
||||
$this->renderTemplate();
|
||||
}
|
||||
|
||||
|
||||
}catch(Exception $e){
|
||||
|
||||
$message = $e->getMessage();
|
||||
|
||||
$this->putErrorMessage($message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new UCEmptyTemplate();
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
require HelperUC::getPathViewObject("addons_view.class");
|
||||
|
||||
|
||||
class UniteCreatorAddonsElementorView extends UniteCreatorAddonsView{
|
||||
|
||||
protected $showButtons = true;
|
||||
protected $showHeader = false;
|
||||
protected $pluginTitle = null;
|
||||
|
||||
|
||||
/**
|
||||
* get header text
|
||||
* @return unknown
|
||||
*/
|
||||
protected function getHeaderText(){
|
||||
|
||||
$headerTitle = esc_html__("Manage Widgets for Elementor", "unlimited-elements-for-elementor");
|
||||
|
||||
return($headerTitle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addons view provider
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->addonType = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR;
|
||||
$this->product = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
$this->pluginTitle = GlobalsUnlimitedElements::PLUGIN_TITLE;
|
||||
$this->headerTextInner = __("Widgets", "unlimited-elements-for-elementor");
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new UniteCreatorAddonsElementorView();
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
require HelperUC::getPathViewObject("addons_view.class");
|
||||
|
||||
|
||||
class UniteCreatorAddonsBackgroundsView extends UniteCreatorAddonsView{
|
||||
|
||||
protected $showButtons = true;
|
||||
protected $showHeader = false;
|
||||
protected $pluginTitle = null;
|
||||
|
||||
|
||||
/**
|
||||
* get header text
|
||||
* @return unknown
|
||||
*/
|
||||
protected function getHeaderText(){
|
||||
|
||||
$headerTitle = esc_html__("Manage Background Widgets", "unlimited-elements-for-elementor");
|
||||
|
||||
return($headerTitle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addons view provider
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->addonType = GlobalsUC::ADDON_TYPE_BGADDON;
|
||||
$this->product = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
$this->pluginTitle = GlobalsUnlimitedElements::PLUGIN_TITLE;
|
||||
$this->headerTextInner = __("Background Widgets", "unlimited-elements-for-elementor");
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new UniteCreatorAddonsBackgroundsView();
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author unlimited-elements.com
|
||||
* @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
|
||||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* */
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
require HelperUC::getPathViewObject("activation_view.class");
|
||||
|
||||
|
||||
class UnlimitedElementsLicenceView extends UniteCreatorActivationView{
|
||||
|
||||
/**
|
||||
* init by upress
|
||||
*/
|
||||
private function initByUpress(){
|
||||
|
||||
$this->codeType = self::CODE_TYPE_UPRESS;
|
||||
|
||||
$this->textUnleash = esc_html__("Activate Unlimited Elements Plugin UPress version", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->textGoPro = __("Activate In UPress","unlimited-elements-for-elementor");
|
||||
|
||||
$this->textDontHave = null;
|
||||
|
||||
$this->textLinkToBuy = null;
|
||||
|
||||
$this->textPasteActivationKey = null;
|
||||
|
||||
$this->showCodeInput = false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* init by envato
|
||||
*/
|
||||
private function initByEnvato(){
|
||||
|
||||
$this->codeType = self::CODE_TYPE_ENVATO;
|
||||
$this->textPasteActivationKey = esc_html__("Paste your envato activation key here", "unlimited-elements-for-elementor");
|
||||
|
||||
$urlActivation = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR);
|
||||
|
||||
//$this->textSwitchTo = "For back to regular activation <br>
|
||||
//<a href='$urlActivation'>Click Here</a>
|
||||
//";
|
||||
|
||||
$this->textDontHave = __("The activation key (product key) is located in <br> downloads section in CodeCanyon.","unlimited-elements-for-elementor");
|
||||
|
||||
$this->textLinkToBuy = null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* put popup form
|
||||
*/
|
||||
protected function putPopupForm(){
|
||||
|
||||
if($this->codeType == self::CODE_TYPE_ENVATO || $this->codeType == self::CODE_TYPE_UPRESS){
|
||||
parent::putPopupForm();
|
||||
return(false);
|
||||
}
|
||||
|
||||
?>
|
||||
<span class="activate-license unlimited_elements_for_elementor">
|
||||
|
||||
<a href="javascript:void(0)" class='uc-button-activate'><?php echo esc_attr($this->textActivate)?></a>
|
||||
</span>
|
||||
<br>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* init by freemius
|
||||
*/
|
||||
private function initByFreemius(){
|
||||
|
||||
$this->codeType = self::CODE_TYPE_FREEMIUS;
|
||||
$this->simpleButtonMode = true;
|
||||
$this->simpleButtonCssClass = "";
|
||||
|
||||
$urlCCodecanyon = HelperUC::getViewUrl(GlobalsUnlimitedElements::VIEW_LICENSE_ELEMENTOR, "envato=true");
|
||||
|
||||
$this->textSwitchTo = "Have old codecanyon activation key? <br>
|
||||
<a href='$urlCCodecanyon'>Go here</a> and activate
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
parent::__construct();
|
||||
|
||||
//$isEnvato = UniteFunctionsUC::getGetVar("envato", "", UniteFunctionsUC::SANITIZE_TEXT_FIELD);
|
||||
//$isEnvato = UniteFunctionsUC::strToBool($isEnvato);
|
||||
|
||||
$this->textActivate = esc_html__("Activate Unlimited Elements", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->urlPricing = GlobalsUnlimitedElements::LINK_BUY;
|
||||
|
||||
$this->textPlaceholder = esc_html__("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","unlimited-elements-for-elementor");
|
||||
|
||||
$this->textUnleash = esc_html__("Unleash access to +700 widgets for Elementor", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->textAndTemplates = "";
|
||||
//$this->textPasteActivationKey = esc_html__("Paste your envato activation key here", "unlimited-elements-for-elementor");
|
||||
|
||||
$this->textDontHaveLogin = "";
|
||||
|
||||
$type = "envato";
|
||||
if(defined("UNLIMITED_ELEMENTS_UPRESS_VERSION"))
|
||||
$type = "upress";
|
||||
|
||||
switch($type){
|
||||
case "freemius":
|
||||
$this->initByFreemius();
|
||||
break;
|
||||
case "envato":
|
||||
$this->initByEnvato();
|
||||
break;
|
||||
case "upress":
|
||||
$this->initByUpress();
|
||||
break;
|
||||
default:
|
||||
UniteFunctionsUC::throwError("Wrong type");
|
||||
break;
|
||||
}
|
||||
|
||||
$this->isExpireEnabled = false;
|
||||
$this->product = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
|
||||
|
||||
$this->textYourProAccountLifetime = esc_html__("Unlimited Elements is activated lifetime for this site!", "unlimited-elements-for-elementor");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put header html
|
||||
*/
|
||||
protected function putHeaderHtml(){
|
||||
|
||||
$headerTitle = esc_html__(" License", "unlimited-elements-for-elementor");
|
||||
|
||||
require HelperUC::getPathTemplate("header");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put freemius scripts
|
||||
*/
|
||||
private function putFsScripts(){
|
||||
|
||||
$moduleID = GlobalsUnlimitedElements::FREEMIUS_PLUGIN_ID;
|
||||
|
||||
$vars = array(
|
||||
'id' => $moduleID,
|
||||
);
|
||||
|
||||
fs_require_template( 'forms/license-activation.php', $vars );
|
||||
fs_require_template( 'forms/resend-key.php', $vars );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put upress active message
|
||||
*/
|
||||
private function putUpressMessage($isActive){
|
||||
|
||||
if($isActive == true){
|
||||
$message = __("The Unlimited Elements UPress license is active","unlimited-elements-for-elementor");
|
||||
$class = "uc-license-message-active";
|
||||
}
|
||||
else{
|
||||
$class = "uc-license-message-notactive";
|
||||
$message = __("The Unlimited Elements UPress license is not active","unlimited-elements-for-elementor");
|
||||
}
|
||||
?>
|
||||
|
||||
<h2 class="<?php echo $class?>">
|
||||
<?php echo $message?>
|
||||
</h2>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* put html deactivation
|
||||
*/
|
||||
public function putHtmlDeactivate(){
|
||||
|
||||
if($this->codeType == self::CODE_TYPE_UPRESS){
|
||||
$this->putUpressMessage(true);
|
||||
return(false);
|
||||
}
|
||||
|
||||
$isActiveByFreemius = HelperProviderUC::isActivatedByFreemius();
|
||||
|
||||
if($isActiveByFreemius == false){
|
||||
parent::putHtmlDeactivate();
|
||||
return(false);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h2>
|
||||
|
||||
Your license has been activated for this site.
|
||||
|
||||
</h2>
|
||||
|
||||
<br>
|
||||
|
||||
<span class="activate-license unlimited_elements_for_elementor">
|
||||
|
||||
<a href="javascript:void(0)" class="unite-button-primary"><?php _e("Change License", "unlimited-elements-for-elementor")?></a>
|
||||
</span>
|
||||
<br>
|
||||
<br>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* put the view
|
||||
*/
|
||||
public function display(){
|
||||
|
||||
$this->putHeaderHtml();
|
||||
|
||||
$webAPI = new UniteCreatorWebAPI();
|
||||
|
||||
if(!empty($this->product))
|
||||
$webAPI->setProduct($this->product);
|
||||
|
||||
$isActive = $webAPI->isProductActive();
|
||||
|
||||
|
||||
?>
|
||||
<div class="unite-content-wrapper">
|
||||
<?php
|
||||
|
||||
if($isActive == true) //active
|
||||
$this->putHtmlDeactivate();
|
||||
else{ //not active
|
||||
|
||||
if($this->codeType == self::CODE_TYPE_UPRESS)
|
||||
$this->putUpressMessage(false);
|
||||
else
|
||||
$this->putActivationHtml();
|
||||
}
|
||||
|
||||
$this->putJSInit();
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if($this->codeType == self::CODE_TYPE_FREEMIUS)
|
||||
$this->putFSScripts();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//require "licensefs.php";
|
||||
|
||||
$objLicense = new UnlimitedElementsLicenceView();
|
||||
$objLicense->display();
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Unlimited Elements
|
||||
* @author unlimited-elements.com
|
||||
* @copyright (C) 2021 Unlimited Elements, All Rights Reserved.
|
||||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
||||
* */
|
||||
defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
|
||||
|
||||
|
||||
require HelperUC::getPathViewObject("settings_view.class");
|
||||
|
||||
class UniteCreatorViewElementorSettings extends UniteCreatorSettingsView{
|
||||
|
||||
/**
|
||||
* remove the consolidate addons settings if set to false
|
||||
*/
|
||||
private function modifyConsolidateAddonsSetting(UniteCreatorSettings $objSettings){
|
||||
|
||||
$setting = $objSettings->getSettingByName("consolidate_addons");
|
||||
|
||||
$value = UniteFunctionsUC::getVal($setting, "value");
|
||||
|
||||
$value = UniteFunctionsUC::strToBool($value);
|
||||
|
||||
//if set to true - don't touch
|
||||
if($value == true)
|
||||
return($objSettings);
|
||||
|
||||
$objSettings->removeSetting("consolidate_addons");
|
||||
|
||||
return($objSettings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* modify custom settings - function for override
|
||||
*/
|
||||
protected function modifyCustomSettings($objSettings){
|
||||
|
||||
$objSettings = HelperProviderUC::modifyGeneralSettings_memoryLimit($objSettings);
|
||||
|
||||
$objSettings = $this->modifyConsolidateAddonsSetting($objSettings);
|
||||
|
||||
//show the setting that was hidden in first place
|
||||
if(GlobalsUC::$inDev == true) //dynamic visibility
|
||||
$objSettings->updateSettingProperty("enable_dynamic_visibility", "hidden", "false");
|
||||
|
||||
if(GlobalsUnlimitedElements::$enableForms == false){
|
||||
$objSettings->hideSetting("enable_form_entries");
|
||||
$objSettings->hideSetting("save_form_logs");
|
||||
|
||||
$objSettings->hideSap("forms");
|
||||
}
|
||||
|
||||
if(GlobalsUnlimitedElements::$enableGoogleAPI == false){
|
||||
|
||||
$objSettings->hideSetting("google_connect_heading");
|
||||
$objSettings->hideSetting("google_connect_desc");
|
||||
$objSettings->hideSetting("google_connect_integration");
|
||||
|
||||
$objSettings->hideSetting("google_api_heading");
|
||||
$objSettings->hideSetting("google_api_key");
|
||||
}
|
||||
|
||||
if(GlobalsUnlimitedElements::$enableWeatherAPI == false){
|
||||
$objSettings->hideSetting("openweather_api_heading");
|
||||
$objSettings->hideSetting("openweather_api_key");
|
||||
}
|
||||
|
||||
if(GlobalsUnlimitedElements::$enableCurrencyAPI == false){
|
||||
$objSettings->hideSetting("exchangerate_api_heading");
|
||||
$objSettings->hideSetting("exchangerate_api_key");
|
||||
}
|
||||
|
||||
$isWpmlExists = UniteCreatorWpmlIntegrate::isWpmlExists();
|
||||
|
||||
//enable wpml integration settings
|
||||
if($isWpmlExists == true){
|
||||
|
||||
$objSettings->updateSettingProperty("wpml_heading", "hidden", "false");
|
||||
$objSettings->updateSettingProperty("wpml_button", "hidden", "false");
|
||||
|
||||
}
|
||||
|
||||
return($objSettings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->headerTitle = esc_html__("General Settings", "unlimited-elements-for-elementor");
|
||||
$this->isModeCustomSettings = true;
|
||||
$this->customSettingsXmlFile = HelperProviderCoreUC_EL::$filepathGeneralSettings;
|
||||
$this->customSettingsKey = "unlimited_elements_general_settings";
|
||||
|
||||
|
||||
//set settings
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
new UniteCreatorViewElementorSettings();
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
require HelperUC::getPathViewObject("addons_view.class");
|
||||
|
||||
|
||||
class UniteCreatorAddonsElementorView extends UniteCreatorAddonsView{
|
||||
|
||||
protected $showButtons = true;
|
||||
protected $showHeader = true;
|
||||
protected $pluginTitle = null;
|
||||
|
||||
|
||||
/**
|
||||
* get header text
|
||||
* @return unknown
|
||||
*/
|
||||
protected function getHeaderText(){
|
||||
|
||||
$headerTitle = esc_html__("Manage SVG Shapes", "unlimited-elements-for-elementor");
|
||||
|
||||
return($headerTitle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addons view provider
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->addonType = GlobalsUC::ADDON_TYPE_SHAPES;
|
||||
$this->product = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
$this->pluginTitle = GlobalsUnlimitedElements::PLUGIN_TITLE;
|
||||
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new UniteCreatorAddonsElementorView();
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
//no direct accees
|
||||
defined ('UNLIMITED_ELEMENTS_INC') or die ('restricted aceess');
|
||||
|
||||
require HelperUC::getPathViewObject("addons_view.class");
|
||||
|
||||
|
||||
class UniteCreatorAddonsElementorView extends UniteCreatorAddonsView{
|
||||
|
||||
protected $showButtons = true;
|
||||
protected $showHeader = false;
|
||||
protected $pluginTitle = null;
|
||||
|
||||
|
||||
/**
|
||||
* get header text
|
||||
* @return unknown
|
||||
*/
|
||||
protected function getHeaderText(){
|
||||
|
||||
$headerTitle = esc_html__("Manage Templates for Elementor", "unlimited-elements-for-elementor");
|
||||
|
||||
return($headerTitle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* addons view provider
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
$this->addonType = GlobalsUnlimitedElements::ADDONSTYPE_ELEMENTOR_TEMPLATE;
|
||||
$this->product = GlobalsUnlimitedElements::PLUGIN_NAME;
|
||||
$this->pluginTitle = GlobalsUnlimitedElements::PLUGIN_TITLE;
|
||||
$this->headerTextInner = __("Elementor Templates", "unlimited-elements-for-elementor");
|
||||
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new UniteCreatorAddonsElementorView();
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
try{
|
||||
|
||||
//-------------------------------------------------------------
|
||||
|
||||
//load core plugins
|
||||
|
||||
$pathCorePlugins = dirname(__FILE__)."/plugins/";
|
||||
|
||||
$pathUnlimitedElementsPlugin = $pathCorePlugins."unlimited_elements/plugin.php";
|
||||
require_once $pathUnlimitedElementsPlugin;
|
||||
|
||||
$pathCreateAddonsPlugin = $pathCorePlugins."create_addons/plugin.php";
|
||||
require_once $pathCreateAddonsPlugin;
|
||||
|
||||
if(is_admin()){ //load admin part
|
||||
|
||||
do_action(GlobalsProviderUC::ACTION_RUN_ADMIN);
|
||||
|
||||
|
||||
}else{ //load front part
|
||||
|
||||
do_action(GlobalsProviderUC::ACTION_RUN_FRONT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}catch(Exception $e){
|
||||
$message = $e->getMessage();
|
||||
$trace = $e->getTraceAsString();
|
||||
echo "Error: <b>".$message."</b>";
|
||||
|
||||
if(GlobalsUC::$SHOW_TRACE == true)
|
||||
dmp($trace);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,282 @@
|
||||
Freemius WordPress SDK
|
||||
======================
|
||||
|
||||
Welcome to the official repository for the Freemius SDK! Adding the SDK to your WordPress plugin, theme, or add-ons, enables all the benefits that come with using the [Freemius platform](https://freemius.com) such as:
|
||||
|
||||
* [Software Licensing](https://freemius.com/wordpress/software-licensing/)
|
||||
* [Secure Checkout](https://freemius.com/wordpress/checkout/)
|
||||
* [Subscriptions](https://freemius.com/wordpress/recurring-payments-subscriptions/)
|
||||
* [Automatic Updates](https://freemius.com/wordpress/automatic-software-updates/)
|
||||
* [Seamless EU VAT](https://freemius.com/wordpress/collecting-eu-vat-europe/)
|
||||
* [Cart Abandonment Recovery](https://freemius.com/wordpress/cart-abandonment-recovery/)
|
||||
* [Affiliate Platform](https://freemius.com/wordpress/affiliate-platform/)
|
||||
* [Analytics & Usage Tracking](https://freemius.com/wordpress/insights/)
|
||||
* [User Dashboard](https://freemius.com/wordpress/user-dashboard/)
|
||||
|
||||
* [Monetization](https://freemius.com/wordpress/)
|
||||
* [Analytics](https://freemius.com/wordpress/insights/)
|
||||
* [More...](https://freemius.com/wordpress/features-comparison/)
|
||||
|
||||
Freemius truly empowers developers to create prosperous subscription-based businesses.
|
||||
|
||||
If you're new to Freemius then we recommend taking a look at our [Getting Started](https://freemius.com/help/documentation/getting-started/) guide first.
|
||||
|
||||
If you're a WordPress plugin or theme developer and are interested in monetizing with Freemius then you can [sign-up for a FREE account](https://dashboard.freemius.com/register/):
|
||||
|
||||
https://dashboard.freemius.com/register/
|
||||
|
||||
Once you have your account setup and are familiar with how it all works you're ready to begin [integrating Freemius](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/) into your WordPress product
|
||||
|
||||
You can see some of the existing WordPress.org plugins & themes that are already utilizing the power of Freemius here:
|
||||
|
||||
* https://profiles.wordpress.org/freemius/#content-plugins
|
||||
* https://includewp.com/freemius/#focus
|
||||
|
||||
## Code Documentation
|
||||
|
||||
You can find the SDK's documentation here:
|
||||
https://freemius.com/help/documentation/wordpress-sdk/
|
||||
|
||||
## Integrating & Initializing the SDK
|
||||
|
||||
As part of the integration process, you'll need to [add the latest version](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product) of the Freemius SDK into your WordPress project.
|
||||
|
||||
Then, when you've completed the [SDK integration form](https://freemius.com/help/documentation/getting-started/#fill_out_the_sdk_integration_form) a snippet of code is generated which you'll need to copy and paste into the top of your main plugin's PHP file, right after the plugin's header comment.
|
||||
|
||||
Note: For themes, this will be in the root `functions.php` file instead.
|
||||
|
||||
A typical SDK snippet will look similar to the following (your particular snippet may differ slightly depending on your integration):
|
||||
|
||||
```php
|
||||
if ( ! function_exists( 'my_prefix_fs' ) ) {
|
||||
// Create a helper function for easy SDK access.
|
||||
function my_prefix_fs() {
|
||||
global $my_prefix_fs;
|
||||
|
||||
if ( ! isset( $my_prefix_fs ) ) {
|
||||
// Include Freemius SDK.
|
||||
require_once dirname(__FILE__) . '/freemius/start.php';
|
||||
|
||||
$my_prefix_fs = fs_dynamic_init( array(
|
||||
'id' => '1234',
|
||||
'slug' => 'my-new-plugin',
|
||||
'premium_slug' => 'my-new-plugin-premium',
|
||||
'type' => 'plugin',
|
||||
'public_key' => 'pk_bAEfta69seKymZzmf2xtqq8QXHz9y',
|
||||
'is_premium' => true,
|
||||
// If your plugin is a serviceware, set this option to false.
|
||||
'has_premium_version' => true,
|
||||
'has_paid_plans' => true,
|
||||
'is_org_compliant' => true,
|
||||
'menu' => array(
|
||||
'slug' => 'my-new-plugin',
|
||||
'parent' => array(
|
||||
'slug' => 'options-general.php',
|
||||
),
|
||||
),
|
||||
// Set the SDK to work in a sandbox mode (for development & testing).
|
||||
// IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
|
||||
'secret_key' => 'sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE',
|
||||
) );
|
||||
}
|
||||
|
||||
return $my_prefix_fs;
|
||||
}
|
||||
|
||||
// Init Freemius.
|
||||
my_prefix_fs();
|
||||
// Signal that SDK was initiated.
|
||||
do_action( 'my_prefix_fs_loaded' );
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Usage example
|
||||
|
||||
You can call anySDK methods by prefixing them with the shortcode function for your particular plugin/theme (specified when completing the SDK integration form in the Developer Dashboard):
|
||||
|
||||
```php
|
||||
<?php my_prefix_fs()->get_upgrade_url(); ?>
|
||||
```
|
||||
|
||||
Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
|
||||
|
||||
```php
|
||||
<?php
|
||||
global $my_prefix_fs;
|
||||
$my_prefix_fs->get_account_url();
|
||||
?>
|
||||
```
|
||||
|
||||
There are many other SDK methods available that you can use to enhance the functionality of your WordPress product. Some of the more common use-cases are covered in the [Freemius SDK Gists](https://freemius.com/help/documentation/wordpress-sdk/gists/) documentation.
|
||||
|
||||
## Adding license based logic examples
|
||||
|
||||
Add marketing content to encourage your users to upgrade for your paid version:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_not_paying() ) {
|
||||
echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
|
||||
echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
|
||||
esc_html__('Upgrade Now!', 'my-plugin-slug') .
|
||||
'</a>';
|
||||
echo '</section>';
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be available in your premium plugin version:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
|
||||
// ... premium only logic ...
|
||||
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
|
||||
|
||||
```php
|
||||
<?php
|
||||
class My_Plugin {
|
||||
function init() {
|
||||
...
|
||||
|
||||
// This "if" block will be auto removed from the free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
// Init premium version.
|
||||
$this->admin_init__premium_only();
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
|
||||
}
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
// This method will be only included in the premium version.
|
||||
function admin_init__premium_only() {
|
||||
...
|
||||
}
|
||||
|
||||
// This method will be only included in the premium version.
|
||||
function admin_init_hook__premium_only() {
|
||||
...
|
||||
}
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be executed for customers in your 'professional' plan:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_plan('professional', true) ) {
|
||||
// .. logic related to Professional plan only ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be executed for customers in your 'professional' plan or higher plans:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_plan('professional') ) {
|
||||
// ... logic related to Professional plan and higher plans ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
|
||||
// ... logic related to Professional plan and higher plans ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic only for users in trial:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_trial() ) {
|
||||
// ... logic for users in trial ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic for specified paid plan:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
|
||||
|
||||
// ... logic related to Professional plan only ...
|
||||
|
||||
} else if ( my_prefix_fs()->is_plan( 'business' ) ) {
|
||||
|
||||
// ... logic related to Business plan and higher plans ...
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
## Excluding files and folders from the free plugin version
|
||||
There are [two ways](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/#excluding_files_and_folders_from_the_free_plugin_version) to exclude files from your free version.
|
||||
|
||||
1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all types of files, not only PHP.
|
||||
2. Add `@fs_premium_only` a special meta tag to the plugin's main PHP file header. Example:
|
||||
```php
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: My Very Awesome Plugin
|
||||
* Plugin URI: http://my-awesome-plugin.com
|
||||
* Description: Create and manage Awesomeness right in WordPress.
|
||||
* Version: 1.0.0
|
||||
* Author: Awesomattic
|
||||
* Author URI: http://my-awesome-plugin.com/me/
|
||||
* License: GPLv2
|
||||
* Text Domain: myplugin
|
||||
* Domain Path: /langs
|
||||
*
|
||||
* @fs_premium_only /lib/functions.php, /premium-files/
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// ... my code ...
|
||||
?>
|
||||
```
|
||||
In the example plugin header above, the file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
|
||||
|
||||
# WordPress.org Compliance
|
||||
Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
|
||||
> All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
|
||||
|
||||
Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or use [some of the other methods](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/) provided by the SDK to exclude premium features & files from the free version.
|
||||
|
||||
## Deployment
|
||||
Zip your Freemius product’s root folder and [upload it in the Deployment section](https://freemius.com/help/documentation/selling-with-freemius/deployment/) in the *Freemius Developer's Dashboard*.
|
||||
The plugin/theme will automatically be scanned and processed by a custom-developed *PHP Processor* which will auto-generate two versions of your plugin:
|
||||
|
||||
1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
|
||||
2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
|
||||
|
||||
The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org compliant and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
|
||||
|
||||
## License
|
||||
Copyright (c) Freemius®, Inc.
|
||||
|
||||
Licensed under the GNU general public license (version 3).
|
||||
@@ -0,0 +1 @@
|
||||
#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:"✓";margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}/*# sourceMappingURL=affiliation.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
@media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}/*# sourceMappingURL=checkout.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
.fs-notice[data-id^=clone_resolution_options_notice]{padding:0;color:inherit !important}.fs-notice[data-id^=clone_resolution_options_notice] .fs-notice-body{padding:0;margin-bottom:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-notice-header{padding:5px 10px}.fs-notice[data-id^=clone_resolution_options_notice] ol{margin-top:0;margin-bottom:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-options-container{display:flex;flex-direction:row;padding:0 10px 10px}@media(max-width: 750px){.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-options-container{flex-direction:column}}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option{border:1px solid #ccc;padding:10px 10px 15px 10px;flex:auto;margin:5px}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option:first-child{margin-left:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option:last-child{margin-right:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option strong{font-size:1.2em;padding:2px;line-height:1.5em}.fs-notice[data-id^=clone_resolution_options_notice] a{text-decoration:none}.fs-notice[data-id^=clone_resolution_options_notice] .button{margin-right:10px}.rtl .fs-notice[data-id^=clone_resolution_options_notice] .button{margin-right:0;margin-left:10px}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-documentation-container{padding:0 10px 15px}.fs-notice[data-id=temporary_duplicate_notice] #fs_clone_resolution_error_message{border:1px solid #d3135a;background:#fee;color:#d3135a;padding:10px}.fs-notice[data-id=temporary_duplicate_notice] ol{margin-top:0}.fs-notice[data-id=temporary_duplicate_notice] a{position:relative}.fs-notice[data-id=temporary_duplicate_notice] a:focus{box-shadow:none}.fs-notice[data-id=temporary_duplicate_notice] a.disabled{color:gray}.fs-notice[data-id=temporary_duplicate_notice] a .fs-ajax-spinner{position:absolute;left:8px;right:0;top:-1px;bottom:0;margin-left:100%}/*# sourceMappingURL=clone-resolution.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}/*# sourceMappingURL=debug.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
.fs-notice[data-id^=gdpr_optin_actions] .underlined{text-decoration:underline}.fs-notice[data-id^=gdpr_optin_actions] ul .button,.fs-notice[data-id^=gdpr_optin_actions] ul .action-description{vertical-align:middle}.fs-notice[data-id^=gdpr_optin_actions] ul .action-description{display:inline-block;margin-left:3px}/*# sourceMappingURL=gdpr-optin-notice.css.map */
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1 @@
|
||||
.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .dashicons{float:none !important}.fs-tooltip-trigger .fs-tooltip{opacity:0;visibility:hidden;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;position:absolute;background:rgba(0,0,0,.8);color:#fff !important;font-family:"arial",serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:-17px;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2);line-height:1.3em;font-weight:bold;text-align:left;text-transform:none !important}.rtl .fs-tooltip-trigger .fs-tooltip{text-align:right;left:auto;right:-17px}.fs-tooltip-trigger .fs-tooltip::after{content:" ";display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:rgba(0,0,0,.8) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);position:absolute;top:100%;left:21px}.rtl .fs-tooltip-trigger .fs-tooltip::after{right:21px;left:auto}.fs-tooltip-trigger:hover .fs-tooltip{visibility:visible;opacity:1}.fs-permissions .fs-permission.fs-disabled{color:#aaa}.fs-permissions .fs-permission.fs-disabled .fs-permission-description span{color:#aaa}.fs-permissions .fs-permission .fs-switch-feedback{position:absolute;right:15px;top:52px}.fs-permissions ul{height:0;overflow:hidden;margin:0}.fs-permissions ul li{padding:17px 15px;margin:0;position:relative}.fs-permissions ul li>i.dashicons{float:left;font-size:30px;width:30px;height:30px;padding:5px}.fs-permissions ul li .fs-switch{float:right}.fs-permissions ul li .fs-permission-description{margin-left:55px}.fs-permissions ul li .fs-permission-description span{font-size:14px;font-weight:500;color:#23282d}.fs-permissions ul li .fs-permission-description .fs-tooltip{font-size:13px;font-weight:bold}.fs-permissions ul li .fs-permission-description .fs-tooltip-trigger .dashicons{margin:-1px 2px 0 2px}.fs-permissions ul li .fs-permission-description p{margin:2px 0 0 0}.fs-permissions.fs-open{background:#fff}.fs-permissions.fs-open ul{overflow:initial;height:auto;margin:20px 0 10px 0}.fs-permissions .fs-switch-feedback .fs-ajax-spinner{margin-right:10px}.fs-permissions .fs-switch-feedback.success{color:#71ae00}.rtl .fs-permissions .fs-switch-feedback{right:auto;left:15px}.rtl .fs-permissions .fs-switch-feedback .fs-ajax-spinner{margin-left:10px;margin-right:0}.rtl .fs-permissions ul li .fs-permission-description{margin-right:55px;margin-left:0}.rtl .fs-permissions ul li .fs-switch{float:left}.rtl .fs-permissions ul li i.dashicons{float:right}.fs-modal-opt-out .fs-modal-footer .fs-opt-out-button{line-height:30px;margin-right:10px}.fs-modal-opt-out .fs-permissions{margin-top:0 !important}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-group-opt-out-button{float:right;line-height:1.1em}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-switch-feedback{float:right;line-height:1.1em;margin-right:10px}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-switch-feedback .fs-ajax-spinner{margin:-2px 0 0}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header-title{font-size:1.1em;font-weight:600;text-transform:uppercase;display:block;line-height:1.1em;margin:.5em 0}.fs-modal-opt-out .fs-permissions .fs-permissions-section--desc{margin-top:0}.fs-modal-opt-out .fs-permissions hr{border:0;border-top:#eee solid 1px;margin:25px 0 20px 0}.fs-modal-opt-out .fs-permissions ul{border:1px solid #c3c4c7;border-radius:3px;margin:10px 0 0 0;box-shadow:0 1px 1px rgba(0,0,0,.04)}.fs-modal-opt-out .fs-permissions ul li{border-bottom:1px solid #d7dde1;border-left:4px solid #72aee6}.rtl .fs-modal-opt-out .fs-permissions ul li{border-left:none;border-right:4px solid #72aee6}.fs-modal-opt-out .fs-permissions ul li.fs-disabled{border-left-color:rgba(114,174,230,0)}.fs-modal-opt-out .fs-permissions ul li:last-child{border-bottom:none}/*# sourceMappingURL=optout.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.wp-list-table.plugins .plugin-title span.fs-tag{display:inline-block;margin-left:5px;line-height:10px}/*# sourceMappingURL=plugins.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
#fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:"arial",serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:" ";display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}#customize-theme-controls #accordion-section-freemius_upsell{border-top:1px solid #0085ba !important;border-bottom:1px solid #0085ba !important}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title{color:#fff;background-color:#0085ba;border-left:4px solid #0085ba;transition:.15s background-color ease-in-out,.15s border-color ease-in-out;outline:none;border-bottom:none !important}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:hover{background-color:#008ec2;border-left-color:#0073aa}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:after{color:#fff}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title{border-left:none;border-right:4px solid #0085ba}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title:hover{border-right-color:#0073aa}/*# sourceMappingURL=customizer.css.map */
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 78 KiB |