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


PHP UserHelper::isEditor方法代码示例

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


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

示例1: show

 public function show()
 {
     $this->editable = UserHelper::isEditor();
     $cons = array();
     $field = trim(fRequest::get('field'));
     $start_year = trim(fRequest::get('start_year'));
     $major = trim(fRequest::get('major'));
     $location = trim(fRequest::get('location'));
     $words = trim(fRequest::get('words'));
     $cons['login_name|display_name~'] = $words;
     if (!empty($field)) {
         $cons['field='] = $field;
     }
     if (!empty($start_year)) {
         $cons['start_year='] = $start_year;
     }
     if (!empty($major)) {
         $cons['major='] = $major;
     }
     if (!empty($location)) {
         $cons['location~'] = $location;
     }
     $this->users = fRecordSet::build('Profile', $cons, array('id' => 'asc'));
     $this->field = $field;
     $this->start_year = $start_year;
     $this->major = $major;
     $this->location = $location;
     $this->words = $words;
     $this->render('search/index');
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:30,代码来源:SearchController.php

示例2: delete

 public function delete($id)
 {
     try {
         $msg = new Msg($id);
         if (UserHelper::getProfileId() != $msg->getReceiver() and !UserHelper::isEditor()) {
             throw new fValidationException('not allowed');
         }
         $msg->delete();
         $this->ajaxReturn(array('result' => 'success'));
     } catch (fException $e) {
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:13,代码来源:MsgController.php

示例3: delete

 public function delete($id)
 {
     try {
         $users = new Name($id);
         if (!UserHelper::isEditor()) {
             throw new fValidationException('not allowed');
         }
         $users->delete();
         $this->ajaxReturn(array('result' => 'success'));
     } catch (fException $e) {
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:13,代码来源:NameController.php

示例4:

    echo $tweet->getTimestamp()->getFuzzyDifference();
    ?>
</span>
        <a class="reply" href="javascript:void(0)">
          回复<?php 
    if ($cc = $tweet->getComments()->count()) {
        ?>
(<?php 
        echo $cc;
        ?>
)<?php 
    }
    ?>
        </a>
<?php 
    if (UserHelper::isEditor()) {
        ?>
<a class="delete-tweet" href="javascript:void(0)" data-tweet-id="<?php 
        echo $tweet->getId();
        ?>
" >
          删除</a>
<?php 
    }
    ?>
      </div>
    </div>
    <div class="comments">
      <?php 
    include __DIR__ . '/_comments.php';
    ?>
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:31,代码来源:index.php

示例5: sendmail1

 public function sendmail1()
 {
     try {
         if (!UserHelper::isEditor()) {
             throw fValidationException('not allowed');
         }
         $emails = json_decode(trim(fRequest::get('emails')));
         $title = trim(fRequest::get('title'));
         $content = trim(fRequest::get('content'));
         foreach ($emails as $email) {
             self::send($email, $title, $content);
         }
         $this->ajaxReturn(array('result' => 'success'));
     } catch (Exception $e) {
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:17,代码来源:AdminController.php

示例6: update

 public function update($id)
 {
     try {
         $this->db = fORMDatabase::retrieve();
         $this->db->query('BEGIN');
         $profile = new Profile($id);
         if (UserHelper::getProfileId() != $profile->getId() and !UserHelper::isEditor()) {
             throw new fValidationException('not allowed');
         }
         $profile->setStartYear(fRequest::get('start_year'));
         $profile->setClassNumber(fRequest::get('class_number'));
         $profile->setStudentNumber(trim(fRequest::get('student_number')));
         $profile->setBirthday(trim(fRequest::get('birthday')));
         $profile->setGender(fRequest::get('gender'));
         //$profile->setLocation(trim(fRequest::get('location')));
         $province = trim(fRequest::get('province'));
         $city = trim(fRequest::get('city'));
         $profile->setLocation(self::formatLocation($province, $city));
         $profile->setPostNumber(trim(fRequest::get('post_number')));
         $profile->setPrivacyControl(trim(fRequest::get('privacy', 'int', 0)));
         $profile->setField(trim(fRequest::get('field')));
         $profile->setInstitute(trim(fRequest::get('institute')));
         $profile->setPosition(trim(fRequest::get('position')));
         $profile->setMajor(trim(fRequest::get('major')));
         $profile->setMentor(trim(fRequest::get('mentor')));
         $profile->setSubscription(trim(fRequest::get('subscription')));
         $profile->store();
         foreach ($profile->getContacts() as $contact) {
             $contact->delete();
         }
         foreach ($this->contact_types as $type) {
             if (strlen(trim(fRequest::get($type)))) {
                 $contact = new Contact();
                 $contact->setProfileId($profile->getId());
                 $contact->setType($type);
                 $contact->setContent(trim(fRequest::get($type)));
                 $contact->setCreatedAt(Util::currentTime());
                 $contact->store();
             }
         }
         $this->db->query('COMMIT');
         Activity::fireUpdateProfile();
         $this->ajaxReturn(array('result' => 'success', 'profile_id' => $profile->getId()));
     } catch (fException $e) {
         if (isset($this->db)) {
             $this->db->query('ROLLBACK');
         }
         $this->ajaxReturn(array('result' => 'failure', 'message' => $e->getMessage()));
     }
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:50,代码来源:ProfileController.php


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