Ejemplo n.º 1
0
 function validateObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     $inputParameters = $contentObjectAttribute->inputParameters();
     $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
     $parameters = $contentObjectAttribute->validationParameters();
     if (isset($parameters['prefix-name']) and $parameters['prefix-name']) {
         $parameters['prefix-name'][] = $contentClassAttribute->attribute('name');
     } else {
         $parameters['prefix-name'] = array($contentClassAttribute->attribute('name'));
     }
     $status = eZInputValidator::STATE_ACCEPTED;
     $postVariableName = $base . "_data_object_relation_list_" . $contentObjectAttribute->attribute("id");
     $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
     // Check if selection type is not browse
     $classContent = $contentClassAttribute->content();
     if ($classContent['selection_type'] != 0) {
         $selectedObjectIDArray = $http->hasPostVariable($postVariableName) ? $http->postVariable($postVariableName) : false;
         if ($contentObjectAttribute->validateIsRequired() and $selectedObjectIDArray === false) {
             $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing objectrelation list input.'));
             return eZInputValidator::STATE_INVALID;
         }
         return $status;
     }
     $content = $contentObjectAttribute->content();
     if ($contentObjectAttribute->validateIsRequired() and count($content['relation_list']) == 0) {
         $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing objectrelation list input.'));
         return eZInputValidator::STATE_INVALID;
     }
     for ($i = 0; $i < count($content['relation_list']); ++$i) {
         $relationItem = $content['relation_list'][$i];
         if ($relationItem['is_modified']) {
             $subObjectID = $relationItem['contentobject_id'];
             $subObjectVersion = $relationItem['contentobject_version'];
             $attributeBase = $base . '_ezorl_edit_object_' . $subObjectID;
             $object = eZContentObject::fetch($subObjectID);
             if ($object) {
                 $attributes = $object->contentObjectAttributes(true, $subObjectVersion, $contentObjectAttribute->attribute('language_code'));
                 $validationResult = $object->validateInput($attributes, $attributeBase, $inputParameters, $parameters);
                 $inputValidated = $validationResult['input-validated'];
                 $content['temp'][$subObjectID]['require-fixup'] = $validationResult['require-fixup'];
                 $statusMap = $validationResult['status-map'];
                 foreach ($statusMap as $statusItem) {
                     $statusValue = $statusItem['value'];
                     if ($statusValue == eZInputValidator::STATE_INTERMEDIATE and $status == eZInputValidator::STATE_ACCEPTED) {
                         $status = eZInputValidator::STATE_INTERMEDIATE;
                     } else {
                         if ($statusValue == eZInputValidator::STATE_INVALID) {
                             $contentObjectAttribute->setHasValidationError(false);
                             $status = eZInputValidator::STATE_INVALID;
                         }
                     }
                 }
                 $content['temp'][$subObjectID]['attributes'] = $attributes;
                 $content['temp'][$subObjectID]['object'] = $object;
             }
         }
     }
     $contentObjectAttribute->setContent($content);
     return $status;
 }
Ejemplo n.º 2
0
    function eZPaymentGatewayType()
    {
        $this->logger   = eZPaymentLogger::CreateForAdd( "var/log/eZPaymentGatewayType.log" );

        $this->eZWorkflowEventType( eZPaymentGatewayType::WORKFLOW_TYPE_STRING, ezpI18n::tr( 'kernel/workflow/event', "Payment Gateway" ) );
        $this->loadAndRegisterGateways();
    }
    /**
     * Validate post data, these are then used by
     * {@link eZGmapLocationType::fetchObjectAttributeHTTPInput()}
     *
     * @param eZHTTPTool $http
     * @param string $base
     * @param eZContentObjectAttribute $contentObjectAttribute
     */
    function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $latitude = '';
        $longitude = '';
        $classAttribute = $contentObjectAttribute->contentClassAttribute();
    	if ( $http->hasPostVariable( $base . '_data_gmaplocation_latitude_' . $contentObjectAttribute->attribute( 'id' ) ) &&
             $http->hasPostVariable( $base . '_data_gmaplocation_longitude_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {

            $latitude = $http->postVariable( $base . '_data_gmaplocation_latitude_' . $contentObjectAttribute->attribute( 'id' ) );
            $longitude = $http->postVariable( $base . '_data_gmaplocation_longitude_' . $contentObjectAttribute->attribute( 'id' ) );
        }

        if ( $latitude === '' || $longitude === '' )
        {
            if ( !$classAttribute->attribute( 'is_information_collector' ) && $contentObjectAttribute->validateIsRequired() )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/ezgmaplocation/datatype',
                                                                     'Missing Latitude/Longitude input.' ) );
                return eZInputValidator::STATE_INVALID;
            }
        }
        else if ( !is_numeric( $latitude ) || !is_numeric( $longitude ) )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'extension/ezgmaplocation/datatype',
                                                                 'Invalid Latitude/Longitude input.' ) );
            return eZInputValidator::STATE_INVALID;
        }

        return eZInputValidator::STATE_ACCEPTED;
    }
    function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        if ( $http->hasPostVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {
            $contentClassAttribute = $contentObjectAttribute->attribute( 'contentclass_attribute' );
            $iniFile = eZIniSettingType::iniFile( $contentClassAttribute );
            $iniSection = eZIniSettingType::iniSection( $contentClassAttribute );
            $iniParameterName = eZIniSettingType::iniParameterName( $contentClassAttribute );

            $config = eZINI::instance( $iniFile );
            if ( $config == null )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                     'Could not locate the ini file.' ) );
                return eZInputValidator::STATE_INVALID;
            }

            if ( $contentClassAttribute->attribute( self::CLASS_TYPE_FIELD ) == self::CLASS_TYPE_ARRAY )
            {
                $iniArray = array();
   //             if ( eZIniSettingType::parseArrayInput( $contentObjectAttribute->attribute( 'data_text' ), $iniArray ) === false )
                if ( eZIniSettingType::parseArrayInput( $http->postVariable( $base . '_ini_setting_' . $contentObjectAttribute->attribute( 'id' ) ), $iniArray ) === false )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Wrong text field value.' ) );

                    return eZInputValidator::STATE_INVALID;
                }
            }
        }
        return eZInputValidator::STATE_ACCEPTED;
    }
    function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $classAttribute = $contentObjectAttribute->contentClassAttribute();

        if ( $http->hasPostVariable( $base . '_ezkeyword_data_text_' . $contentObjectAttribute->attribute( 'id' ) ) )
        {
            $data = $http->postVariable( $base . '_ezkeyword_data_text_' . $contentObjectAttribute->attribute( 'id' ) );

            if ( $data == "" )
            {
                if ( !$classAttribute->attribute( 'is_information_collector' ) and $contentObjectAttribute->validateIsRequired() )
                {
                    $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                         'Input required.' ) );
                    return eZInputValidator::STATE_INVALID;
                }
            }
        }
        else if ( !$classAttribute->attribute( 'is_information_collector' ) and $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Input required.' ) );
            return eZInputValidator::STATE_INVALID;
        }
        return eZInputValidator::STATE_ACCEPTED;
    }
