Ejemplo n.º 1
0
 static function render($slider, $id, $params)
 {
     $html = '';
     $shadowcss = $params->get('shadowcss', false);
     if ($shadowcss && $shadowcss != -1) {
         $displayclass = self::getDisplayClass($params->get('widgetshadowdisplay', '0|*|always|*|0|*|0'), false);
         list($style, $data) = self::getPosition($params->get('shadowposition', ''));
         $width = NextendParse::parse($params->get('shadowwidth', 'width'));
         if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') {
             $style .= 'width:' . $width . ';';
         } else {
             $data .= 'data-sswidth="' . $width . '" ';
         }
         $css = NextendCss::getInstance();
         $css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shadow' . DIRECTORY_SEPARATOR . 'style.css'));
         $info = pathinfo($shadowcss);
         $class = 'nextend-shadow nextend-shadow-' . basename($shadowcss, '.' . $info['extension']);
         $html .= '<div class="' . $displayclass . $class . '" style="line-height:0;' . $style . '" ' . $data . '><img src="' . (nextendIsWordpress() ? plugins_url('shadow/shadow/' . $info['basename'], __FILE__) : NextendUri::pathToUri(NextendFilesystem::getBasePath() . $shadowcss)) . '"/></div>';
     }
     return $html;
 }
Ejemplo n.º 2
0
 function subform()
 {
     $response = array();
     if (!isset($_POST['data'])) {
         echo json_encode(array('error' => 'Post not OK!'));
         exit;
     }
     if (get_magic_quotes_gpc() || nextendIsWordPress()) {
         $_POST['data'] = stripslashes($_POST['data']);
     }
     $data = json_decode($_POST['data'], true);
     $configurationXmlFile = rtrim(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $data['xml'];
     if (NextendFilesystem::fileexists($configurationXmlFile)) {
         nextendimport('nextend.css.css');
         nextendimport('nextend.javascript.javascript');
         $css = NextendCSS::getInstance();
         $js = NextendJavascript::getInstance();
         $js->loadLibrary('dojo');
         nextendimport('nextend.form.form');
         $form = new NextendForm();
         $form->loadArray($data['orig']);
         $form->loadArray(array($data['name'] => $data['value']));
         $form->loadXMLFile($configurationXmlFile);
         ob_start();
         $subform = $form->getSubform($data['tab'], $data['name']);
         $subform->initAjax($data['control_name']);
         echo $subform->renderForm();
         echo "<style>";
         echo $css->generateAjaxCSS($data['loadedCSS']);
         echo "</style>";
         $scripts = $js->generateAjaxJs($data['loadedJSS']);
         $html = ob_get_clean();
         $response = array('html' => $html, 'scripts' => $scripts);
     } else {
         $response = array('error' => 'Configuration file not found');
     }
     echo json_encode($response);
     exit;
 }
Ejemplo n.º 3
0
Archivo: uri.php Proyecto: 01J/bealtine
 static function pathToUri($path)
 {
     $i = NextendUri::getInstance();
     return $i->_baseuri . str_replace(array(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR), array('', '/'), str_replace('/', DIRECTORY_SEPARATOR, $path));
 }
Ejemplo n.º 4
0
 function addJsLibraryFile($file)
 {
     $file = NextendFilesystem::getBasePath() . NextendFilesystem::getLibraryPath() . 'javascript/modernizr/' . $file;
     $this->addJsFile($file);
 }
Ejemplo n.º 5
0
 function removeJsLibraryFile($file)
 {
     $file = NextendFilesystem::getBasePath() . NextendFilesystem::getLibraryPath() . 'javascript/jquery/1.9.1/' . $file;
     $this->removeJsFile($file);
 }
Ejemplo n.º 6
0
 function resizeImage($image, $w, $h)
 {
     $w = intval($w);
     $h = intval($h);
     $cachefile = $this->_folder . 'resize' . md5($image) . $w . '_' . $h . '.' . $this->_filetype;
     if (!NextendFilesystem::existsFile($cachefile)) {
         if ($image && $w >= 1 && $h >= 1) {
             if (strpos($image, 'http') === 0) {
                 //url
             } else {
                 if (!NextendFilesystem::existsFile($image)) {
                     $image = NextendFilesystem::getBasePath() . $image;
                 }
             }
             if (is_readable($image)) {
                 $orig = null;
                 switch (exif_imagetype($image)) {
                     case IMAGETYPE_JPEG:
                         $orig = imagecreatefromjpeg($image);
                         break;
                     case IMAGETYPE_PNG:
                         $orig = imagecreatefrompng($image);
                         break;
                 }
                 if ($orig) {
                     $this->createIm($w, $h);
                     $ow = imagesx($orig);
                     $oh = imagesy($orig);
                     $ratioX = $ow / $w;
                     $ratioY = $oh / $h;
                     if ($ratioX > $ratioY) {
                         $ow = $ratioY * $w;
                     } else {
                         $oh = $ratioX * $h;
                     }
                     imagecopyresampled($this->_im, $orig, 0, 0, 0, 0, $w, $h, $ow, $oh);
                     $this->saveIm($cachefile);
                     imagedestroy($orig);
                     return NextendFilesystem::pathToAbsoluteURL($cachefile);
                 }
             } else {
                 return $image;
             }
         } else {
             return $image;
         }
     }
     return NextendFilesystem::pathToAbsoluteURL($cachefile);
 }
Ejemplo n.º 7
0
 function lessColorizeimage(&$arg)
 {
     if (isset($arg[2])) {
         $arg =& $arg[2];
         if (isset($arg[0])) {
             $colorize = $this->getFromEscapedArgs($arg[0]);
         }
         if (isset($arg[1])) {
             $image = $this->getFromEscapedArgs($arg[1]);
             if ($image == '-1') {
                 return 'none';
             }
         }
         if (isset($arg[2])) {
             $color = $this->getFromEscapedArgs($arg[2]);
         }
         $url = '';
         if ($colorize == 0) {
             $url = NextendFilesystem::pathToAbsoluteURL(NextendFilesystem::getBasePath() . $image);
         } else {
             if (realpath($image) !== false) {
                 $image = realpath($image);
             } else {
                 $image = NextendFilesystem::getBasePath() . $image;
             }
             $url = $this->colorizeImage($image, $color, '548722');
         }
         return $this->url($url);
     }
 }