Exemple #1
0
/**
 * This file is part of the GLIZY framework.
 * Copyright (c) 2005-2012 Daniele Ugoletti <*****@*****.**>
 *
 * For the full copyright and license information, please view the COPYRIGHT.txt
 * file that was distributed with this source code.
 */
function getImage($applicationPath, $corePath = '')
{
    require_once $corePath . 'core/core.inc.php';
    org_glizy_Paths::init($applicationPath, $corePath);
    org_glizy_Config::init();
    $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : NULL;
    $w = isset($_REQUEST['w']) ? intval($_REQUEST['w']) : NULL;
    $h = isset($_REQUEST['h']) ? intval($_REQUEST['h']) : NULL;
    $force = isset($_REQUEST['f']) ? $_REQUEST['f'] == 'true' || $_REQUEST['f'] == '1' : false;
    $crop = isset($_REQUEST['c']) ? $_REQUEST['c'] == 'true' || $_REQUEST['c'] == '1' : false;
    if (is_null($id)) {
        exit;
    }
    glz_import('org.glizycms.mediaArchive.MediaManager');
    $media = org_glizycms_mediaArchive_MediaManager::getMediaById($id);
    if ($media->type != 'IMAGE') {
        exit;
    }
    if (!is_null($w) && !is_null($h)) {
        //resize the image
        $mediaInfo = $media->getResizeImage($w, $h, $crop, 0, $force);
    } else {
        // get the full image
        $mediaInfo = $media->getImageInfo();
    }
    $ext = array(IMG_GIF => '.gif', IMG_JPG => '.jpeg', IMG_PNG => '.png', IMG_WBMP => '.wbmp');
    header("location: " . GLZ_HOST . '/' . $mediaInfo['fileName']);
}
Exemple #2
0
 /**
  * @return GlizyObject|mixed
  */
 static function createObject()
 {
     $args = func_get_args();
     $classPath = array_shift($args);
     if (substr($classPath, -1, 1) == '*') {
         // TODO
         // ERRORE
     }
     $newObj = NULL;
     $classPath = org_glizy_ObjectFactory::resolveClass($classPath);
     $className = str_replace('.', '_', $classPath);
     if (!class_exists($className)) {
         $r = glz_import($classPath);
         if ($r === false) {
             new Exception('[ org_glizy_ObjectFactory ] class not found: ' . $className);
         }
     } else {
         $costructString = '$newObj = new ' . $className . '(';
         for ($i = 0; $i < count($args); $i++) {
             $costructString .= '$args[' . $i . ']';
             if ($i < count($args) - 1) {
                 $costructString .= ', ';
             }
         }
         $costructString .= ');';
         eval($costructString);
     }
     return $newObj;
 }
Exemple #3
0
 function _setOutputFilter()
 {
     $filterName = $this->getAttribute('filter');
     $tag = $this->getAttribute('tag');
     // risovle il nome della classe
     if (file_exists(org_glizy_Paths::get('CORE_CLASSES') . 'org/glizy/filters/' . $filterName . '.php')) {
         $filterName = 'org.glizy.filters.' . $filterName;
         glz_import($filterName);
     } else {
         glz_import($filterName);
     }
     $className = str_replace('.', '_', $filterName);
     if (class_exists($className)) {
         // aggiunge il filtro per essere processato
         if ($this->getAttribute('mode') == 'PRE') {
             $outputFilters =& org_glizy_ObjectValues::get('org.glizy:components.Component', 'OutputFilter.pre');
         } else {
             $outputFilters =& org_glizy_ObjectValues::get('org.glizy:components.Component', 'OutputFilter.post');
         }
         if (!isset($outputFilters[$tag])) {
             $outputFilters[$tag] = array();
         }
         $outputFilters[$tag][] = $className;
     }
 }
 function executeLater_deleteModule($oldState)
 {
     if (strtolower(__Request::get('action', '')) == 'next') {
         $pageType = $this->_parent->_application->getPageType();
         list($moduleName) = explode('.', $pageType);
         __Session::set('mbTable', $moduleName);
         glz_import('movio.modules.modulesBuilder.builder.*', array('Builder.php', 'AbstractCommand.php'));
         $builder = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.builder.Builder');
         $builder->executeDelete();
         glz_import('org.glizy.helpers.Navigation');
         org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => 'SiteMap')));
     }
 }
Exemple #5
0
 /**
  * @return org_glizy_log_LogBase
  */
 static function &create()
 {
     $args = func_get_args();
     $name = array_shift($args);
     $newObj = NULL;
     if (file_exists(dirname(__FILE__) . '/' . $name . '.php')) {
         glz_import('org.glizy.log.' . $name);
         $className = str_replace('.', '_', 'org.glizy.log.' . $name);
         $costructString = '$newObj = new ' . $className . '(';
         for ($i = 0; $i < count($args); $i++) {
             $costructString .= '$args[' . $i . ']';
             if ($i < count($args) - 1) {
                 $costructString .= ', ';
             }
         }
         $costructString .= ');';
         eval($costructString);
     }
     return $newObj;
 }