Ejemplo n.º 6
0
 function eZTopMenuOperator( $name = 'topmenu' )
 {
     $this->Operators = array( $name );
     $this->DefaultNames = array(
         'content' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                               'Content structure' ),
                             'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                                 'Manage the main content structure of the site.' ) ),
         'media' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                             'Media library' ),
                           'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                               'Manage images, files, documents, etc.' ) ),
         'users' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                             'User accounts' ),
                           'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                               'Manage users, user groups and permission settings.' ) ),
         'shop' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                            'Webshop' ),
                          'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                              'Manage customers, orders, discounts and VAT types; view sales statistics.' ) ),
         'design' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                              'Design' ),
                            'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                                'Manage templates, menus, toolbars and other things related to appearence.' ) ),
         'setup' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                             'Setup' ),
                           'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                               'Configure settings and manage advanced functionality.' ) ),
         'dashboard' => array( 'name' => ezpI18n::tr( 'design/admin/pagelayout',
                                                  'Dashboard' ),
                                'tooltip'=> ezpI18n::tr( 'design/admin/pagelayout',
                                                    'Manage items and settings that belong to your account.' ) ) );
 }
Ejemplo n.º 7
0
    function display()
    {
        $siteType = $this->chosenSiteType();

        $siteaccessURLs = $this->siteaccessURLs();

        $siteType['url'] = $siteaccessURLs['url'];
        $siteType['admin_url'] = $siteaccessURLs['admin_url'];

        $customText = isset( $this->PersistenceList['final_text'] ) ? $this->PersistenceList['final_text'] : '';

        $this->Tpl->setVariable( 'site_type', $siteType );

        $this->Tpl->setVariable( 'custom_text', $customText );

        $this->Tpl->setVariable( 'setup_previous_step', 'Final' );
        $this->Tpl->setVariable( 'setup_next_step', 'Final' );

        $result = array();
        // Display template
        $result['content'] = $this->Tpl->fetch( 'design:setup/init/final.tpl' );
        $result['path'] = array( array( 'text' => ezpI18n::tr( 'design/standard/setup/init',
                                                          'Finished' ),
                                        'url' => false ) );
        return $result;

    }
Ejemplo n.º 8
0
 protected static function run()
 {
     self::checkIfLoggedIn();
     $ini = eZINI::instance('cookielaw.ini');
     if (self::$isActive) {
         $message = ezpI18n::tr('extension/occookielaw', "I cookie ci aiutano ad erogare servizi di qualità. Utilizzando i nostri servizi, l'utente accetta le nostre modalità d'uso dei cookie.");
         if ($ini->hasVariable('AlertSettings', 'MessageText')) {
             $message = $ini->variable('AlertSettings', 'MessageText');
         }
         $dismiss = ezpI18n::tr('extension/occookielaw', "OK");
         if ($ini->hasVariable('AlertSettings', 'DismissButtonText')) {
             $dismiss = $ini->variable('AlertSettings', 'DismissButtonText');
         }
         $info = ezpI18n::tr('extension/occookielaw', "Maggiori informazioni");
         if ($ini->hasVariable('AlertSettings', 'InfoButtonText')) {
             $info = $ini->variable('AlertSettings', 'InfoButtonText');
         }
         $tpl = eZTemplate::factory();
         $tpl->setVariable('message', $message);
         $tpl->setVariable('dismiss_button', $dismiss);
         $tpl->setVariable('info_button', $info);
         return $tpl->fetch('design:inject_in_page_layout.tpl');
     }
     return '';
 }
