本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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.' ) ) );
}
示例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;
}
示例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 '';
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例13: create
static function create()
{
$row = array(
"id" => null,
"name" => ezpI18n::tr( "kernel/shop/discountgroup", "New discount group" ) );
return new eZDiscountRule( $row );
}
示例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;
}
}
}
示例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;
}