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


PHP _g函数代码示例

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


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

示例1: render

    function render($args, $instance)
    {
        global $gantry;
        ob_start();
        ?>
            <div id="rt-accessibility">
                <div class="rt-desc"><?php 
        _ge($instance['text']);
        ?>
</div>
                <div id="rt-buttons">
                    <a href="<?php 
        echo $gantry->addQueryStringParams($gantry->getCurrentUrl(array('reset-settings')), array('font-size' => 'smaller'));
        ?>
" title="<?php 
        echo _g('Decrease Font Size');
        ?>
" class="small"><span class="button"></span></a>
                    <a href="<?php 
        echo $gantry->addQueryStringParams($gantry->getCurrentUrl(array('reset-settings')), array('font-size' => 'larger'));
        ?>
" title="<?php 
        echo _g('Increase Font Size');
        ?>
" class="large"><span class="button"></span></a>
                </div>
            </div>
            <div class="clear"></div>
	    <?php 
        echo ob_get_clean();
    }
开发者ID:rotoballer,项目名称:emily,代码行数:31,代码来源:fontsizer.php

示例2: __construct

 public function __construct()
 {
     if (!isset($_SESSION)) {
         $this->initEnvironment();
     } else {
         if (!validSession()) {
             die(_g('The session is invalid, please login again'));
         }
     }
     try {
         $this->initSmarty();
         TableMng::init();
         $this->_adminInterface = new AdminInterface(NULL, $this->_smarty);
         // AdminInterface has used global $smarty, workaround
         AdminInterface::$smartyHelper = $this->_smarty;
         $this->_moduleExecutionParser = new ModuleExecutionInputParser();
         $this->_moduleExecutionParser->setSubprogramPath('root/administrator');
         $this->loadVersion();
         $this->initDatabaseConnections();
         $this->_logger = new Logger($this->_pdo);
         $this->_logger->categorySet('Administrator');
         $this->_acl = new Acl($this->_logger, $this->_pdo);
     } catch (MySQLConnectionException $e) {
         die('Sorry, could not connect to the database.');
     }
 }
开发者ID:babesk,项目名称:babesk,代码行数:26,代码来源:Administrator.php

示例3: edit

 function edit()
 {
     global $basedomain, $app_domain;
     $userid['id'] = intval(_g('id'));
     $dataUser = $this->userHelper->getListUser($userid);
     if ($dataUser) {
         $getIndustri = $this->contentHelper->getIndustri($dataUser[0]['industri_id']);
         foreach ($dataUser as $key => $value) {
             $dataUser[$key]['perusahaan'] = $getIndustri[0];
         }
     }
     if (_p('token')) {
         // upload image
         $uploadImage['status'] = false;
         if ($_FILES['image']['name'] != "") {
             $uploadImage = uploadFile('image', 'user');
         }
         $dataarr = array();
         $userid = intval(_p('id'));
         $addUser = $this->userHelper->updateUserProfile($dataarr, $userid);
         if ($uploadImage['status']) {
             $updateUser = $this->userHelper->updateUserImage($uploadImage['filename'], $addUser);
         }
         if ($addUser) {
             redirect($basedomain . 'user');
         }
         exit;
     }
     // pr($dataUser);
     $this->view->assign('data', $dataUser[0]);
     return $this->loadView('user-detail');
 }
开发者ID:Trinata,项目名称:pondokgurubakti,代码行数:32,代码来源:user.php

示例4: getInput

 public function getInput()
 {
     global $gantry;
     $buffer = '';
     // get the sets just below
     foreach ($this->fields as $field) {
         if ($field->type == 'set') {
             $this->sets[] = $field;
         }
     }
     $buffer .= "<div class='wrapper'>\n";
     foreach ($this->fields as $field) {
         if ((string) $field->type != 'set') {
             $selector = false;
             $enabler = false;
             if ($field->element['enabler'] && strtolower((string) $field->element['enabler']) == 'true') {
                 $this->enabler = $field;
                 $enabler = true;
             }
             if ($field->element['selector'] && (string) $field->element['selector'] == true) {
                 $field->detached = false;
                 $selector = true;
                 if ($field != $this->enabler && isset($this->enabler) && (int) $this->enabler->value == 0) {
                     $field->detached = true;
                 }
                 foreach ($this->sets as $set) {
                     //Create a new option object based on the <option /> element.
                     $tmp = GantryHtmlSelect::option((string) $set->element['name'], _g(trim((string) $set->element['label'])), 'value', 'text', (string) $set->element['disabled'] == 'true');
                     // Set some option attributes.
                     $tmp->class = (string) $set->element['class'];
                     // Set some JavaScript option attributes.
                     $tmp->onclick = (string) $set->element['onclick'];
                     // Add the option object to the result set.
                     //$options[] = $tmp;
                     $field->addOption($tmp);
                 }
             }
             $this->activeSet[$field->type] = $field->value;
             //array_push(array($field->type => $field->value), $this->activeSet);
             $itemName = $this->fieldname . "-" . $field->fieldname;
             $buffer .= '<div class="chain ' . $itemName . ' chain-' . strtolower($field->type) . '">' . "\n";
             if (strlen($field->getLabel())) {
                 $buffer .= '<span class="chain-label">' . _g($field->getLabel()) . '</span>' . "\n";
             }
             if ($selector) {
                 $buffer .= '<div class="selectedset-switcher">' . "\n";
             }
             if ($enabler) {
                 $buffer .= '<div class="selectedset-enabler">' . "\n";
             }
             $buffer .= $field->getInput();
             if ($selector || $enabler) {
                 $buffer .= '</div>' . "\n";
             }
             $buffer .= "</div>" . "\n";
         }
     }
     $buffer .= "</div>" . "\n";
     return $buffer;
 }