Ejemplo n.º 9
0
 public function capture(eZOrder $order)
 {
     //start the capture transaction
     $response = self::transaction($order);
     if ($response and $response !== "") {
         $response_array = array();
         //go through all lines of the result
         foreach (preg_split("/((\r?\n)|(\r\n?))/", $response) as $line) {
             //prepare a nice readable array
             $tmp_explode_result = explode("=", $line);
             if (count($tmp_explode_result) >= 2) {
                 $response_array[$tmp_explode_result[0]] = $tmp_explode_result[1];
             }
         }
         if (count($response_array) >= 1 and $response_array["status"] === "APPROVED") {
             eZLog::write("SUCCESS in step 3 ('capture') for order ID " . $order->ID, $logName = 'xrowpayone.log', $dir = 'var/log');
         } else {
             eZLog::write("FAILED in step 3 ('capture') for order ID " . $order->ID . " with ERRORCODE " . $response_array['errorcode'] . " Message: " . $response_array['errormessage'], $logName = 'xrowpayone.log', $dir = 'var/log');
             return "Error Code: " . $response_array["errorcode"] . " Error Message: " . $response_array["errormessage"] . " (Order Nr. " . $order->OrderNr . ")";
         }
     } else {
         eZLog::write("ERROR: \$response not set or empty in file " . __FILE__ . " on line " . __LINE__ . " for Order ID " . $order->ID, $logName = 'xrowpayone.log', $dir = 'var/log');
         return ezpI18n::tr('extension/xrowpayone', 'Incorrect or no answer of the payone server.') . " (Order Nr. " . $order->OrderNr . ")";
     }
     return true;
 }
Ejemplo n.º 10
0
 static function create($user_id)
 {
     $config = eZINI::instance('site.ini');
     $dateTime = time();
     $row = array('id' => null, 'node_id', '', 'title' => ezpI18n::tr('kernel/classes', 'New RSS Export'), 'site_access' => '', 'modifier_id' => $user_id, 'modified' => $dateTime, 'creator_id' => $user_id, 'created' => $dateTime, 'status' => self::STATUS_DRAFT, 'url' => 'http://' . $config->variable('SiteSettings', 'SiteURL'), 'description' => '', 'image_id' => 0, 'active' => 1, 'access_url' => '');
     return new eZRSSExport($row);
 }
Ejemplo n.º 11
0
 function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
 {
     if ( $http->hasPostVariable( $base . "_ezurl_url_" . $contentObjectAttribute->attribute( "id" ) )  and
          $http->hasPostVariable( $base . "_ezurl_text_" . $contentObjectAttribute->attribute( "id" ) )
        )
     {
         $url = $http->PostVariable( $base . "_ezurl_url_" . $contentObjectAttribute->attribute( "id" ) );
         $text = $http->PostVariable( $base . "_ezurl_text_" . $contentObjectAttribute->attribute( "id" ) );
         if ( $contentObjectAttribute->validateIsRequired() )
             if ( $url == "" )
             {
                 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
                                                                      'Input required.' ) );
                 return eZInputValidator::STATE_INVALID;
             }
         // Remove all url-object links to this attribute.
         eZURLObjectLink::removeURLlinkList( $contentObjectAttribute->attribute( "id" ), $contentObjectAttribute->attribute('version') );
     }
     else if ( $contentObjectAttribute->validateIsRequired() )
     {
         $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes', 'Input required.' ) );
         return eZInputValidator::STATE_INVALID;
     }
     return eZInputValidator::STATE_ACCEPTED;
 }
Ejemplo n.º 12
0
 /**
  * @param int $objectID ContentObjectID
  */
 public function __construct($objectID)
 {
     $userID = eZUser::currentUserID();
     $message = ezpI18n::tr('design/standard/error/kernel', 'Access denied') . '. ' . ezpI18n::tr('design/standard/error/kernel', 'You do not have permission to access this area.');
     eZLog::write("Access denied to content object #{$objectID} for user #{$userID}", 'error.log');
     parent::__construct($message);
 }
 static function create()
 {
     $row = array(
         "id" => null,
         "name" => ezpI18n::tr( "kernel/shop/discountgroup", "New discount group" ) );
     return new eZDiscountRule( $row );
 }
