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


PHP jgettext函数代码示例

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


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

示例1: displayResult

    /**
     * Wizard
     * Displays the project information introduced so far.
     *
     * @param \EcrProjectBase  $project
     * @param array            $formFieldNames fields already displayed
     */
    public static function displayResult(EcrProjectBase $project, $formFieldNames = array())
    {
        ?>
    <div class="ecr_result">
        <h3><?php 
        echo jgettext('Your extension so far');
        ?>
</h3>

        <?php 
        echo self::displayRow(jgettext('Type'), 'type', 'tpl_type', $project, $formFieldNames);
        echo self::displayRow(jgettext('Template'), 'tplName', 'tpl_name', $project, $formFieldNames);
        echo self::displayRow(jgettext('JVersion'), 'JCompat', 'jcompat', $project, $formFieldNames);
        echo '<div style="background-color: #fff; border: 1px solid gray; padding-left: 0.5em;">';
        $info = EcrProjectTemplateHelper::getTemplateInfo($project->type, $project->tplName);
        echo $info ? $info->description : '';
        echo '</div>';
        echo '<div class=extension" style="background-color: #ffff99; padding: 1em; font-size: 1.2em;">';
        echo self::displayRow(jgettext('Name'), 'name', 'com_name', $project, $formFieldNames);
        echo self::displayRow(jgettext('Version'), 'version', 'version', $project, $formFieldNames);
        echo self::displayRow(jgettext('Description'), 'description', 'description', $project, $formFieldNames);
        echo '</div>';
        echo '<div class="credits" style="background-color: #ffc;">';
        echo self::displayRow(jgettext('Author'), 'author', 'author', $project, $formFieldNames);
        echo self::displayRow(jgettext('Author e-mail'), 'authorEmail', 'authorEmail', $project, $formFieldNames);
        echo self::displayRow(jgettext('Author URL'), 'authorUrl', 'authorUrl', $project, $formFieldNames);
        echo self::displayRow(jgettext('License'), 'license', 'license', $project, $formFieldNames);
        echo self::displayRow(jgettext('Copyright (C)'), 'copyright', 'copyright', $project, $formFieldNames);
        echo self::displayRow(jgettext('List postfix'), 'listPostfix', 'list_postfix', $project, $formFieldNames);
        echo '</div>';
        ?>
</div>
    <?php 
    }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:41,代码来源:wizard.php

