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


PHP Translation::getAll方法代码示例

本文整理汇总了PHP中Translation::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Translation::getAll方法的具体用法?PHP Translation::getAll怎么用?PHP Translation::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Translation的用法示例。


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

示例1: getList

 public function getList($params)
 {
     $search = isset($params['search']) ? $params['search'] : null;
     $params['dateFrom'] = str_replace('T00:00:00', '', $params['dateFrom']);
     $params['dateTo'] = str_replace('T00:00:00', '', $params['dateTo']);
     $result = Translation::getAll('en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo']);
     //$result = Translation::getAll('en', $params['start'], $params['limit'], $search);
     /* foreach($result->data as $i=>$row){
        $result->data[$i]['TRN_VALUE'] = substr($row['TRN_VALUE'], 0, 15) . '...';
        } */
     echo G::json_encode($result);
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:12,代码来源:ajaxListener.php

示例2: reportHeaders

 public function reportHeaders($fieldname = false, $rowRay = false)
 {
     require_once 'models/table/Translation.php';
     $translation = Translation::getAll();
     $headers = array('id' => 'ID', 'cnt' => t('Count'), 'active' => @$translation['Is Active'], 'first_name' => @$translation['First Name'], 'middle_name' => @$translation['Middle Name'], 'last_name' => @$translation['Last Name'], 'training_title' => @$translation['Training Name'], 'province_name' => @$translation['Region A (Province)'], 'district_name' => @$translation['Region B (Health District)'], 'pepfar_category_phrase' => @$translation['PEPFAR Category'], 'training_organizer_phrase' => @$translation['Training Organizer'], 'training_level_phrase' => @$translation['Training Level'], 'trainer_language_phrase' => t('Language'), 'training_location_name' => t('Location'), 'training_start_date' => t('Date'), 'training_topic_phrase' => t('Training Topic'), 'funding_phrase' => t('Funding'), 'is_tot' => t('TOT'), 'facility_name' => t('Facility Name'), 'facility_type_phrase' => t('Facility Type'), 'facility_sponsor_phrase' => t('Facility Sponsor'), 'course_recommended' => t('Recommended classes'), 'recommended' => t('Recommended'), 'qualification_phrase' => t('Qualification') . ' ' . t('(primary)'), 'qualification_secondary_phrase' => t('Qualification') . ' ' . t('(secondary)'), 'gender' => t('Gender'), 'name' => t('Name'), 'email' => t('Email'), 'phone' => t('Phone'), 'cat' => t('Category'), 'language_phrase' => t('Language'), 'trainer_type_phrase' => t('Type'), 'trainer_skill_phrase' => t('Skill'), 'trainer_language_phrase' => t('Language'), 'trainer_topic_phrase' => t('Topics Taught'), 'phone_work' => t('Work Phone'), 'phone_home' => t('Home Phone'), 'phone_mobile' => t('Mobile Phone'), 'type_option_id' => 'Type');
     // action => array(field => label)
     $headersSpecific = array('peopleByFacility' => array('qualification_phrase' => t('Qualification')), 'participantsByCategory' => array('cnt' => t('Participants'), 'person_cnt' => t('Unique Participants')));
     if ($rowRay) {
         $keys = array_keys(reset($rowRay));
         foreach ($keys as $k) {
             $csvheaders[] = $this->reportHeaders($k);
         }
         return array_merge(array('csvheaders' => $csvheaders), $rowRay);
     } elseif ($fieldname) {
         // check report specific headers first
         $action = $this->getRequest()->getActionName();
         if (isset($headersSpecific[$action]) && isset($headersSpecific[$action][$fieldname])) {
             return $headersSpecific[$action][$fieldname];
         }
         return isset($headers[$fieldname]) ? $headers[$fieldname] : $fieldname;
     } else {
         return $headers;
     }
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:24,代码来源:ReportpreserviceController.php

示例3: preDispatch

 public function preDispatch()
 {
     require_once 'models/table/User.php';
     //add identity to view variables
     $auth = Zend_Auth::getInstance();
     $identity = null;
     if ($auth->hasIdentity()) {
         //get ACLs and add to identity
         $acls = User::getACLs($auth->getIdentity()->id);
         $identity = $auth->getIdentity();
         $identity->acls = $acls;
         $auth->getStorage()->write($identity);
         $this->view->assign('identity', $identity);
     }
     //set up localization
     //get country default locale, then check user settings
     if (isset($_COOKIE['locale']) and array_key_exists($_COOKIE['locale'], ITechTranslate::getLanguages())) {
         $locale = $_COOKIE['locale'];
     } else {
         $locale = $this->_countrySettings['locale'];
     }
     if (!$locale) {
         $locale = 'en_EN.UTF-8';
     }
     if ($auth->hasIdentity() and $auth->getIdentity()->locale) {
         $locale = $auth->getIdentity()->locale;
     }
     //set up localization
     ITechTranslate::init($locale);
     // get Country-specific phrases for fields
     self::$_translations = Translation::getAll();
     $this->view->assign('translation', self::translations());
     //look for any status messages in the session and put the validation container in the view scope
     $statusObj = ValidationContainer::instance();
     if (isset($_SESSION['status'])) {
         $statusObj->setStatusMessage($_SESSION['status']);
         unset($_SESSION['status']);
     }
     $this->view->assign('status', $statusObj);
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:40,代码来源:ITechController.php

示例4: employeeSettingsAction

 public function employeeSettingsAction()
 {
     require_once 'models/table/System.php';
     $sysTable = new System();
     // For "Labels"
     // same logic as other Settings pages - except the employee_header setting below
     require_once 'models/table/Translation.php';
     $labelNames = array('label_partner' => 'Partner', 'label_sub_partner' => 'Sub Partner', 'label_type' => 'Type of Partner', 'label_funder' => 'Funder', 'label_full_time' => 'Full Time', 'label_base' => 'Employee Based at', 'label_funded_hours_per_week' => 'Funded hours per week', 'label_cadre' => 'Staff Cadre', 'label_staff_category' => 'Staff Category', 'label_annual_cost' => 'Annual Cost', 'label_primary_role' => 'Primary Role', 'label_importance' => 'Importance', 'label_intended_transition' => 'Intended Transition', 'label_incoming_partner' => 'Incoming partner', 'label_relationship' => 'Relationship', 'label_referral_mechanism' => 'Referral Mechanism', 'label_chw_supervisor' => 'CHW Supervisor', 'label_trainings_provided' => 'Trainings provided', 'label_courses_completed' => 'Courses Completed', 'label_other_id' => 'Other ID', 'label_disability' => 'Disability', 'label_disability_comments' => 'Disability Comments', 'label_nationality' => 'Employee Nationality', 'label_race' => 'Race', 'label_registration_number' => 'Registration Number', 'label_salary' => 'Salary', 'label_benefits' => 'Benefits', 'label_additional_expenses' => 'Additional Expenses', 'label_stipend' => 'Stipend');
     $checkboxFields = array('check_partner' => 'display_employee_partner', 'check_sub_partner' => 'display_employee_sub_partner', 'check_type' => 'display_partner_type', 'check_funder' => 'display_employee_funder', 'check_full_time' => 'display_employee_full_time', 'check_base' => 'display_employee_base', 'check_site_type' => 'display_employee_site_type', 'check_funded_hours_per_week' => 'display_employee_funded_hours_per_week', 'check_staff_category' => 'display_employee_staff_category', 'check_annual_cost' => 'display_employee_annual_cost', 'check_primary_role' => 'display_employee_primary_role', 'check_importance' => 'display_employee_importance', 'check_contract_end_date' => 'display_employee_contract_end_date', 'check_agreement_end_date' => 'display_employee_agreement_end_date', 'check_intended_transition' => 'display_employee_intended_transition', 'check_transition_confirmed' => 'display_employee_transition_confirmed', 'check_transition_complete' => 'display_employee_complete_transition', 'check_transition_complete_date' => 'display_employee_actual_transition_date', 'check_incoming_partner' => 'display_employee_incoming_partner', 'check_relationship' => 'display_employee_relationship', 'check_referral_mechanism' => 'display_employee_referral_mechanism', 'check_chw_supervisor' => 'display_employee_chw_supervisor', 'check_trainings_provided' => 'display_employee_trainings_provided', 'check_courses_completed' => 'display_employee_courses_completed', 'check_site_name' => 'display_employee_site_name', 'check_employee_header' => 'display_employee_employee_header', 'check_other_id' => 'display_employee_other_id', 'check_disability' => 'display_employee_disability', 'check_nationality' => 'display_employee_nationality', 'check_race' => 'display_employee_race', 'check_registration_number' => 'display_employee_registration_number', 'check_salary' => 'display_employee_salary', 'check_benefits' => 'display_employee_benefits', 'check_additional_expenses' => 'display_employee_additional_expenses', 'check_stipend' => 'display_employee_stipend');
     if ($this->getRequest()->isPost()) {
         // Update db
         $updateData = array();
         // update translation labels
         $tranTable = new Translation();
         foreach ($labelNames as $input_key => $db_key) {
             if ($this->_getParam($input_key)) {
                 try {
                     $tranTable->update(array('phrase' => $this->_getParam($input_key)), "key_phrase = '{$db_key}'");
                     $this->viewAssignEscaped($input_key, $this->_getParam($input_key));
                 } catch (Zend_Exception $e) {
                     error_log($e);
                 }
             }
         }
         // update _system (checkboxes)
         foreach ($checkboxFields as $input_key => $db_field) {
             $value = $this->_getParam($input_key) == NULL ? 0 : 1;
             $updateData[$db_field] = $value;
             $this->view->assign($input_key, $value);
         }
         $updateData['employee_header'] = $this->_getParam('employee_header');
         $this->view->assign('employee_header', $this->_getParam('employee_header') ? $this->_getParam('employee_header') : '');
         $sysTable->update($updateData, '');
     } else {
         // view
         // checkboxes
         $sysRows = $sysTable->fetchRow($sysTable->select()->limit(1));
         $this->view->assign('employee_header', isset($sysRows->employee_header) ? $sysRows->employee_header : '');
         foreach ($checkboxFields as $input_key => $field_key) {
             if (isset($sysRows->{$field_key})) {
                 $this->view->assign($input_key, $sysRows->{$field_key});
             }
         }
         // labels
         $t = Translation::getAll();
         foreach ($labelNames as $input_key => $db_key) {
             $this->viewAssignEscaped($input_key, $t[$db_key]);
         }
     }
     // redirect to next page
     if ($this->_getParam('redirect')) {
         header("Location: " . $this->_getParam('redirect'));
         exit;
     } else {
         if ($this->_getParam('saveonly')) {
             $status = ValidationContainer::instance();
             $status->setStatusMessage(t('Your settings have been updated.'));
         }
     }
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:60,代码来源:AdminController.php

示例5: psFacilityReportAction

 public function psFacilityReportAction()
 {
     $db = Zend_Db_Table_Abstract::getDefaultAdapter();
     //locations
     $this->viewAssignEscaped('locations', Location::getAll());
     $helper = new Helper();
     $this->view->assign('mode', 'id');
     $this->view->assign('institutions', $helper->getInstitutions());
     $this->view->assign('cadres', $helper->getCadres());
     $this->view->assign('institutiontypes', $helper->AdminInstitutionTypes());
     $this->view->assign('cohorts', $helper->getCohorts());
     $this->view->assign('nationalities', $helper->getNationalities());
     $this->view->assign('funding', $helper->getFunding());
     $this->view->assign('tutors', $helper->getTutors());
     $this->view->assign('facilities', $helper->getFacilities());
     $this->view->assign('facilitytypes', $helper->getFacilityTypes());
     $this->view->assign('sponsors', $helper->getOldSponsors());
     $this->view->assign('coursetypes', $helper->AdminCourseTypes());
     $this->view->assign('degrees', $helper->getDegrees());
     $this->view->assign('tutortypes', $helper->AdminTutortypes());
     if ($this->getSanParam('process')) {
         // INITIALIZING ARRAYS
         $headers = array();
         $select = array();
         $from = array();
         $join = array();
         //
         //	$join[] = array(
         // 		"type"   => "inner",
         //		"table"  => "tablename t",
         //		"field1" => "t.field1",
         //		"field2" => "t2.field2",
         //	);
         //
         $where = array();
         $sort = array();
         $locations = Location::getAll();
         $translation = Translation::getAll();
         $showfacility = isset($_GET['showfacility']);
         $showProvince = isset($_GET['showProvince']);
         $showDistrict = isset($_GET['showDistrict']);
         $showRegionC = isset($_GET['showRegionC']);
         $showfacilitytype = isset($_GET['showfacilitytype']);
         $showinstitutionsponsors = isset($_GET['showinstitutionsponsors']);
         $showcadre = isset($_GET['showcadre']);
         $showgraduates = isset($_GET['showgraduates']);
         $showgraduatesyear = isset($_GET['showgraduatesyear']);
         $showpatients = isset($_GET['showpatients']);
         $startday = isset($_GET['startday']);
         $facility = $this->getSanParam('facility');
         $province_id = $this->getSanParam('province_id');
         $district_id = $this->getSanParam('district_id');
         $region_c_id = $this->getSanParam('region_c_id');
         $facilitytype = $this->getSanParam('facilitytype');
         $institutionsponsors = $this->getSanParam('institutionsponsors');
         $cadre = $this->getSanParam('cadre');
         $from[] = "facility f";
         //if ($showfacility){
         $headers[] = "Facility";
         $select[] = "f.facility_name";
         $sort[] = "f.facility_name";
         //}
         if ($facility != "") {
             $where[] = "f.id = " . $facility;
         }
         if ($showfacilitytype || $facilitytype) {
             // Need join on facility type to show OR filter
             if ($showfacilitytype) {
                 // Only add header and select if showing field
                 $headers[] = "Facility type";
                 $select[] = "fto.facility_type_phrase";
             }
             $join[] = array("type" => "inner", "table" => "facility_type_option fto", "field1" => "fto.id", "field2" => "f.type_option_id");
             if ($facilitytype) {
                 $where[] = "fto.id = " . $facilitytype;
             }
             $sort[] = "fto.facility_type_phrase";
         }
         if ($showinstitutionsponsors || $institutionsponsors) {
             // Need join on facility type to show OR filter
             if ($showinstitutionsponsors) {
                 // Only add header and select if showing field
                 $headers[] = "Sponsor";
                 $select[] = "fso.facility_sponsor_phrase";
             }
             // OPTIONAL LINK - LEFT JOINING
             $join[] = array("type" => "left", "table" => "facility_sponsor_option fso", "field1" => "fso.id", "field2" => "f.sponsor_option_id");
             if ($institutionsponsors) {
                 $where[] = "fso.id = " . $institutionsponsors;
             }
             $sort[] = "fso.facility_sponsor_phrase";
         }
         // INCLUDING LOCATION IDENTIFYER, IF NECESSARY
         if ($region_c_id != "" || $district_id != "" || $province_id != "" || $showProvince != "" || $showDistrict != "" || $showRegionC != "") {
             $select[] = "f.location_id";
         }
         if ($showcadre || $cadre) {
             $join[] = array("type" => "left", "table" => "person_qualification_option pqo", "field1" => "pqo.id", "field2" => "f.sponsor_option_id");
         }
         $query = "SELECT ";
//.........这里部分代码省略.........
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:101,代码来源:ReportsController.php


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