Ejemplo n.º 14
0
 function validateObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     $classAttribute = $contentObjectAttribute->contentClassAttribute();
     if ($http->hasPostVariable($base . "_data_rangeoption_name_" . $contentObjectAttribute->attribute("id")) and $http->hasPostVariable($base . '_data_rangeoption_start_value_' . $contentObjectAttribute->attribute('id')) and $http->hasPostVariable($base . '_data_rangeoption_stop_value_' . $contentObjectAttribute->attribute('id')) and $http->hasPostVariable($base . '_data_rangeoption_step_value_' . $contentObjectAttribute->attribute('id'))) {
         $name = $http->postVariable($base . "_data_rangeoption_name_" . $contentObjectAttribute->attribute("id"));
         $startValue = $http->postVariable($base . '_data_rangeoption_start_value_' . $contentObjectAttribute->attribute('id'));
         $stopValue = $http->postVariable($base . '_data_rangeoption_stop_value_' . $contentObjectAttribute->attribute('id'));
         $stepValue = $http->postVariable($base . '_data_rangeoption_step_value_' . $contentObjectAttribute->attribute('id'));
         if ($name == '' or $startValue == '' or $stopValue == '' or $stepValue == '') {
             if (!$classAttribute->attribute('is_information_collector') and $contentObjectAttribute->validateIsRequired()) {
                 $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing range option input.'));
                 return eZInputValidator::STATE_INVALID;
             } else {
                 return eZInputValidator::STATE_ACCEPTED;
             }
         }
     } else {
         if (!$classAttribute->attribute('is_information_collector') and $contentObjectAttribute->validateIsRequired()) {
             $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing range option input.'));
             return eZInputValidator::STATE_INVALID;
         } else {
             return eZInputValidator::STATE_ACCEPTED;
         }
     }
 }
 function display()
 {
     // Get site templates from setup.ini
     $config = eZINI::instance('setup.ini');
     $thumbnailBase = $config->variable('SiteTemplates', 'ThumbnailBase');
     $thumbnailExtension = $config->variable('SiteTemplates', 'ThumbnailExtension');
     $site_templates = array();
     $packages = eZPackage::fetchPackages(array('path' => 'kernel/setup/packages'));
     foreach ($packages as $key => $package) {
         $site_templates[$key]['name'] = $package->attribute('summary');
         $site_templates[$key]['identifier'] = $package->attribute('name');
         $thumbnails = $package->thumbnailList('default');
         if (count($thumbnails) > 0) {
             $site_templates[$key]['image_file_name'] = $package->fileItemPath($thumbnails[0], 'default', 'kernel/setup/packages');
         } else {
             $site_templates[$key]['image_file_name'] = false;
         }
     }
     $this->Tpl->setVariable('site_templates', $site_templates);
     $this->Tpl->setVariable('error', $this->Error);
     // Return template and data to be shown
     $result = array();
     // Display template
     $result['content'] = $this->Tpl->fetch('design:setup/init/site_templates.tpl');
     $result['path'] = array(array('text' => ezpI18n::tr('design/standard/setup/init', 'Site template selection'), 'url' => false));
     return $result;
 }
Ejemplo n.º 16
0
 static function create($user_id)
 {
     $config = eZINI::instance('site.ini');
     $dateTime = time();
     $row = array('id' => null, 'title' => ezpI18n::tr('kernel/pdfexport', 'New PDF Export'), 'show_frontpage' => 1, 'intro_text' => '', 'sub_text' => '', 'source_node_id' => 0, 'export_structure' => 'tree', 'export_classes' => '', 'site_access' => '', 'pdf_filename' => 'file.pdf', 'modifier_id' => $user_id, 'modified' => $dateTime, 'creator_id' => $user_id, 'created' => $dateTime, 'status' => 0, 'version' => 1);
     return new eZPDFExport($row);
 }
Ejemplo n.º 17
0
    /**
     * @return string
     */
    private function prepareMessageText()
    {
        $http = BlockDefault::http();

        $title = $http->hasPostVariable( 'salutation' ) ? stripslashes( $http->postVariable( 'salutation' ) ) : '';
        $firstName = $http->hasPostVariable( 'first_name' ) ? stripslashes( $http->postVariable( 'first_name' ) ) : '';
        $lastName = $http->hasPostVariable( 'last_name' ) ? stripslashes( $http->postVariable( 'last_name' ) ) : '';
        $phone = $http->hasPostVariable( 'phone' ) ? stripslashes( $http->postVariable( 'phone' ) ) : '';
        $address = $http->hasPostVariable( 'address1' ) ? stripslashes( $http->postVariable( 'address1' ) . ' - ' . $http->postVariable( 'address2' ) ) : '';
        $postalCode = $http->hasPostVariable( 'cp' ) ? stripslashes( $http->postVariable( 'cp' ) ) : '';
        $location = $http->hasPostVariable( 'country' ) ? stripslashes( $http->postVariable( 'country' ) . ', ' . $http->postVariable( 'city' ) ) : '';
        $email = $http->hasPostVariable( 'email' ) ? stripslashes( $http->postVariable( 'email' ) ) : '';
        $codeTVF = $http->hasPostVariable( 'tvf' ) ? stripslashes( $http->postVariable( 'tvf' ) ) : '';
        $articleTitle = $http->hasPostVariable( 'titleArticle' ) ? stripslashes( $http->postVariable( 'titleArticle' ) ) : '';
        $articleAuthor = $http->hasPostVariable( 'firstAuthor' ) ? stripslashes( $http->postVariable( 'firstAuthor' ) ) : '';
        $journalName = $http->hasPostVariable( 'nameRevue' ) ? stripslashes( $http->postVariable( 'nameRevue' ) ) : '';
        $publicationDate = $http->hasPostVariable( 'publishedDate' ) ? stripslashes( $http->postVariable( 'publishedDate' ) ) : '';
        $issueNumber = $http->hasPostVariable( 'numberRevue' ) ? stripslashes( $http->postVariable( 'numberRevue' ) ) : '';
        $firstPage = $http->hasPostVariable( 'firstPage' ) ? stripslashes( $http->postVariable( 'firstPage' ) ) : '';
        $additionalInfo = $http->hasPostVariable( 'infos' ) ? stripslashes( $http->postVariable( 'infos' ) ) : '';

        $message = ezpI18n::tr( 'application/fulltext', 'MAIL CONTENT', null, array(
            '{0}' => $title, '{1}' => $firstName, '{2}' => $lastName, '{3}' => $phone, '{4}' => $address, '{5}' => $postalCode, '{6}' => $location, '{7}' => $email, '{8}' => $codeTVF, '{9}' => $articleTitle, '{10}' => $articleAuthor, '{11}' => $journalName, '{12}' => $publicationDate, '{13}' => $issueNumber, '{14}' => $firstPage, '{15}' => $additionalInfo
        ) );

        return stripslashes( $message );
    }
Ejemplo n.º 18
0
    /**
     * @param string $term
     * @param bool $wal
     * @return array
     */
    protected function mcSearch( $term, $wal )
    {
        $session = curl_init();
        curl_setopt( $session, CURLOPT_URL, $this->anonymousUrl . "/solr/$term/json" );
        curl_setopt( $session, CURLOPT_HEADER, false );
        curl_setopt( $session, CURLOPT_RETURNTRANSFER, true );
        curl_setopt( $session, CURLOPT_FOLLOWLOCATION, true );
        $response = curl_exec( $session );
        curl_close( $session );
        $response = json_decode( $response, true );

        $displayedTerm = mb_strlen( $term ) > 34 ? mb_substr( $term, 0, 34 ) . '...' : $term;
        $result = array(
            'term'      => str_replace( '+', ' ', $term ),
            'count'     => $response['count'],
            'resultUrl' => $response['resultUrl'],
            'mcAppUrl'  => CacheApplicationTool::buildLocalizedApplicationByIdentifier( 'merck-connect' )->applicationUrl() . "#?s=$term",
            'message'   => ezpI18n::tr( "merck/merck_connect", "%nbresult RESULTS FOR <strong>%searchterm</strong> ON MERCK CONNECT", null, array(
                "%nbresult"   => $response['count'],
                "%searchterm" => str_replace( '+', ' ', $displayedTerm )
            ) ) . ' &gt',
        );
        if( $wal && self::user() )
        {
            $result['al'] = $this->anonymousUrl . '/genericsearch.xhtml?q=' . $term . '&ltoken=' . $this->getAutologinLink( true );
        }
        if( $wal && !self::user() )
        {
            $result['al'] = $this->anonymousUrl;
        }

        return $result;
    }
Ejemplo n.º 19
0
 /**
  * Return a list of all cache items in the system.
  *
  * @return array The list of cache items
  */
 static function fetchList()
 {
     static $cacheList = null;
     if ($cacheList === null) {
         $ini = eZINI::instance();
         $textToImageIni = eZINI::instance('texttoimage.ini');
         $cacheList = array(array('name' => ezpI18n::tr('kernel/cache', 'Content view cache'), 'id' => 'content', 'is-clustered' => true, 'tag' => array('content'), 'expiry-key' => 'content-view-cache', 'enabled' => $ini->variable('ContentSettings', 'ViewCaching') == 'enabled', 'path' => $ini->variable('ContentSettings', 'CacheDir'), 'function' => array('eZCache', 'clearContentCache')), array('name' => ezpI18n::tr('kernel/cache', 'Global INI cache'), 'id' => 'global_ini', 'tag' => array('ini'), 'enabled' => true, 'path' => 'var/cache/ini', 'function' => array('eZCache', 'clearGlobalINICache'), 'purge-function' => array('eZCache', 'clearGlobalINICache')), array('name' => ezpI18n::tr('kernel/cache', 'INI cache'), 'id' => 'ini', 'tag' => array('ini'), 'enabled' => true, 'path' => 'ini'), array('name' => ezpI18n::tr('kernel/cache', 'Codepage cache'), 'id' => 'codepage', 'tag' => array('codepage'), 'enabled' => true, 'path' => 'codepages'), array('name' => ezpI18n::tr('kernel/cache', 'Class identifier cache'), 'id' => 'classid', 'tag' => array('content'), 'expiry-key' => 'class-identifier-cache', 'enabled' => true, 'path' => false, 'is-clustered' => true, 'function' => array('eZCache', 'clearClassID'), 'purge-function' => array('eZCache', 'clearClassID')), array('name' => ezpI18n::tr('kernel/cache', 'Sort key cache'), 'id' => 'sortkey', 'tag' => array('content'), 'expiry-key' => 'sort-key-cache', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearSortKey'), 'purge-function' => array('eZCache', 'clearSortKey'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'URL alias cache'), 'id' => 'urlalias', 'is-clustered' => true, 'tag' => array('content'), 'enabled' => true, 'path' => 'wildcard'), array('name' => ezpI18n::tr('kernel/cache', 'Character transformation cache'), 'id' => 'chartrans', 'tag' => array('i18n'), 'enabled' => true, 'path' => 'trans'), array('name' => ezpI18n::tr('kernel/cache', 'Image alias'), 'id' => 'imagealias', 'tag' => array('image'), 'path' => false, 'enabled' => true, 'function' => array('eZCache', 'clearImageAlias'), 'purge-function' => array('eZCache', 'purgeImageAlias'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'Template cache'), 'id' => 'template', 'tag' => array('template'), 'enabled' => $ini->variable('TemplateSettings', 'TemplateCompile') == 'enabled', 'path' => 'template'), array('name' => ezpI18n::tr('kernel/cache', 'Template block cache'), 'id' => 'template-block', 'is-clustered' => true, 'tag' => array('template', 'content'), 'expiry-key' => 'global-template-block-cache', 'enabled' => $ini->variable('TemplateSettings', 'TemplateCache') == 'enabled', 'path' => 'template-block', 'function' => array('eZCache', 'clearTemplateBlockCache')), array('name' => ezpI18n::tr('kernel/cache', 'Template override cache'), 'id' => 'template-override', 'tag' => array('template'), 'enabled' => true, 'path' => 'override', 'function' => array('eZCache', 'clearTemplateOverrideCache')), array('name' => ezpI18n::tr('kernel/cache', 'Text to image cache'), 'id' => 'texttoimage', 'tag' => array('template'), 'enabled' => $textToImageIni->variable('ImageSettings', 'UseCache') == 'enabled', 'path' => $textToImageIni->variable('PathSettings', 'CacheDir'), 'function' => array('eZCache', 'clearTextToImageCache'), 'purge-function' => array('eZCache', 'purgeTextToImageCache'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'RSS cache'), 'id' => 'rss_cache', 'is-clustered' => true, 'tag' => array('content'), 'enabled' => true, 'path' => 'rss'), array('name' => ezpI18n::tr('kernel/cache', 'User info cache'), 'id' => 'user_info_cache', 'is-clustered' => true, 'tag' => array('user'), 'expiry-key' => 'user-info-cache', 'enabled' => true, 'path' => 'user-info', 'function' => array('eZCache', 'clearUserInfoCache')), array('name' => ezpI18n::tr('kernel/cache', 'Content tree menu (browser cache)'), 'id' => 'content_tree_menu', 'tag' => array('content'), 'path' => false, 'enabled' => true, 'function' => array('eZCache', 'clearContentTreeMenu'), 'purge-function' => array('eZCache', 'clearContentTreeMenu')), array('name' => ezpI18n::tr('kernel/cache', 'State limitations cache'), 'is-clustered' => true, 'id' => 'state_limitations', 'tag' => array('content'), 'expiry-key' => 'state-limitations', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearStateLimitations'), 'purge-function' => array('eZCache', 'clearStateLimitations')), array('name' => ezpI18n::tr('kernel/cache', 'Design base cache'), 'id' => 'design_base', 'tag' => array('template'), 'enabled' => $ini->variable('DesignSettings', 'DesignLocationCache') == 'enabled', 'path' => false, 'function' => array('eZCache', 'clearDesignBaseCache'), 'purge-function' => array('eZCache', 'clearDesignBaseCache')), array('name' => ezpI18n::tr('kernel/cache', 'Active extensions cache'), 'id' => 'active_extensions', 'tag' => array('ini'), 'expiry-key' => 'active-extensions-cache', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearActiveExtensions'), 'purge-function' => array('eZCache', 'clearActiveExtensions')), array('name' => ezpI18n::tr('kernel/cache', 'TS Translation cache'), 'id' => 'translation', 'tag' => array('i18n'), 'enabled' => true, 'expiry-key' => 'ts-translation-cache', 'path' => 'translation', 'function' => array('eZCache', 'clearTSTranslationCache')), array('name' => ezpI18n::tr('kernel/cache', 'SSL Zones cache'), 'id' => 'sslzones', 'tag' => array('ini'), 'enabled' => eZSSLZone::enabled(), 'path' => false, 'function' => array('eZSSLZone', 'clearCache'), 'purge-function' => array('eZSSLZone', 'clearCache')));
         // Append cache items defined (in ini) by extensions, see site.ini[Cache] for details
         foreach ($ini->variable('Cache', 'CacheItems') as $cacheItemKey) {
             $name = 'Cache_' . $cacheItemKey;
             if (!$ini->hasSection($name)) {
                 eZDebug::writeWarning("Missing site.ini section: '{$name}', skipping!", __METHOD__);
                 continue;
             }
             $cacheItem = array();
             if ($ini->hasVariable($name, 'name')) {
                 $cacheItem['name'] = $ini->variable($name, 'name');
             } else {
                 $cacheItem['name'] = ucwords($cacheItemKey);
             }
             if ($ini->hasVariable($name, 'id')) {
                 $cacheItem['id'] = $ini->variable($name, 'id');
             } else {
                 $cacheItem['id'] = $cacheItemKey;
             }
             if ($ini->hasVariable($name, 'isClustered')) {
                 $cacheItem['is-clustered'] = $ini->variable($name, 'isClustered');
             } else {
                 $cacheItem['is-clustered'] = false;
             }
             if ($ini->hasVariable($name, 'tags')) {
                 $cacheItem['tag'] = $ini->variable($name, 'tags');
             } else {
                 $cacheItem['tag'] = array();
             }
             if ($ini->hasVariable($name, 'expiryKey')) {
                 $cacheItem['expiry-key'] = $ini->variable($name, 'expiryKey');
             }
             if ($ini->hasVariable($name, 'enabled')) {
                 $cacheItem['enabled'] = $ini->variable($name, 'enabled');
             } else {
                 $cacheItem['enabled'] = true;
             }
             if ($ini->hasVariable($name, 'path')) {
                 $cacheItem['path'] = $ini->variable($name, 'path');
             } else {
                 $cacheItem['path'] = false;
             }
             if ($ini->hasVariable($name, 'class')) {
                 $cacheItem['function'] = array($ini->variable($name, 'class'), 'clearCache');
             }
             if ($ini->hasVariable($name, 'purgeClass')) {
                 $cacheItem['purge-function'] = array($ini->variable($name, 'purgeClass'), 'purgeCache');
             }
             $cacheList[] = $cacheItem;
         }
     }
     return $cacheList;
 }
 function __construct()
 {
     $this->CjwNewsletterFilterType('cjwnl_email', ezpI18n::tr('cjw_newsletter/filtertypes', 'Email', 'Filtertype name'), array());
     $this->setValues(array());
     $this->setValuesAvailable('text');
     $this->setOperation('like');
     $this->setOperationsAvailable(array('eq' => ezpI18n::tr('cjw_newsletter/filtertypes', 'equal', 'Filtertype condition'), 'like' => ezpI18n::tr('cjw_newsletter/filtertypes', 'contains', 'Filtertype condition')));
 }
Ejemplo n.º 21
0
 /**
  * Generates tag hierarchy string for given tag ID
  *
  * @static
  *
  * @param int $tagID
  *
  * @return string
  */
 public static function generateParentString($tagID)
 {
     $tag = eZTagsObject::fetchWithMainTranslation($tagID);
     if (!$tag instanceof eZTagsObject) {
         return '(' . ezpI18n::tr('extension/eztags/tags/edit', 'no parent') . ')';
     }
     return $tag->getParentString();
 }
Ejemplo n.º 22
0
 function validateCollectionAttributeHTTPInput($http, $base, $objectAttribute)
 {
     if ($this->reCAPTCHAValidate($http)) {
         return eZInputValidator::STATE_ACCEPTED;
     }
     $objectAttribute->setValidationError(ezpI18n::tr('extension/recaptcha', "The reCAPTCHA wasn't entered correctly. Please try again."));
     return eZInputValidator::STATE_INVALID;
 }
 function __construct()
 {
     parent::__construct(
         self::WORKFLOW_TYPE_STRING,
         ezpI18n::tr( 'kernel/workflow/event', 'eZ Page swap workflow event' )
     );
     $this->setTriggerTypes( array( 'content' => array( 'swap' => array ( 'after' ) ) ) );
 }
Ejemplo n.º 24
0
 function validateObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
 {
     $postVariableName = $base . "_data_object_relation_list_" . $contentObjectAttribute->attribute("id");
     if ($http->hasPostVariable($postVariableName) && !($contentObjectAttribute->validateIsRequired() && $http->postVariable($postVariableName) == array("no_relation"))) {
         return eZInputValidator::STATE_ACCEPTED;
     }
     $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
     // Check if selection type is not browse
     $classContent = $contentClassAttribute->content();
     if ($classContent['selection_type'] != 0) {
         if ($contentObjectAttribute->validateIsRequired() && (!$http->hasPostVariable($postVariableName) || $http->postVariable($postVariableName) == array("no_relation"))) {
             $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing objectrelation list input.'));
             return eZInputValidator::STATE_INVALID;
         }
         return eZInputValidator::STATE_ACCEPTED;
     }
     // The following code is only there for the support of [BackwardCompatibilitySettings]/AdvancedObjectRelationList
     // which happens only when $classContent['selection_type'] == 0
     $content = $contentObjectAttribute->content();
     if ($contentObjectAttribute->validateIsRequired() && empty($content['relation_list'])) {
         $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'Missing objectrelation list input.'));
         return eZInputValidator::STATE_INVALID;
     }
     $status = eZInputValidator::STATE_ACCEPTED;
     $inputParameters = $contentObjectAttribute->inputParameters();
     $parameters = $contentObjectAttribute->validationParameters();
     if (isset($parameters['prefix-name']) && $parameters['prefix-name']) {
         $parameters['prefix-name'][] = $contentClassAttribute->attribute('name');
     } else {
         $parameters['prefix-name'] = array($contentClassAttribute->attribute('name'));
     }
     foreach ($content['relation_list'] as $relationItem) {
         if (!$relationItem['is_modified']) {
             continue;
         }
         $subObjectID = $relationItem['contentobject_id'];
         $object = eZContentObject::fetch($subObjectID);
         if (!$object) {
             continue;
         }
         $attributes = $object->contentObjectAttributes(true, $relationItem['contentobject_version'], $contentObjectAttribute->attribute('language_code'));
         $validationResult = $object->validateInput($attributes, $base . '_ezorl_edit_object_' . $subObjectID, $inputParameters, $parameters);
         $content['temp'][$subObjectID] = array('require-fixup' => $validationResult['require-fixup'], 'attributes' => $attributes, 'object' => $object);
         foreach ($validationResult['status-map'] as $statusItem) {
             $statusValue = $statusItem['value'];
             if ($statusValue == eZInputValidator::STATE_INTERMEDIATE && $status == eZInputValidator::STATE_ACCEPTED) {
                 $status = eZInputValidator::STATE_INTERMEDIATE;
             } else {
                 if ($statusValue == eZInputValidator::STATE_INVALID) {
                     $contentObjectAttribute->setHasValidationError(false);
                     $status = eZInputValidator::STATE_INVALID;
                 }
             }
         }
     }
     $contentObjectAttribute->setContent($content);
     return $status;
 }