Exemple #6
0
 public function executeLater($email)
 {
     if ($this->submit && $this->controller->validate()) {
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         if (!$ar->find(array('user_email' => $email))) {
             // utente non trovato
             $this->view->validateAddError(__T('MW_LOSTPASSWORD_ERROR'));
             return false;
         }
         // utente trovato
         // genera una nuova password e la invia per email
         glz_import('org.glizy.helpers.Mail');
         // invia la notifica all'utente
         $subject = org_glizy_locale_Locale::get('MW_LOSTPASSWORD_EMAIL_SUBJECT');
         $body = org_glizy_locale_Locale::get('MW_LOSTPASSWORD_EMAIL_BODY');
         $body = str_replace('##USER##', $email, $body);
         $body = str_replace('##HOST##', org_glizy_helpers_Link::makeSimpleLink(GLZ_HOST, GLZ_HOST), $body);
         $body = str_replace('##PASSWORD##', $ar->user_password, $body);
         org_glizy_helpers_Mail::sendEmail(array('email' => org_glizy_Request::get('email', ''), 'name' => $ar->user_firstName . ' ' . $ar->user_lastName), array('email' => org_glizy_Config::get('SMTP_EMAIL'), 'name' => org_glizy_Config::get('SMTP_SENDER')), $subject, $body);
         $this->changeAction('lostPasswordConfirm');
     }
 }
<?php

glz_import('org.glizy.helpers.Link');
class movio_modules_ontologybuilder_views_renderer_ActionEditDeleteEntity extends GlizyObject
{
    function renderCell($key, $value, $row)
    {
        $entityId = $key;
        $entityTypeId = str_replace('entity', '', $row->getType());
        $output = __Link::makeLinkWithIcon('actionEntities', 'btn-icon icon-pencil', array('title' => __T('GLZ_RECORD_EDIT'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'edit'));
        $output .= __Link::makeLinkWithIcon('actionEntities', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'delete'), __T('GLZ_RECORD_MSG_DELETE'));
        $output .= __Link::makeLinkWithIcon('actionEntities', $row->isVisible() ? 'icon-eye-open btn-icon' : 'icon-eye-close btn-icon', array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'togglevisibility'));
        return $output;
    }
}
Exemple #8
0
    if (file_exists(org_glizy_Paths::get('APPLICATION_STARTUP'))) {
        // if the startup folder is defined all files are included
        glz_require_once_dir(org_glizy_Paths::get('APPLICATION_STARTUP'));
    }
}
$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : NULL;
$w = isset($_REQUEST['w']) ? intval($_REQUEST['w']) : NULL;
$h = isset($_REQUEST['h']) ? intval($_REQUEST['h']) : NULL;
$force = isset($_REQUEST['f']) ? $_REQUEST['f'] == 'true' || $_REQUEST['f'] == '1' : false;
$crop = isset($_REQUEST['c']) ? $_REQUEST['c'] == 'true' || $_REQUEST['c'] == '1' : false;
$useThumbnail = isset($_REQUEST['t']) ? $_REQUEST['t'] == 'true' || $_REQUEST['t'] == '1' : false;
$cropOffset = isset($_REQUEST['co']) ? $_REQUEST['co'] : 0;
if (is_null($id)) {
    exit;
}
glz_import('org.glizycms.mediaArchive.MediaManager');
$media = org_glizycms_mediaArchive_MediaManager::getMediaById($id);
if ($useThumbnail && !empty($media->ar->media_thumbFileName)) {
    $media->ar->media_fileName = $media->ar->media_thumbFileName;
    $media->ar->media_type = 'IMAGE';
    $media = org_glizycms_mediaArchive_MediaManager::getMediaByRecord($media->ar);
}
if (!is_null($w) && !is_null($h)) {
    //resize the image
    if ($media->type != 'IMAGE') {
        $iconFile = $media->getIconFileName();
        header('location: ' . $iconFile);
    }
    $mediaInfo = $media->getResizeImage($w, $h, $crop, $cropOffset, $force);
} else {
    // get the full image
Exemple #9
0
 /**
  * @param Exception $exception
  */
 public function onExceptionHandler($exception)
 {
     if (!self::$isRegistred) {
         return;
     }
     glz_import('org.glizy.Exception');
     if (org_glizy_Config::get('ERROR_DUMP') !== '') {
         org_glizy_Exception::error_dump($exception->getCode(), $exception->getMessage(), $exception->getFile(), $exception->getLine());
     }
     org_glizy_Exception::show($exception->getCode(), $exception->getMessage(), $exception->getFile(), $exception->getLine());
 }
Exemple #10
0
<?php

glz_import('org.glizy.plugins.PluginManager');
org_glizy_plugins_PluginManager::addPlugin('org.glizy.plugins.Search', 'movio.search.Content');
org_glizy_plugins_PluginManager::addPlugin('org.glizy.plugins.Search', 'movio.search.Entity');
Exemple #11
0
 function process()
 {
     glz_import('org.glizy.dataAccess.DataAccess');
     glz_DBdebug($this->getAttribute('value'), $this->getAttribute('connect'));
 }