Example #1
0
 public function check_dependency($nullval = "")
 {
     // if there are no dependencies, always succeeds
     if ($this->DEPENDENCY == NULL) {
         return true;
     }
     if (!is_array($this->DEPENDENCY)) {
         return check_module($this->DEPENDENCY);
     } else {
         foreach ($this->DEPENDENCY as $k => $v) {
             // Check for no key present
             if ($k + 0 > 0 or empty($k)) {
                 if (!check_module($v)) {
                     return false;
                 }
             } else {
                 if (!check_module($k, $v)) {
                     return false;
                 }
             }
         }
         // end of looping through $this->DEPENDENCY
         return true;
     }
     // end if array/dependencies
 }
Example #2
0
echo msg_arr($curlver);
?>
</span></dd>

     <dt class="grey-text">PHPShield</dt>
       <?php 
$phpshield = check_module('phpshield');
?>
        <dd  style="background-color:#fff;"><span style="margin-left:60px;" class="grey-text"><?php 
echo msg_arr($phpshield);
?>
</span></dd>
    
    <dt class="grey-text">ImageMagick</dt>
       <?php 
$imagick = check_module('imagick');
?>
        <dd  style="background-color:#fff;"><span style="margin-left:60px;" class="grey-text"><?php 
echo msg_arr($imagick);
?>
</span></dd>
    
</dl>




<form name="installation" method="post" id="installation">
    <input type="hidden" name="mode" value="permission" />
    <div style="padding:10px 0px" align="right"><?php 
echo button('Continue To Next Step', ' onclick="$(\'#installation\').submit()" ');
Example #3
0
?>
    	<dd><?php 
echo msg_arr($mp4boxver);
?>
</dd>
    <dt>cURL</dt>
    	<?php 
$curlver = check_module('curl');
?>
    	<dd><?php 
echo msg_arr($curlver);
?>
</dd>
    <dt>PHPShield</dt>
    	<?php 
$phpshield = check_module('phpshield');
?>
    	<dd><?php 
echo msg_arr($phpshield);
?>
</dd>
</dl>
<p></p>


<form name="installation" method="post" id="installation">
	<input type="hidden" name="mode" value="permission" />
    <div style="padding:10px 0px" align="right"><?php 
echo button('Continue To Next Step', ' onclick="$(\'#installation\').submit()" ');
?>
</div>
Example #4
0
/**
 * Get image dimensions.
 * @param array $upload_type File type.
 * @param string $file File path.
 * @return array
 * dimensions.
 */
function image_get_dimensions($upload_type, $file)
{
    $result = array();
    if ((check_module('gd') | check_module('gd2')) & Config::TRY_IMAGE_GD) {
        //gd library formats
        $dimensions = getimagesize($file);
        $result['x'] = $dimensions[0];
        $result['y'] = $dimensions[1];
        return $result;
    } elseif (check_module('imagick') & Config::TRY_IMAGE_IM) {
        //image magick library
        $image = new Imagick($file);
        if (!$image->setImageFormat($upload_type['extension'])) {
            throw new ImagemagicFiletypeException($upload_type['extension']);
        }
        $result['x'] = $image->getImageWidth();
        $result['y'] = $image->getImageHeight();
        $image->clear();
        $image->destroy();
        return $result;
    } else {
        throw new NoImageLibraryException();
    }
}
 function check_modules(&$modules)
 {
     $user =& JFactory::getUser();
     if ($user->get('gid') == 25) {
         return true;
     }
     if (is_array($modules) && count($modules) > 0) {
         $tmp = $modules;
         foreach ($modules as $i => $m) {
             if (!check_module($m->id)) {
                 unset($tmp[$i]);
             }
         }
         $modules = array();
         foreach ($tmp as $m) {
             $modules[] = $m;
         }
     }
 }
/**
 * Создаёт уменьшенную копию изображений разных форматов с помощью ImageMagick.
 * @param source string <p>Исходное изображение.</p>
 * @param dest string <p>Файл, куда должна быть помещена уменьшенная копия.</p>
 * @param source_dimensions array <p>Размеры исходного изображения.</p>
 * @param type array <p>Тип файла изображения.</p>
 * @param resize_x mixed<p>Ширина уменьшенной копии изображения.</p>
 * @param resize_y mixed<p>Высота уменьшенной копии изображения.</p>
 * @return array
 * Возвращает размеры созданной уменьшенной копии изображения:<p>
 * 'x' - ширина изображения.<br>
 * 'y' - высота изображения.</p>
 */
function thumb_internal_png($source, $dest, $source_dimensions, $type, $resize_x, $resize_y)
{
    if (check_module('imagick') & Config::TRY_IMAGE_IM) {
        return im_create_png_thumbnail($source, $dest, $source_dimensions['x'], $source_dimensions['y'], $resize_x, $resize_y);
    } else {
        throw new NoImageLibraryException();
    }
}