• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Jaws_Header类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ManageComments

 /**
  * Displays blog comments manager
  *
  * @access  public
  * @return  string  XHTML template content
  */
 function ManageComments()
 {
     $this->gadget->CheckPermission('ManageComments');
     if (!Jaws_Gadget::IsGadgetInstalled('Comments')) {
         Jaws_Header::Location(BASE_SCRIPT . '?gadget=Blog');
     }
     $cHTML = Jaws_Gadget::getInstance('Comments')->action->loadAdmin('Comments');
     return $cHTML->Comments($this->gadget->name, $this->MenuBar('ManageComments'));
 }
开发者ID:juniortux,项目名称:jaws,代码行数:15,代码来源:Comments.php


示例2: Dashboard

 /**
  * Switch between dashboards
  *
  * @access  public
  * @return  mixed   Redirect if switched successfully otherwise content of 403 html status code
  */
 function Dashboard()
 {
     if (!$GLOBALS['app']->Session->GetPermission('Users', 'AccessDashboard')) {
         return Jaws_HTTPError::Get(403);
     }
     $layoutModel = $this->gadget->model->load('Layout');
     $layoutModel->InitialLayout('Index.Dashboard');
     Jaws_Header::Location('');
 }
开发者ID:uda,项目名称:jaws,代码行数:15,代码来源:Dashboard.php


示例3: Execute

 /**
  * Event execute method
  *
  */
 function Execute($shouter, $code)
 {
     $reqURL = Jaws_Utils::getRequestURL(true);
     $uModel = $this->gadget->model->loadAdmin('ErrorMaps');
     $res = $uModel->GetHTTPError($reqURL, $code);
     if (!Jaws_Error::IsError($res) && !empty($res) && ($res['code'] == 301 || $res['code'] == 302)) {
         Jaws_Header::Location($res['url'], $res['code']);
     }
     return $res;
 }
开发者ID:juniortux,项目名称:jaws,代码行数:14,代码来源:HTTPError.php


