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


PHP Url::media方法代码示例

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


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

示例1: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $expert = ORM::factory('Expert', $id);
     if (!$expert->loaded()) {
         $this->redirect('manage/expert');
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $expert->delete();
         $opinions = ORM::factory('Expert_Opinion')->where('expert_id', '=', $id)->find_all();
         foreach ($opinions as $item) {
             ORM::factory('Expert_Opinion', $item->id)->delete();
         }
         $list = ORM::factory('Expert');
         $paginate = Paginate::factory($list);
         $list = $list->find_all();
         $last_page = $paginate->page_count();
         if ($this->page > $last_page) {
             $this->page = $this->page - 1;
         }
         if ($this->page <= 0) {
             $this->page = 1;
         }
         Message::success(i18n::get('Judge and all his positions removed'));
         $this->redirect('manage/expert/page-' . $this->page);
     } else {
         $this->set('expert', $expert)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/expert/page-' . $this->page));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:30,代码来源:Expert.php

示例2: action_spam

 public function action_spam()
 {
     $id = (int) $this->request->param('id', 0);
     $question = ORM::factory('Feedback_Question', $id);
     $user_id = $this->user->id;
     if (!$question->loaded()) {
         $this->redirect('manage/feedback');
     }
     $token = Arr::get($_POST, 'token', false);
     $return = Security::xss_clean(Arr::get($_GET, 'r', 'manage/expert'));
     $this->set('return', Url::media($return));
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $question->is_spam = ($question->is_spam + 1) % 2;
         $question->spam_mod_id = $user_id;
         $question->save();
         if ($question->is_spam == 1) {
             Message::success(i18n::get('The question is marked as spam'));
         } else {
             Message::success(i18n::get('Marked "Spam" is removed from the question'));
         }
         $this->redirect($return);
     } else {
         if ($question->loaded()) {
             $this->set('question', $question)->set('token', Security::token(true));
         } else {
             $this->redirect('manage/expert');
         }
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:29,代码来源:Feedback.php

示例3: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $expert = ORM::factory('Expert_Opinion', $id);
     if (!$expert->loaded()) {
         $this->redirect('manage/expertopinions');
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $loger = new Loger('delete', $expert->title);
         $loger->logThis($expert);
         $expert->delete();
         $list = ORM::factory('Expert_Opinion');
         $paginate = Paginate::factory($list);
         $list = $list->find_all();
         $last_page = $paginate->page_count();
         if ($this->page > $last_page) {
             $this->page = $this->page - 1;
         }
         if ($this->page <= 0) {
             $this->page = 1;
         }
         Message::success(i18n::get('The position of the expert removed'));
         $this->redirect('manage/expertopinions/page-' . $this->page);
     } else {
         $this->set('item', $expert)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/expertopinions/page-' . $this->page));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:28,代码来源:Expertopinions.php

示例4: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $type = Arr::get($_GET, 'type', 'slider');
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $slider = ORM::factory('Slider', $id);
         $loger = new Loger('delete', $slider->link_ru);
         $loger->log($slider);
         $slider->delete();
         $this->redirect('manage/sliders/?type=' . $type);
     } else {
         $this->set('token', Security::token(true))->set('r', Url::media('manage/sliders?type=' . $type));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:15,代码来源:Sliders.php

示例5: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         ORM::factory('Leader', $id)->delete();
         $this->redirect('manage/leaders');
     } else {
         $leader = ORM::factory('Leader', $id);
         if ($leader->loaded()) {
             $this->set('record', $leader)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/leader'));
         } else {
             throw new HTTP_Exception_404();
         }
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:Leaders.php

示例6: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $token = Arr::get($_POST, 'token', false);
     $acts = ORM::factory('Acts', $id);
     if (!$acts->loaded()) {
         throw new HTTP_Exception_404();
     }
     if ($this->request->post() && Security::token() === $token) {
         $acts->delete();
         Message::success('Акт удален');
         $this->redirect('manage/acts');
     } else {
         $this->set('record', $acts)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/acts'));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:Acts.php

示例7: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         ORM::factory('Document', $id)->delete();
         $this->redirect('manage/documents');
     } else {
         $document = ORM::factory('Document', $id);
         if ($document->loaded()) {
             $this->set('record', $document)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/document'));
         } else {
             $this->redirect('manage/document');
         }
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:Documents.php

示例8: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $link = ORM::factory('Link', $id);
     if (!$link->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $link->delete();
         Message::success('Удалено');
         $this->redirect('manage/links');
     } else {
         $this->set('record', $link)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/links'));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:Links.php

示例9: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $point = ORM::factory('Point', $id);
     if (!$point->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $loger = new Loger($event, $point->name);
         $loger->logThis($point);
         $redirect = 'manage/maps/view/' . $point->district_id;
         $point->delete();
         $this->redirect($redirect);
     } else {
         $this->set('record', $point)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/maps/view/' . $point->district_id));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:18,代码来源:Point.php

示例10: action_delete

 public function action_delete()
 {
     $type = (int) Arr::get($_GET, 'type', 0);
     $id = (int) $this->request->param('id', 0);
     $item = ORM::factory('Comment', $id);
     if (!$item->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $item->delete();
         Message::success('Комментарий удален');
         $this->redirect('manage/comments?type=' . $type);
     } else {
         $this->set('type', $type);
         $this->set('record', $item)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/comments?type=' . $type));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:18,代码来源:Comments.php

示例11: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $infograph = ORM::factory('Infograph', $id);
     if (!$infograph->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $loger = new Loger('delete', $infograph->title);
         $loger->log($infograph);
         $infograph->delete();
         Message::success('Запись удалена');
         $this->redirect('manage/infographs');
     } else {
         $this->set('record', $infograph)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/infographs'));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:18,代码来源:Infographs.php

示例12: action_delete

 public function action_delete()
 {
     $id = (int) $this->request->param('id', 0);
     $item = ORM::factory('Chronology_Line', $id);
     if (!$item->loaded()) {
         throw new HTTP_Exception_404('Page not found');
     }
     $period = ORM::factory('Chronology', $item->period_id);
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->post() and Security::token() === $token) {
         $loger = new Loger('delete', $item->title);
         $loger->logThis($item);
         $item->delete();
         Message::success('Событие удалено');
         $this->redirect('manage/lines/list/' . $period->id);
     } else {
         $this->set('token', Security::token(true))->set('r', Url::media('manage/lines/list/' . $period->id))->set('period', $period);
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:19,代码来源:Lines.php

示例13: action_variantdelete

 public function action_variantdelete()
 {
     $id = (int) $this->request->param('id', 0);
     $variant = ORM::factory('Test_Questvar', $id);
     if (!$variant->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $quest_id = $variant->quests_id;
         $variant->delete();
         Message::success(I18n::get('Record deleted'));
         $this->redirect('manage/tests/variants/' . $quest_id);
     } else {
         $this->set('record', $variant)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/tests/variants/' . $variant->quest_id));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:17,代码来源:Themes.php

示例14: action_deletecategory

 public function action_deletecategory()
 {
     $id = (int) $this->request->param('id', 0);
     $category = ORM::factory('Zhuze', $id);
     if (!$category->loaded()) {
         throw new HTTP_Exception_404();
     }
     $token = Arr::get($_POST, 'token', false);
     if ($this->request->method() == Request::POST && Security::token() === $token) {
         $category->delete();
         Message::success(I18n::get("Category deleted"));
         $this->redirect('manage/specprojects/zhuzes');
     } else {
         $this->set('record', $category)->set('token', Security::token(true))->set('cancel_url', Url::media('manage/specprojects/zhuzes'));
     }
 }
开发者ID:HappyKennyD,项目名称:teest,代码行数:16,代码来源:Specprojects.php

示例15:

            ?>
"><span><?php 
            echo $max_page;
            ?>
</span></a>
                <?php 
        }
        ?>
            <?php 
    }
    ?>
            <?php 
    if ($page < $max_page) {
        ?>
                <a href="<?php 
        echo Url::media($link) . '/' . $key . '-' . ($page + 1);
        echo Url::query();
        ?>
"><span><?php 
        echo __('Next');
        ?>
</span></a>
            <?php 
    } else {
        ?>

            <?php 
    }
    ?>
        </div>
    </div>
开发者ID:HappyKennyD,项目名称:teest,代码行数:31,代码来源:paginatemain.php


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