开发者ID:rotoballer,项目名称:emily,代码行数:60,代码来源:selectedset.php

示例5: displayDeleteSchoolYearConfirmation

 public function displayDeleteSchoolYearConfirmation($schoolyear)
 {
     $promptMessage = sprintf(_g('Do you really want to delete the Schoolyear "%s"? WARNING: Problems will occur if you do this! Not all parts of the system support this!', $schoolyear->getLabel()));
     $actionString = 'deleteSchoolYear&ID=' . $schoolyear->getId();
     $confirmedString = _g('Yes, I want to break the System and delete the Schoolyear');
     $notConfirmedString = _g('No, I do not want to break the System and delete the Schoolyear');
     $this->confirmationDialog($promptMessage, $this->sectionString, $actionString, $confirmedString, $notConfirmedString);
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:8,代码来源:SchoolyearInterface.php

示例6: validate

 function validate()
 {
     $data = _g('ref');
     // exit;
     logFile($data);
     if ($data) {
         $decode = unserialize(decode($data));
         // check if token is valid
         $salt = "register";
         $userMail = $decode['email'];
         $origToken = sha1($salt . $userMail);
         $token = sha1('reset' . $decode['email']);
         $getToken = $this->loginHelper->getEmailToken($decode['username']);
         if ($getToken['email_token'] == $decode['validby']) {
             if ($decode['reset']) {
                 $msg = $this->msg->display('all', false);
                 $this->view->assign('msg', $msg);
                 $ses_user = $this->loginHelper->getUserEmail($userMail, true);
                 $newData['login'] = $ses_user;
                 $this->view->assign('user', $newData);
                 $this->view->assign('reset', true);
                 return $this->loadView('user/reset');
             } else {
                 if ($decode['token'] == $origToken) {
                     // is valid, then create account and set status to validate
                     if ($decode['regfrom'] == 1) {
                         $this->view->assign('enterAccount', false);
                         $updateAccount = $this->loginHelper->updateUserStatus($decode['username']);
                         if ($updateAccount) {
                             $this->activityHelper->updateEmailLog(true, $userMail, 'account', 2);
                             $dataUSer['username'] = $decode['username'];
                             $dataUSer['password'] = $decode['password'];
                             createAccount($dataUSer);
                             logFile('account ftp user ' . $decode['email'] . ' created');
                             $this->view->assign('validate', 'Validate account success');
                         } else {
                             $this->view->assign('validate', 'Validate account error');
                             logFile('update n_status user ' . $decode['email'] . ' failed');
                         }
                     } else {
                         $this->view->assign('email', $decode['email']);
                         $this->view->assign('enterAccount', true);
                         return $this->loadView('validateProfile');
                     }
                 } else {
                     // invalid token
                     $this->view->assign('validate', 'Validate account error');
                     logFile('token mismatch');
                 }
             }
         } else {
             // invalid token
             $this->view->assign('validate', 'Validate account error');
             logFile('token mismatch');
         }
     }
     return $this->loadView('home');
 }
开发者ID:Gunadarma-Codecamp,项目名称:peer-website,代码行数:58,代码来源:activate.php

示例7: __construct

 function __construct($id = 'entity_name', $action = '', $method = 'POST', $css = 'form-horizontal admin-form')
 {
     $this->id = $id;
     $this->action = '';
     //$action;
     $this->method = $method;
     $this->css = $css;
     $this->ret = _g('r', false);
 }
开发者ID:lotcz,项目名称:zshop,代码行数:9,代码来源:forms.php

示例8: __construct

 function __construct()
 {
     if (empty($this->short_name) || empty($this->long_name)) {
         die("A widget must have a valid type and classname defined");
     }
     $widget_options = array('classname' => $this->css_classname, 'description' => _g($this->description));
     $control_options = array('width' => $this->width, 'height' => $this->height);
     parent::__construct($this->wp_name, $this->long_name, $widget_options, $control_options);
 }
开发者ID:rotoballer,项目名称:emily,代码行数:9,代码来源:gantrywidget.class.php

示例9: tableExists

 /**
  * Checks if the Table for the Temporary assignUsersToClasses data exists
  *
  * Dies displaying a Message when the Query could not be executed
  *
  * @return boolean true if it exists, else false
  */
 protected function tableExists()
 {
     try {
         $stmt = $this->_pdo->query('SHOW TABLES LIKE "KuwasysTemporaryRequestsAssign";');
     } catch (PDOException $e) {
         $this->_interface->dieError(_g('Could not check if the UsersToClasses-Table exists!') . $e->getMessage());
     }
     return (bool) $stmt->fetch();
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:16,代码来源:AssignUsersToClasses.php

示例10: execute

 public function execute($dataContainer)
 {
     $this->entryPoint($dataContainer);
     if (isset($_GET['ID'])) {
         $this->dataFetch();
         $this->displayTpl('change.tpl');
     } else {
         $this->_interface->dieError(_g('Missing id of the user!'));
     }
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:10,代码来源:DisplayChange.php

示例11: resetUserPasswords

 /**
  * Resets the userpasswords to the preset Password
  * Excludes the User with the ID 1, since he is usually the SuperUser
  */
 protected function resetUserPasswords()
 {
     $presetPassword = $this->presetPasswordGet();
     if ($presetPassword) {
         $this->_pdo->query("UPDATE SystemUsers\n\t\t\t\tSET password = '{$presetPassword}'\n\t\t\t\tWHERE ID <> 1");
     } else {
         $this->_interface->dieError(_g('Please set the preset password ' . 'before reseting the users passwords.'));
     }
     $this->_interface->dieSuccess(_g('The passwords were successfully resetted to the preset password.'));
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:14,代码来源:ResetAllUserPasswords.php

示例12: sessionExists

 /**
  * Checks if a session already exists
  * @return bool  true when a session already exists
  */
 private function sessionExists()
 {
     try {
         $res = $this->_pdo->query('SHOW TABLES LIKE "UserUpdateTempUsers"');
         return count($res->fetchAll()) > 0;
     } catch (\PDOException $e) {
         $this->_logger->log('Error checking for already existing Session', 'Notice', Null, json_encode(array('msg' => $e->getMessage())));
         $this->_interface->dieError(_g('Could not check if this has done before!'));
     }
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:14,代码来源:UserUpdateWithSchoolyearChange.php

示例13: helptextFetch

    /**
     * Fetches the helptext from the database
     * @return string The helptext as a string or false if entry not found
     */
    protected function helptextFetch()
    {
        try {
            $res = $this->_pdo->query('SELECT value FROM SystemGlobalSettings
					WHERE name="helptext"');
            return $res->fetchColumn();
        } catch (\PDOException $e) {
            $this->_logger->log('error fetching the helptext', 'Notice', Null, json_encode(array('msg' => $e->getMessage())));
            $this->_interface->dieError(_g('Could not fetch the helptext.'));
        }
    }
开发者ID:Auwibana,项目名称:babesk,代码行数:15,代码来源:Help.php

示例14: classChange

    private function classChange($userId, $classId, $newClassId, $newCategoryId)
    {
        try {
            $stmt = $this->_pdo->prepare('UPDATE KuwasysTemporaryRequestsAssign
				SET classId = :newClassId, categoryId = :newCategoryId
				WHERE userId = :userId AND classId = :classId');
            $stmt->execute(array('userId' => $userId, 'classId' => $classId, 'newClassId' => $newClassId, 'newCategoryId' => $newCategoryId));
        } catch (\PDOException $e) {
            die(json_encode(array('value' => 'error', 'message' => _g('Could not move the User to the other Class!'))));
        }
    }
开发者ID:Auwibana,项目名称:babesk,代码行数:11,代码来源:ChangeClassOfUser.php

示例15: changeStatus

    /**
     * Changes the Status of a Temporary Request Entry
     *
     * Dies with Json on Error
     */
    private function changeStatus($userId, $classId, $statusId)
    {
        try {
            $stmt = $this->_pdo->prepare('UPDATE KuwasysTemporaryRequestsAssign
				SET statusId = :statusId
				WHERE classId = :classId AND userId = :userId');
            $stmt->execute(array('statusId' => $statusId, 'classId' => $classId, 'userId' => $userId));
        } catch (PDOException $e) {
            die(json_encode(array('value' => 'error', 'message' => _g('Could not change the Status of the User'))));
        }
    }
开发者ID:Auwibana,项目名称:babesk,代码行数:16,代码来源:ChangeStatusOfUser.php


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