示例4: Dashboard

 /**
  * Switch between dashboards
  *
  * @access  public
  * @return  mixed   Redirect if switched successfully otherwise content of 403 html status code
  */
 function Dashboard()
 {
     if (!$GLOBALS['app']->Session->GetPermission('Users', 'AccessDashboard')) {
         return Jaws_HTTPError::Get(403);
     }
     //$user = jaws()->request->fetch('user');
     $user = (int) $GLOBALS['app']->Session->GetAttribute('user');
     $layoutModel = $this->gadget->model->load('Layout');
     $layoutModel->DashboardSwitch($user);
     Jaws_Header::Location('');
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:17,代码来源:Dashboard.php


示例5: VCardBuild

 /**
  * Build and export data with VCard format
  *
  * @access  public
  * @return  string HTML content with menu and menu items
  */
 function VCardBuild()
 {
     if (!$GLOBALS['app']->Session->Logged()) {
         return Jaws_HTTPError::Get(403);
     }
     require_once JAWS_PATH . 'gadgets/Addressbook/vCard.php';
     $model = $this->gadget->model->load('AddressBook');
     $agModel = $this->gadget->model->load('AddressBookGroup');
     $user = (int) $GLOBALS['app']->Session->GetAttribute('user');
     $ids = jaws()->request->fetch('adr:array');
     $link = $this->gadget->urlMap('AddressBook', array(), true);
     if (empty($ids)) {
         Jaws_Header::Location($link);
         return false;
     }
     $addressItems = $model->GetAddresses($ids, $user);
     if (Jaws_Error::IsError($addressItems) || empty($addressItems)) {
         return Jaws_HTTPError::Get(404);
     }
     $result = '';
     $nVCard = array('LastName', 'FirstName', 'AdditionalNames', 'Prefixes', 'Suffixes');
     foreach ($addressItems as $addressItem) {
         $vCard = new vCard();
         $names = explode(';', $addressItem['name']);
         foreach ($names as $key => $name) {
             $vCard->n($name, $nVCard[$key]);
         }
         $vCard->fn($names[3] . (trim($names[3]) == '' ? '' : ' ') . $names[1] . (trim($names[1]) == '' ? '' : ' ') . $names[0]);
         $vCard->nickname($addressItem['nickname']);
         $vCard->title($addressItem['title']);
         $adrGroups = $agModel->GetGroupNames($addressItem['address_id'], $user);
         $vCard->categories(implode(',', $adrGroups));
         $this->FillVCardTypes($vCard, 'tel', $addressItem['tel_home'], $this->_TelTypes);
         $this->FillVCardTypes($vCard, 'tel', $addressItem['tel_work'], $this->_TelTypes);
         $this->FillVCardTypes($vCard, 'tel', $addressItem['tel_other'], $this->_TelTypes);
         $this->FillVCardTypes($vCard, 'email', $addressItem['email_home'], $this->_EmailTypes);
         $this->FillVCardTypes($vCard, 'email', $addressItem['email_work'], $this->_EmailTypes);
         $this->FillVCardTypes($vCard, 'email', $addressItem['email_other'], $this->_EmailTypes);
         $this->FillVCardTypes($vCard, 'adr', $addressItem['adr_home'], $this->_AdrTypes, '\\n');
         $this->FillVCardTypes($vCard, 'adr', $addressItem['adr_work'], $this->_AdrTypes, '\\n');
         $this->FillVCardTypes($vCard, 'adr', $addressItem['adr_other'], $this->_AdrTypes, '\\n');
         $this->FillVCardTypes($vCard, 'url', $addressItem['url'], null, '\\n');
         $vCard->note($addressItem['notes']);
         $result = $result . $vCard;
     }
     header("Content-Disposition: attachment; filename=\"" . 'address.vcf' . "\"");
     header("Content-type: application/csv");
     header("Content-Length: " . strlen($result));
     header("Pragma: no-cache");
     header("Expires: 0");
     header("Connection: close");
     echo $result;
     exit;
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:60,代码来源:VCardBuilder.php


示例6: Link

 /**
  * Redirect to the URL and increase the clicks by one
  * 
  * @access  public
  */
 function Link()
 {
     $lid = jaws()->request->fetch('id', 'get');
     $lid = Jaws_XSS::defilter($lid);
     $model = $this->gadget->model->load('Links');
     $link = $model->GetLink($lid);
     if (!Jaws_Error::IsError($link) && !empty($link)) {
         $click = $model->Click($link['id']);
         if (!Jaws_Error::IsError($click)) {
             Jaws_Header::Location($link['url'], null, 301);
         }
     }
     // By default, on the errors stay in the main page
     Jaws_Header::Referrer();
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:20,代码来源:Link.php


示例7: Export

 /**
  * Export language
  *
  * @access  public
  * @return  void
  */
 function Export()
 {
     $lang = jaws()->request->fetch('lang', 'get');
     require_once PEAR_PATH . 'File/Archive.php';
     $tmpDir = sys_get_temp_dir();
     $tmpFileName = "{$lang}.tar";
     $tmpArchiveName = $tmpDir . DIRECTORY_SEPARATOR . $tmpFileName;
     $writerObj = File_Archive::toFiles();
     $src = File_Archive::read(JAWS_DATA . "languages/{$lang}", $lang);
     $dst = File_Archive::toArchive($tmpArchiveName, $writerObj);
     $res = File_Archive::extract($src, $dst);
     if (!PEAR::isError($res)) {
         return Jaws_Utils::Download($tmpArchiveName, $tmpFileName);
     }
     Jaws_Header::Referrer();
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:22,代码来源:Export.php


示例8: CreateNote

 /**
  * Creates a new note
  *
  * @access  public
  * @return  array   Response array
  */
 function CreateNote()
 {
     $data = jaws()->request->fetch(array('title', 'content'), 'post');
     if (empty($data['title']) || empty($data['content'])) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_INCOMPLETE_DATA'), 'Notepad.Response', RESPONSE_ERROR, $data);
         Jaws_Header::Referrer();
     }
     $model = $this->gadget->model->load('Notepad');
     $data['user'] = (int) $GLOBALS['app']->Session->GetAttribute('user');
     $data['title'] = Jaws_XSS::defilter($data['title']);
     $data['content'] = Jaws_XSS::defilter($data['content']);
     $result = $model->Insert($data);
     if (Jaws_Error::IsError($result)) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_NOTE_CREATE'), 'Notepad.Response', RESPONSE_ERROR, $data);
         Jaws_Header::Referrer();
     }
     $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_NOTICE_NOTE_CREATED'), 'Notepad.Response');
     Jaws_Header::Location($this->gadget->urlMap('Notepad'));
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:25,代码来源:Create.php


示例9: Trackback

 /**
  * Saves a new trackback if all is ok and sends response
  * The function other people send to so our blog gadget
  * gets trackbacks
  *
  * @access  public
  * @return  string  trackback xml response
  */
 function Trackback()
 {
     // Based on Wordpress trackback implementation
     $tb_msg_error = '<?xml version="1.0" encoding="iso-8859-1"?><response><error>1</error><message>#MESSAGE#</message></response>';
     $tb_msg_ok = '<?xml version="1.0" encoding="iso-8859-1"?><response><error>0</error></response>';
     $sender = Jaws_Utils::GetRemoteAddress();
     $ip = $sender['proxy'] . (!empty($sender['proxy']) ? '-' : '') . $sender['client'];
     $post = jaws()->request->fetch(array('title', 'url', 'blog_name', 'excerpt'), 'post');
     if (is_null($post['title']) || is_null($post['url']) || is_null($post['blog_name']) || is_null($post['excerpt'])) {
         Jaws_Header::Location('');
     }
     $id = jaws()->request->fetch('id', 'get');
     if (is_null($id)) {
         $id = jaws()->request->fetch('id', 'post');
         if (is_null($id)) {
             $id = '';
         }
     }
     $title = urldecode($post['title']);
     $url = urldecode($post['url']);
     $blogname = urldecode($post['blog_name']);
     $excerpt = urldecode($post['excerpt']);
     if (trim($id) == '') {
         Jaws_Header::Location('');
     } elseif (empty($title) && empty($url) && empty($blogname)) {
         $url = $this->gadget->urlMap('SingleView', array('id' => $id), true);
         Jaws_Header::Location($url);
     } elseif ($this->gadget->registry->fetch('trackback') == 'true') {
         header('Content-Type: text/xml');
         $model = $this->gadget->model->load('Trackbacks');
         $trackback = $model->NewTrackback($id, $url, $title, $excerpt, $blogname, $ip);
         if (Jaws_Error::IsError($trackback)) {
             return str_replace('#MESSAGE#', $trackback->GetMessage(), $tb_msg_error);
         }
         return $tb_msg_ok;
     } else {
         header('Content-Type: text/xml');
         return str_replace('#MESSAGE#', _t('BLOG_TRACKBACK_DISABLED'), $tb_msg_error);
     }
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:48,代码来源:Trackbacks.php


示例10: VCardImportFile

 /**
  * Import data with VCard format from file
  *
  * @access  public
  * @return  string HTML content with menu and menu items
  */
 function VCardImportFile()
 {
     if (!$GLOBALS['app']->Session->Logged()) {
         return Jaws_HTTPError::Get(403);
     }
     require_once JAWS_PATH . 'gadgets/Addressbook/vCard.php';
     if (empty($_FILES) || !is_array($_FILES)) {
         $GLOBALS['app']->Session->PushResponse(_t('ADDRESSBOOK_RESULT_ERROR_IMPORT_PLEASE_SELECT_FILE'), 'AddressBook.Import', RESPONSE_ERROR);
         Jaws_Header::Location($this->gadget->urlMap('VCardImport'));
     }
     try {
         $vCard = new vCard($_FILES['vcard_file']['tmp_name'], false, array('Collapse' => false));
         $model = $this->gadget->model->load('AddressBook');
         if (count($vCard) == 0) {
             $GLOBALS['app']->Session->PushResponse(_t('ADDRESSBOOK_RESULT_ERROR_VCARD_DATA_NOT_FOUND'), 'AddressBook.Import', RESPONSE_ERROR);
             Jaws_Header::Location($this->gadget->urlMap('VCardImport'));
         } elseif (count($vCard) == 1) {
             $result = $this->PrepareForImport($vCard);
             if ($result) {
                 $adrID = $model->InsertAddress($result);
             }
         } else {
             foreach ($vCard as $Index => $vCardPart) {
                 $result = $this->PrepareForImport($vCardPart);
                 if ($result) {
                     $adrID = $model->InsertAddress($result);
                 }
             }
         }
     } catch (Exception $e) {
         $GLOBALS['app']->Session->PushResponse($e->getMessage(), 'AddressBook.Import', RESPONSE_ERROR);
         // TODO: Translate Messages
         Jaws_Header::Location($this->gadget->urlMap('VCardImport'));
     }
     $GLOBALS['app']->Session->PushResponse(_t('ADDRESSBOOK_RESULT_IMPORT_COMPLETED'), 'AddressBook');
     Jaws_Header::Location($this->gadget->urlMap('AddressBook'));
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:43,代码来源:VCardImport.php


示例11: SendMessage

 /**
  * Send a message
  *
  * @access  public
  * @return  void
  */
 function SendMessage()
 {
     if (!$GLOBALS['app']->Session->Logged()) {
         return Jaws_HTTPError::Get(401);
     }
     $this->gadget->CheckPermission('SendMessage');
     $post = jaws()->request->fetch(array('id', 'recipient_users', 'recipient_groups', 'folder', 'subject', 'body', 'attachments:array', 'is_draft:bool'), 'post');
     $post['body'] = jaws()->request->strip_crlf($post['body']);
     $user = $GLOBALS['app']->Session->GetAttribute('user');
     $model = $this->gadget->model->load('Message');
     if (empty($post['folder'])) {
         $post['folder'] = $post['is_draft'] ? PrivateMessage_Info::PRIVATEMESSAGE_FOLDER_DRAFT : PrivateMessage_Info::PRIVATEMESSAGE_FOLDER_INBOX;
     }
     $message_id = $model->SendMessage($user, $post);
     $url = $this->gadget->urlMap('Messages', array('folder' => PrivateMessage_Info::PRIVATEMESSAGE_FOLDER_INBOX));
     if (Jaws_Error::IsError($message_id)) {
         $GLOBALS['app']->Session->PushResponse($message_id->getMessage(), 'PrivateMessage.Compose', RESPONSE_ERROR);
     } else {
         if ($post['is_draft']) {
             $GLOBALS['app']->Session->PushResponse(_t('PRIVATEMESSAGE_DRAFT_SAVED'), 'PrivateMessage.Compose', RESPONSE_NOTICE, array('is_draft' => true, 'message_id' => $message_id));
         } else {
             $GLOBALS['app']->Session->PushResponse(_t('PRIVATEMESSAGE_MESSAGE_SEND'), 'PrivateMessage.Compose', RESPONSE_NOTICE, array('url' => $url));
         }
     }
     Jaws_Header::Location($url, 'PrivateMessage.Compose');
 }
开发者ID:juniortux,项目名称:jaws,代码行数:32,代码来源:Compose.php


示例12: DeleteCategory

 /**
  * Deletes the given blog category
  *
  * @access  public
  */
 function DeleteCategory()
 {
     $this->gadget->CheckPermission('ManageCategories');
     $model = $this->gadget->model->loadAdmin('Categories');
     $model->DeleteCategory(jaws()->request->fetch('catid', 'post'));
     Jaws_Header::Location(BASE_SCRIPT . '?gadget=Blog&action=ManageCategories');
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:12,代码来源:Categories.php


示例13: UpdateContacts

 /**
  * Updates user contacts information
  *
  * @access  public
  * @return  void
  */
 function UpdateContacts()
 {
     if (!$GLOBALS['app']->Session->Logged()) {
         Jaws_Header::Location($this->gadget->urlMap('LoginBox', array('referrer' => bin2hex(Jaws_Utils::getRequestURL(true)))));
     }
     $this->gadget->CheckPermission('EditUserContacts');
     $post = jaws()->request->fetch(array('country', 'city', 'address', 'postal_code', 'phone_number', 'mobile_number', 'fax_number'), 'post');
     $uModel = $this->gadget->model->load('Contacts');
     $result = $uModel->UpdateContacts($GLOBALS['app']->Session->GetAttribute('user'), $post['country'], $post['city'], $post['address'], $post['postal_code'], $post['phone_number'], $post['mobile_number'], $post['fax_number']);
     if (Jaws_Error::IsError($result)) {
         $GLOBALS['app']->Session->PushResponse($result->GetMessage(), 'Users.Contacts', RESPONSE_ERROR, $post);
     } else {
         $GLOBALS['app']->Session->PushResponse(_t('USERS_USERS_CONTACTINFO_UPDATED'), 'Users.Contacts');
     }
     Jaws_Header::Location($this->gadget->urlMap('Contacts'), 'Users.Contacts');
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:22,代码来源:Contacts.php


示例14: Click

 /**
  * Redirects request to banner's target
  *
  * @access  public
  * @return  mixed    Void if Success, 404  XHTML template content on Failure
  */
 function Click()
 {
     $model = $this->gadget->model->load('Banners');
     $id = (int) jaws()->request->fetch('id', 'get');
     $banner = $model->GetBanners($id);
     if (!Jaws_Error::IsError($banner) && !empty($banner)) {
         $click = $model->ClickBanner($banner[0]['id']);
         if (!Jaws_Error::IsError($click)) {
             $link = $banner[0]['url'];
             Jaws_Header::Location($link);
         }
     } else {
         return Jaws_HTTPError::Get(404);
     }
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:21,代码来源:Banners.php


示例15: AddEmblem

 /**
  * Adds a new emblem
  *
  * @access  public
  * @see     EmblemsModel->AddEmblem()
  */
 function AddEmblem()
 {
     $post = jaws()->request->fetch(array('title', 'url', 'type', 'published'), 'post');
     $post['url'] = Jaws_XSS::defilter($post['url']);
     $res = Jaws_Utils::UploadFiles($_FILES, JAWS_DATA . 'emblems/', 'jpg,gif,swf,png,jpeg,bmp,svg');
     if (Jaws_Error::IsError($res)) {
         $GLOBALS['app']->Session->PushLastResponse($res->getMessage(), RESPONSE_ERROR);
     } elseif (empty($res)) {
         $GLOBALS['app']->Session->PushLastResponse(_t('EMBLEMS_ERROR_NO_IMAGE_UPLOADED'), RESPONSE_ERROR);
     } else {
         $post['image'] = $res['image'][0]['host_filename'];
         $post['published'] = (bool) $post['published'];
         $model = $this->gadget->model->loadAdmin('Emblems');
         $res = $model->AddEmblem($post);
         if (Jaws_Error::IsError($res)) {
             Jaws_Utils::delete(JAWS_DATA . 'emblems/' . $post['image']);
             $GLOBALS['app']->Session->PushLastResponse(_t('EMBLEMS_ERROR_NOT_ADDED'), RESPONSE_ERROR);
         } else {
             $GLOBALS['app']->Session->PushLastResponse(_t('EMBLEMS_ADDED'), RESPONSE_NOTICE);
         }
     }
     Jaws_Header::Location(BASE_SCRIPT . '?gadget=Emblems');
 }
开发者ID:juniortux,项目名称:jaws,代码行数:29,代码来源:Emblems.php


示例16: UpdateNote

 /**
  * Updates note
  *
  * @access  public
  * @return  array   Response array
  */
 function UpdateNote()
 {
     $data = jaws()->request->fetch(array('id', 'title', 'content'), 'post');
     if (empty($data['id']) || empty($data['title']) || empty($data['content'])) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_INCOMPLETE_DATA'), 'Notepad.Response', RESPONSE_ERROR, $data);
         Jaws_Header::Referrer();
     }
     // Validate note
     $model = $this->gadget->model->load('Notepad');
     $id = (int) $data['id'];
     $user = (int) $GLOBALS['app']->Session->GetAttribute('user');
     $note = $model->GetNote($id, $user);
     if (Jaws_Error::IsError($note)) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_RETRIEVING_DATA'), 'Notepad.Response', RESPONSE_ERROR);
         Jaws_Header::Referrer();
     }
     // Verify owner
     if ($note['user'] != $user) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_NO_PERMISSION'), 'Notepad.Response', RESPONSE_ERROR);
         Jaws_Header::Referrer();
     }
     $data['title'] = Jaws_XSS::defilter($data['title']);
     $data['content'] = Jaws_XSS::defilter($data['content']);
     $result = $model->Update($id, $data);
     if (Jaws_Error::IsError($result)) {
         $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_ERROR_NOTE_UPDATE'), 'Notepad.Response', RESPONSE_ERROR, $data);
         Jaws_Header::Referrer();
     }
     $GLOBALS['app']->Session->PushResponse(_t('NOTEPAD_NOTICE_NOTE_UPDATED'), 'Notepad.Response');
     Jaws_Header::Location($this->gadget->urlMap('Notepad'));
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:37,代码来源:Update.php


示例17: Search

 /**
  * Searches through notes including shared noes from other users
  *
  * @access  public
  * @return  array   Response array
  */
 function Search()
 {
     $post = jaws()->request->fetch(array('filter', 'query', 'page'), 'post');
     foreach ($post as $k => $v) {
         if ($v === null) {
             unset($post[$k]);
         }
     }
     $url = $this->gadget->urlMap('Notepad', $post);
     Jaws_Header::Location($url);
     /*if (strlen($search['query']) < 2) {
           $GLOBALS['app']->Session->PushResponse(
               _t('NOTEPAD_ERROR_SHORT_QUERY'),
               'Notepad.Response',
               RESPONSE_ERROR
           );
       }*/
 }
开发者ID:juniortux,项目名称:jaws,代码行数:24,代码来源:Notepad.php


示例18: SaveEditPage

 /**
  * Updates the page
  *
  * @access  public
  * @return  void
  */
 function SaveEditPage()
 {
     $this->gadget->CheckPermission('EditPage');
     $model = $this->gadget->model->loadAdmin('Page');
     $fetch = array('page', 'title', 'group_id', 'language', 'fast_url', 'meta_keys', 'meta_desc', 'tags', 'published', 'show_title');
     $post = jaws()->request->fetch($fetch, 'post');
     $post['content'] = jaws()->request->fetch('content', 'post', 'strip_crlf');
     $id = (int) $post['page'];
     $model->UpdatePage($id, $post['group_id'], $post['show_title'], $post['title'], $post['content'], $post['language'], $post['fast_url'], $post['meta_keys'], $post['meta_desc'], $post['tags'], $post['published']);
     Jaws_Header::Location(BASE_SCRIPT . '?gadget=StaticPage&action=EditPage&id=' . $id);
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:17,代码来源:Page.php


示例19: Vote

 /**
  * Adds a new vote to an answer of a certain poll
  *
  * @access  public
  */
 function Vote()
 {
     $post = jaws()->request->fetch(array('pid', 'answers:array'), 'post');
     $model = $this->gadget->model->load('Poll');
     $poll = $model->GetPoll((int) $post['pid']);
     if (!Jaws_Error::IsError($poll) && !empty($poll)) {
         if (($poll['poll_type'] == 1 || !$GLOBALS['app']->Session->GetCookie('poll_' . $poll['id'])) && is_array($post['answers']) && count($post['answers']) > 0) {
             $GLOBALS['app']->Session->SetCookie('poll_' . $poll['id'], 'voted', (int) $this->gadget->registry->fetch('cookie_period') * 24 * 60);
             foreach ($post['answers'] as $aid) {
                 $model->AddAnswerVote($poll['id'], (int) $aid);
             }
         }
     }
     $GLOBALS['app']->Session->PushSimpleResponse(_t('POLL_THANKS'), 'Poll');
     Jaws_Header::Referrer();
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:21,代码来源:Poll.php


示例20: UploadTheme

 /**
  * Uploads a new theme
  *
  * @access  public
  * @return  void
  */
 function UploadTheme()
 {
     $this->gadget->CheckPermission('UploadTheme');
     $res = Jaws_Utils::ExtractFiles($_FILES, JAWS_DATA . 'themes' . DIRECTORY_SEPARATOR, false);
     if (!Jaws_Error::IsError($res)) {
         $GLOBALS['app']->Session->PushLastResponse(_t('TMS_THEME_UPLOADED'), RESPONSE_NOTICE);
     } else {
         $GLOBALS['app']->Session->PushLastResponse($res->getMessage(), RESPONSE_ERROR);
     }
     Jaws_Header::Location(BASE_SCRIPT . '?gadget=Tms&action=Themes');
 }
开发者ID:juniortux,项目名称:jaws,代码行数:17,代码来源:Themes.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Jaws_ORM类代码示例发布时间:2022-05-23
下一篇:
PHP Jaws_Gadget类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap