当前位置: 首页>>代码示例>>PHP>>正文


PHP ezpI18n类代码示例

本文整理汇总了PHP中ezpI18n的典型用法代码示例。如果您正苦于以下问题:PHP ezpI18n类的具体用法?PHP ezpI18n怎么用?PHP ezpI18n使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ezpI18n类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validateObjectAttributeHTTPInput

 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;
 }
开发者ID:rmiguel,项目名称:ezpublish,代码行数:60,代码来源:ezobjectrelationlisttype.php

示例2: eZPaymentGatewayType

    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();
    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:7,代码来源:ezpaymentgatewaytype.php

示例3: validateObjectAttributeHTTPInput

    /**
     * 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;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:39,代码来源:ezgmaplocationtype.php

示例4: validateObjectAttributeHTTPInput

    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;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:ezinisettingtype.php

示例5: validateObjectAttributeHTTPInput

    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;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:25,代码来源:ezkeywordtype.php

示例6: eZTopMenuOperator

 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.' ) ) );
 }
开发者ID:nottavi,项目名称:ezpublish,代码行数:33,代码来源:eztopmenuoperator.php

示例7: display

    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;

    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:27,代码来源:ezstep_final.php

示例8: run

 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 '';
 }
开发者ID:OpencontentCoop,项目名称:occookielaw,代码行数:25,代码来源:occookielaw.php

示例9: capture

 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;
 }
开发者ID:xrowgmbh,项目名称:xrowpayone,代码行数:26,代码来源:xrowpayone.php

示例10: create

 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);
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:7,代码来源:ezrssexport.php

示例11: validateObjectAttributeHTTPInput

 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;
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:25,代码来源:ezurltype.php

示例12: __construct

 /**
  * @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);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:10,代码来源:access_denied.php

示例13: create

 static function create()
 {
     $row = array(
         "id" => null,
         "name" => ezpI18n::tr( "kernel/shop/discountgroup", "New discount group" ) );
     return new eZDiscountRule( $row );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:7,代码来源:ezdiscountrule.php

示例14: validateObjectAttributeHTTPInput

 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;
         }
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:25,代码来源:ezrangeoptiontype.php

示例15: display

 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;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:27,代码来源:ezstep_site_templates.php


注:本文中的ezpI18n类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。