| Server IP : 68.183.124.220 / Your IP : 216.73.216.141 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/ajax-search-lite/backend/settings/class/ |
Upload File : |
<?php
if (!class_exists("wpdreamsLabelPosition")) {
/**
* Class wpdreamsLabelPosition
*
* DEPRECATED
*
* @deprecated
* @package WPDreams/OptionsFramework/Classes
* @category Class
* @author Ernest Marcinko <ernest.marcinko@wp-dreams.com>
* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
* @copyright Copyright (c) 2014, Ernest Marcinko
*/
class wpdreamsLabelPosition extends wpdreamsType {
function __construct($name, $label, $width, $height, $data) {
$this->constraints = null;
$this->name = $name;
$this->label = $label;
$this->data = $data;
$this->width = $width;
$this->height = $height;
$this->ratio = 400 / $this->width;
$this->cheight = $this->ratio * $this->height;
self::$_instancenumber++;
$this->direction = "";
$this->duration = "";
$this->getType();
}
function getType() {
parent::getType();
$this->processData();
$inst = self::$_instancenumber;
echo "
<div class='labeldrag' id='labeldrag_" . $inst . "' style='height:" . ($this->cheight + 90) . "px;'>
<div class='inner' style='overflow:auto;width:400px;height:" . $this->cheight . "px;'>
<script>
jQuery(document).ready(function() {
var drag = jQuery('#" . $this->name . "_" . $inst . "').draggable({ containment: 'parent', refreshPositions: true, appendTo: 'body' });
jQuery('#" . $this->name . "_" . $inst . "').bind( 'dragstop', function(event, ui) {
var pos = drag.position();
var ratio = " . $this->ratio . ";
var hidden = jQuery('#labelposition_hidden_" . $inst . "');
var duration = jQuery('input[name=\"induration_" . $this->name . "\"]')[0];
var direction= jQuery('input[name=\"indirection_" . $this->name . "\"]').prev();
jQuery(hidden).val('duration:'+jQuery(duration).val()+';direction:'+jQuery(direction).val()+';position:'+((pos.top+5)/ratio)+'||'+((pos.left+5)/ratio)+';');
});
jQuery('#labeldrag_" . $inst . " input').keyup(function(){
jQuery('#" . $this->name . "_" . $inst . "').trigger('dragstop');
});
jQuery('#labeldrag_" . $inst . " select').change(function(){
jQuery('#" . $this->name . "_" . $inst . "').trigger('dragstop');
});
});
</script>
<div class='dragme' style='top:" . (($this->top * $this->ratio) - 5) . "px;left:" . (($this->left * $this->ratio) - 5) . "px;' id='" . $this->name . "_" . $inst . "'>
</div>
</div>
";
echo "<div style='margin-top:" . ($this->cheight + 10) . "px;'>";
new wpdreamsSelect("indirection_" . $this->name, "Animation direction", $this->_direction);
new wpdreamsText("induration_" . $this->name, "Animation duration (ms)", $this->duration);
echo "</div>";
echo "
</div>
<div style='clear:both'></div>
<input type='hidden' id='labelposition_hidden_" . $inst . "' name='" . $this->name . "' value='" . $this->data . "' />
";
echo "
";
}
function processData() {
// string: 'duration:123;direction:bottom-left;position:123||321;'
$this->data = str_replace("\n", "", $this->data);
preg_match("/duration:(.*?);/", $this->data, $matches);
$this->duration = $matches[1];
if ($this->duration == "")
$this->duration = 500;
preg_match("/direction:(.*?);/", $this->data, $matches);
$this->direction = $matches[1];
if ($this->direction == "")
$this->direction = "top-left";
$this->_direction = "
Top|top;
Bottom|bottom;
Left|left;
Right|right;
Bottom-Left|bottom-left;
Bottom-Right|bottom-right;
Top-Left|top-left;
Top-Right|top-right;
Random|random||
" . $this->direction;
preg_match("/position:(.*?);/", $this->data, $matches);
$this->position = $matches[1];
$_temp = explode("||", $this->position);
$this->top = $_temp[0];
$this->left = $_temp[1];
}
}
}