Ejemplo n.º 25
0
 function eZIdentifierType()
 {
     $this->eZDataType( self::DATA_TYPE_STRING,
                        ezpI18n::tr( 'kernel/classes/datatypes', "Identifier", 'Datatype name' ),
                        array( 'serialize_supported' => true,
                               'object_serialize_map' => array( 'data_text' => 'identifier',
                                                                'data_int' => 'number' ) ) );
     $this->IntegerValidator = new eZIntegerValidator( 1 );
 }
Ejemplo n.º 26
0
 function search($searchText, $params = array(), $searchTypes = array())
 {
     eZDebug::createAccumulator('Search', 'eZ Find');
     eZDebug::accumulatorStart('Search');
     $error = 'Server not running';
     $asObjects = isset($params['AsObjects']) ? $params['AsObjects'] : true;
     //distributed search: fields to return can be specified in 2 parameters
     $params['FieldsToReturn'] = isset($params['FieldsToReturn']) ? $params['FieldsToReturn'] : array();
     if (isset($params['DistributedSearch']['returnfields'])) {
         $params['FieldsToReturn'] = array_merge($params['FieldsToReturn'], $params['DistributedSearch']['returnfields']);
     }
     $coreToUse = null;
     $shardQueryPart = null;
     if ($this->UseMultiLanguageCores === true) {
         $languages = $this->SiteINI->variable('RegionalSettings', 'SiteLanguageList');
         if (array_key_exists($languages[0], $this->SolrLanguageShards)) {
             $coreToUse = $this->SolrLanguageShards[$languages[0]];
             if ($this->FindINI->variable('LanguageSearch', 'SearchMainLanguageOnly') != 'enabled') {
                 $shardQueryPart = array('shards' => implode(',', $this->SolrLanguageShardURIs));
             }
         }
         //eZDebug::writeNotice( $languages, __METHOD__ . ' languages' );
         eZDebug::writeNotice($shardQueryPart, __METHOD__ . ' shards');
         //eZDebug::writeNotice( $this->SolrLanguageShardURIs, __METHOD__ . ' this languagesharduris' );
     } else {
         $coreToUse = $this->Solr;
     }
     if ($this->SiteINI->variable('SearchSettings', 'AllowEmptySearch') == 'disabled' && trim($searchText) == '') {
         $error = 'Empty search is not allowed.';
         eZDebug::writeNotice($error, __METHOD__);
         $resultArray = null;
     } else {
         eZDebug::createAccumulator('Query build', 'eZ Find');
         eZDebug::accumulatorStart('Query build');
         $queryBuilder = new ezfeZPSolrQueryBuilder($this);
         $queryParams = $queryBuilder->buildSearch($searchText, $params, $searchTypes);
         if (!$shardQueryPart == null) {
             $queryParams = array_merge($shardQueryPart, $queryParams);
         }
         eZDebug::accumulatorStop('Query build');
         eZDebugSetting::writeDebug('extension-ezfind-query', $queryParams, 'Final query parameters sent to Solr backend');
         eZDebug::createAccumulator('Engine time', 'eZ Find');
         eZDebug::accumulatorStart('Engine time');
         $resultArray = $coreToUse->rawSearch($queryParams);
         eZDebug::accumulatorStop('Engine time');
     }
     if ($resultArray) {
         $searchCount = $resultArray['response']['numFound'];
         $objectRes = $this->buildResultObjects($resultArray, $searchCount, $asObjects, $params);
         $stopWordArray = array();
         eZDebug::accumulatorStop('Search');
         return array('SearchResult' => $objectRes, 'SearchCount' => $searchCount, 'StopWordArray' => $stopWordArray, 'SearchExtras' => new ezfSearchResultInfo($resultArray));
     } else {
         eZDebug::accumulatorStop('Search');
         return array('SearchResult' => false, 'SearchCount' => 0, 'StopWordArray' => array(), 'SearchExtras' => new ezfSearchResultInfo(array('error' => ezpI18n::tr('ezfind', $error))));
     }
 }
 function validateExtensionName($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 {
     $extensionList = array();
     if (!$http->hasPostVariable('PackageExtensionNames') || count($http->postVariable('PackageExtensionNames')) == 0) {
         $errorList[] = array('field' => ezpI18n::tr('kernel/package', 'Extension list'), 'description' => ezpI18n::tr('kernel/package', 'You must select at least one extension'));
         return false;
     }
     return true;
 }
Ejemplo n.º 28
0
function displayForm($Result, $errors = null)
{
    $tpl = eZTemplate::factory();
    $tpl->setVariable('errors', $errors);
    $Result['path'] = array(array('url' => '/', 'text' => ezpI18n::tr('mailchimp/subscribe', 'Home')), array('url' => false, 'text' => ezpI18n::tr('mailchimp/subscribe', 'Subscribe')));
    $Result['title'] = 'Subscribe';
    $Result['content'] = $tpl->fetch("design:mailchimp/subscribe.tpl");
    return $Result;
}
 function __construct()
 {
     $salutationNameArray = CjwNewsletterUser::getAvailableSalutationNameArrayFromIni();
     $this->CjwNewsletterFilterType('cjwnl_salutation', ezpI18n::tr('cjw_newsletter/filtertypes', 'Salutation', 'Filtertype name'), array());
     $this->setValues(array());
     $this->setValuesAvailable(array('1' => $salutationNameArray[1], '2' => $salutationNameArray[2]));
     $this->setOperation('eq');
     $this->setOperationsAvailable(array('eq' => ezpI18n::tr('cjw_newsletter/filtertypes', 'equal', 'Filtertype condition'), 'ne' => ezpI18n::tr('cjw_newsletter/filtertypes', 'not equal', 'Filtertype condition')));
 }
Ejemplo n.º 30
0
 static function create($userID = false)
 {
     if ($userID === false) {
         $user = eZUser::currentUser();
         $userID = $user->attribute("contentobject_id");
     }
     $dateTime = time();
     $row = array('id' => null, 'name' => ezpI18n::tr('kernel/rss', 'New RSS Import'), 'modifier_id' => $userID, 'modified' => $dateTime, 'creator_id' => $userID, 'created' => $dateTime, 'object_owner_id' => $userID, 'url' => '', 'status' => self::STATUS_DRAFT, 'destination_node_id' => 0, 'class_id' => 0, 'class_title' => '', 'class_url' => '', 'class_description' => '', 'active' => 1);
     return new eZRSSImport($row);
 }