示例2: format

 /**
  * @param        $format
  * @param string $type
  *
  * @return string
  */
 public function format($format, $type = 'new')
 {
     $ret = '';
     $ret .= '<span class="img icon16-' . $type . '">';
     switch ($type) {
         case 'edit':
             $ret .= jgettext('Edit');
             break;
         case 'add':
             $ret .= jgettext('New');
             break;
         default:
             break;
     }
     //switch
     $ret .= '</span>';
     switch ($format) {
         case 'erm':
             $ret .= '<div style="color: blue; font-weight: bold; text-align:center;">' . ucfirst($this->group) . ' - ' . $this->title . '</div>';
             $ret .= '<div style="color: orange; font-weight: bold;">' . $this->description . '</div>';
             break;
         default:
             return sprintf(jgettext('Undefined format: %s'), $format);
             break;
     }
     //switch
     return $ret;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:34,代码来源:info.php

示例3: getLabel

 /**
  * Method to get the field label markup.
  *
  * @return  string  The field label markup.
  * @since   11.1
  */
 protected function getLabel()
 {
     //-- Initialise variables.
     $label = '';
     if ($this->hidden) {
         return $label;
     }
     //-- Get the label text from the XML element, defaulting to the element name.
     $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
     $text = $this->translateLabel ? jgettext($text) : $text;
     //-- Build the class for the label.
     $class = !empty($this->description) ? 'hasTip' : '';
     $class = $this->required == true ? $class . ' required' : $class;
     //-- Add the opening label tag and main attributes attributes.
     $label .= '<label id="' . $this->id . '-lbl" for="' . $this->id . '" class="' . $class . '"';
     //-- If a description is specified, use it to build a tooltip.
     if (!empty($this->description)) {
         $description = $this->translateDescription ? jgettext($this->description) : $this->description;
         $label .= ' title="' . htmlspecialchars(trim($text, ':') . '::' . $description, ENT_COMPAT, 'UTF-8') . '"';
     }
     //-- Add the label text and closing tag.
     if ($this->required) {
         $label .= '>' . $text . '<span class="star">&#160;*</span></label>';
     } else {
         $label .= '>' . $text . '</label>';
     }
     return $label;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:34,代码来源:formfield.php

示例4: displayOptions

 /**
  * Displays available options with input fields.
  *
  * @param EcrProjectBase $project The project
  *
  * @return string HTML
  */
 public function displayOptions(EcrProjectBase $project)
 {
     $html = array();
     $html[] = '<label for="class_prefix">' . jgettext('Class prefix') . '</label>';
     $html[] = '<input type="text" id="class_prefix" name="class_prefix" />';
     return implode(NL, $html);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:14,代码来源:options.php

示例5: autoCode

 /**
  * Draw a submit button
  *
  * @param array $requireds required field names separated by komma
  */
 public static function autoCode($requireds = array())
 {
     $requireds = (array) $requireds;
     $requireds = implode(',', $requireds);
     echo '<br />';
     echo '<div class="btn" onclick="updateAutoCode(\'' . $requireds . '\');">' . '<i class="img icon16-ecr_save"></i>' . jgettext('Save') . '</div>';
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:12,代码来源:button.php

示例6: backtrace

    /**
     * Prints a debug backtrace
     *
     * @access public
     * @static
     */
    public static function backtrace()
    {
        // disabled ?
        //
        if (!krumo::_debug()) {
            return false;
        }
        // render it
        //
        ?>
<div class="krumo-title"><?php 
        echo jgettext('Backtrace');
        ?>
</div>
        <?php 
        $ts = debug_backtrace();
        $traces = array();
        foreach ($ts as $trace) {
            $t = array();
            foreach ($trace as $key => $value) {
                if ($key == 'file') {
                    $value = str_replace(JPATH_BASE . DS, '', $value);
                }
                $t[$key] = $value;
            }
            //foreach;
            $traces[] = $t;
        }
        //foreach
        return krumo::dump($traces);
    }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:37,代码来源:krumo.php

示例7: checkMD5File

/**
 * Checks an extension with a given MD5 checksum file.
 *
 * @param string $path Path to md5 file
 * @param array $extensionPaths Indexed array: First folder in md5 file path as key - extension path as value
 *
 * @return array Array of errors
 */
function checkMD5File($path, $extensionPaths)
{
    jimport('joomla.filesystem.file');
    $lines = explode("\n", JFile::read($path));
    $errors = array();
    $errors[0] = 0;
    //counter..
    foreach ($lines as $line) {
        if (!trim($line)) {
            continue;
        }
        list($md5, $file) = explode(' ', $line);
        $parts = explode(DS, $file);
        if (!array_key_exists($parts[0], $extensionPaths)) {
            continue;
        }
        $path = $extensionPaths[$parts[0]] . DS . substr($file, strlen($parts[0]) + 1);
        echo JDEBUG ? $path . '...' : '';
        $errors[0]++;
        if (!JFile::exists($path)) {
            $errors[] = sprintf(jgettext('File not found: %s'), $path);
            echo JDEBUG ? 'not found<br />' : '';
            continue;
        }
        if (md5_file($path) != $md5) {
            $errors[] = sprintf(jgettext('MD5 check failed on file: %s'), $path);
            echo JDEBUG ? 'md5 check failed<br />' : '';
            continue;
        }
        echo JDEBUG ? 'OK<br />' : '';
    }
    //foreach
    return $errors;
}
开发者ID:cuongnd,项目名称:etravelservice,代码行数:42,代码来源:md5check.po.php

示例8: getInput

 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  * @since   11.1
  */
 protected function getInput()
 {
     //-- Initialize variables.
     $html = array();
     //-- Initialize some field attributes.
     $class = $this->element['class'] ? ' class="radio ' . (string) $this->element['class'] . '"' : ' class="radio"';
     //-- Start the radio field output.
     $html[] = '<fieldset id="' . $this->id . '"' . $class . '>';
     //-- Get the field options.
     $options = $this->getOptions();
     //-- Build the radio field output.
     foreach ($options as $i => $option) {
         //-- Initialize some option attributes.
         $checked = (string) $option->value == (string) $this->value ? ' checked="checked"' : '';
         $class = !empty($option->class) ? ' class="' . $option->class . '"' : '';
         $disabled = !empty($option->disable) ? ' disabled="disabled"' : '';
         //-- Initialize some JavaScript option attributes.
         $onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : '';
         $html[] = '<input type="radio" id="' . $this->id . $i . '" name="' . $this->name . '"' . ' value="' . htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8') . '"' . $checked . $class . $onclick . $disabled . '/>';
         $html[] = '<label for="' . $this->id . $i . '"' . $class . '>' . jgettext($option->text) . '</label>';
     }
     //foreach
     //-- End the radio field output.
     $html[] = '</fieldset>';
     return implode("\n", $html);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:32,代码来源:radio.php

示例9: info

 /**
  * Info about the thing.
  *
  * @return EcrProjectTemplateInfo
  */
 public function info()
 {
     $info = new EcrProjectTemplateInfo();
     $info->group = ucfirst($this->group);
     $info->title = 'Simple 3L';
     $info->description = jgettext('A simple, empty, model') . ' - J! 3.0 Legacy';
     return $info;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:13,代码来源:part.php

示例10: versioned

 /**
  * draws a checkbox
  * select if a backup version should be saved
  *
  * @return string
  */
 public static function versioned()
 {
     $params = JComponentHelper::getParams('com_easycreator');
     $save_versioned = JFactory::getApplication()->input->getInt('save_versioned', $params->get('save_versioned'));
     $checked = $save_versioned ? ' checked="checked"' : '';
     $html = '<input type="checkbox" name="save_versioned" id="save_versioned" value="1"' . $checked . '>' . '<label class="inline" for="save_versioned">' . jgettext('Save versioned') . '</label>';
     return $html;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:14,代码来源:check.php

示例11: info

 /**
  * Info about the thing.
  *
  * @return EcrProjectTemplateInfo
  */
 public function info()
 {
     $info = new EcrProjectTemplateInfo();
     $info->group = ucfirst($this->group);
     $info->title = 'Simple View 2.5';
     $info->description = jgettext('A simple, empty, view');
     return $info;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:13,代码来源:part.php

示例12: display

    /**
     * Context menu
     */
    public static function display()
    {
        $input = JFactory::getApplication()->input;
        //--Add css and javascript
        ecrLoadMedia('contextmenu');
        $ajaxLink = 'index.php?option=com_easycreator';
        $ajaxLink .= '&controller=ajax&tmpl=component';
        $ajaxLink .= '&old_task=' . $input->get('task');
        $ajaxLink .= '&old_controller=' . $input->get('controller');
        $ajaxLink .= '&ecr_project=' . $input->get('ecr_project');
        ?>
    <script type="text/javascript">
        SimpleContextMenu.setup({'preventDefault' : true, 'preventForms' : false});
        SimpleContextMenu.attach('pft-file', 'CM1');
        SimpleContextMenu.attach('pft-directory', 'CM2');
    </script>

    <!-- Context menu files -->
    <?php 
        $menuEntries = array(array(jgettext('New folder'), 'new_folder', 'add'), array(jgettext('New file'), 'new_file', 'add'), array(jgettext('Rename'), 'rename_file', 'rename'), array(jgettext('Delete'), 'delete_file', 'delete'));
        ?>
    <ul id="CM1" class="SimpleContextMenu">
        <li class="title"><?php 
        echo jgettext('File');
        ?>
</li>
        <?php 
        foreach ($menuEntries as $menuEntry) {
            self::addEntry($ajaxLink, $menuEntry[0], $menuEntry[1], $menuEntry[2]);
        }
        //foreach
        ?>
    </ul>

    <!-- Context menu folders -->
    <?php 
        $menuEntries = array(array(jgettext('New folder'), 'new_folder', 'add'), array(jgettext('New file'), 'new_file', 'add'), array(jgettext('Rename'), 'rename_folder', 'rename'), array(jgettext('Delete'), 'delete_folder', 'delete'));
        ?>
    <ul id="CM2" class="SimpleContextMenu">
        <li class="title"><?php 
        echo jgettext('Folder');
        ?>
</li>
        <?php 
        foreach ($menuEntries as $menuEntry) {
            self::addEntry($ajaxLink, $menuEntry[0], $menuEntry[1], $menuEntry[2]);
        }
        //foreach
        ?>
    </ul>

    <input
        type="hidden" name="act_folder" id="act_folder"/>
    <input
        type="hidden" name="act_file" id="act_file"/>
    <?php 
    }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:60,代码来源:contextmenu.php

示例13: getFields

 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $html = array();
     $html[] = '<label class="inline" for="fields_' . $cnt . '_releaseState">' . jgettext('Release state') . '</label>';
     $html[] = EcrHtmlSelect::releaseStates(array('name' => 'fields[' . $cnt . '][releaseState]', 'id' => 'fields_' . $cnt . '_releaseState', 'selected' => $this->releaseState));
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, 'abort', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     return implode("\n", $html);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:17,代码来源:updateserver.php

示例14: getFields

 /**
  * Get the input fields
  *
  * @param int $cnt A counter value.
  *
  * @return string
  */
 public function getFields($cnt)
 {
     $html = array();
     $html[] = $this->getLabel($cnt, 'script', jgettext('Path'));
     $html[] = $this->getInput($cnt, 'script', $this->script);
     $html[] = '<br />';
     $html[] = $this->getLabel($cnt, '', jgettext('Abort on failure'));
     $html[] = EcrHtmlSelect::yesno('fields[' . $cnt . '][abort]', $this->abort);
     return implode("\n", $html);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:17,代码来源:script.php

示例15: getForm

 /**
  * Method for getting the form from the model.
  *
  * @param   array    $data      Data for the form.
  * @param   boolean  $loadData  True if the form is to load its own data (default case), false if not.
  *
  * @throws Exception
  *
  * @return JForm
  */
 public function getForm($data = array(), $loadData = true)
 {
     JLoader::import('models.fields.formfield', JPATH_COMPONENT);
     //-- Get the form.
     $form = $this->loadForm('com_easycreator.config', 'config', array('control' => 'params', 'load_data' => $loadData));
     if (empty($form)) {
         throw new Exception(jgettext('Unable to load the config form'));
     }
     $form->bind(JComponentHelper::getParams('com_easycreator'));
     return $form;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:21,代码来源:config.php


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