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


PHP PHPWS_Text::secureLink方法代码示例

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


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

示例1: miniadmin

 public static function miniadmin()
 {
     if (!Current_User::allow('menu')) {
         return;
     }
     // Default link. Takes user to menu admin screen
     MiniAdmin::add('menu', \PHPWS_Text::secureLink('<span class="fa fa-cog"></span> Administrate menus', 'menu', array('command' => 'list')));
     $key = \Key::getCurrent();
     $link_list = self::getLinkList();
     if ($key && !$key->isDummy(true)) {
         javascript('jquery');
         \Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/menu/javascript/administrate/minilink.js"></script>');
         $found = false;
         $used_menus = array();
         foreach ($link_list as $link) {
             $menu_id = 0;
             extract($link);
             if ($key_id == $key->id) {
                 if (!in_array($menu_id, $used_menus)) {
                     $used_menus[] = $menu_id;
                     MiniAdmin::add('menu', '<a href="javascript:void(0)" data-key-id="' . $key->id . '" data-menu-id="' . $menu_id . '" id="menu-remove-page"><span class="fa fa-times"></span> ' . t('Remove from %s', $menu_title) . '</a>');
                     $found = true;
                 }
             }
         }
         if (!$found) {
             self::miniadminAddMenu($key);
         }
         self::miniadminPinMenu($key);
         self::miniadminUnpin($key);
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:32,代码来源:Menu.php

示例2: show

 public function show()
 {
     $tpl = array();
     $tpl['LOGOUT_LINK'] = PHPWS_Text::secureLink(_('Log Out'), 'users', array('action' => 'user', 'command' => 'logout'));
     Layout::addPageTitle("Contact");
     return PHPWS_Template::process($tpl, 'hms', 'student/contact_form_thankyou.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:7,代码来源:ContactFormThankYouView.php

示例3: propertiesList

 protected function propertiesList($contact_id = null)
 {
     \PHPWS_Core::initModClass('properties', 'Property.php');
     $this->title = 'Property listing';
     $pager = new \DBPager('properties', 'Properties\\Property');
     if ($contact_id) {
         $pager->addWhere('contact_id', $contact_id);
         $data['is_contact'] = 1;
         $page_tags['new'] = \PHPWS_Text::moduleLink('<i class="fa fa-plus"></i> Add new property', 'properties', array('cop' => 'edit_property', 'k' => $this->contact->getKey()), null, null, 'btn btn-success');
     } else {
         $page_tags['new'] = \PHPWS_Text::secureLink('<i class="fa fa-plus"></i> Add new property', 'properties', array('aop' => 'edit_property'), null, null, 'btn btn-success');
     }
     // photo was previously uploaded
     if (!empty($_GET['pid'])) {
         $data['pid'] = $_GET['pid'];
     } else {
         $data['pid'] = 0;
     }
     javascriptMod('properties', 'photo_upload', $data);
     $pager->setSearch('name', 'company_name');
     $pager->addSortHeader('name', 'Name of property');
     $pager->addSortHeader('company_name', 'Management company');
     $pager->addSortHeader('timeout', 'Time until purge');
     $pager->setModule('properties');
     $pager->setTemplate('properties_list.tpl');
     $pager->addRowTags('row_tags', (bool) $contact_id);
     $pager->joinResult('contact_id', 'prop_contacts', 'id', 'company_name', null, true);
     $pager->addPageTags($page_tags);
     $pager->cacheQueries();
     $this->content = $pager->get();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:31,代码来源:Base.php

示例4: show_verify_assignment

 public function show_verify_assignment()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Term.php');
     PHPWS_Core::initModClass('hms', 'HMS_SOAP.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php');
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Movein_Time.php');
     $tpl = array();
     $assignment = HMS_Assignment::get_assignment($_SESSION['asu_username'], $_SESSION['application_term']);
     if ($assignment === NULL || $assignment == FALSE) {
         $tpl['NO_ASSIGNMENT'] = "You do not currently have a housing assignment.";
     } else {
         $tpl['ASSIGNMENT'] = $assignment->where_am_i() . '<br />';
         # Determine the student's type and figure out their movein time
         $type = HMS_SOAP::get_student_type($_SESSION['asu_username'], $_SESSION['application_term']);
         if ($type == TYPE_CONTINUING) {
             $movein_time_id = $assignment->get_rt_movein_time_id();
         } elseif ($type == TYPE_TRANFER) {
             $movein_time_id = $assignment->get_t_movein_time_id();
         } else {
             $movein_time_id = $assignment->get_f_movein_time_id();
         }
         if ($movein_time_id == NULL) {
             $tpl['MOVE_IN_TIME'] = 'To be determined<br />';
         } else {
             $movein_times = HMS_Movein_Time::get_movein_times_array($_SESSION['application_term']);
             $tpl['MOVE_IN_TIME'] = $movein_times[$movein_time_id];
         }
     }
     //get the assignees to the room that the bed that the assignment is in
     $assignees = !is_null($assignment) ? $assignment->get_parent()->get_parent()->get_assignees() : NULL;
     $roommates = array();
     if (!is_null($assignees)) {
         foreach ($assignees as $roommate) {
             if ($roommate->asu_username != $_SESSION['asu_username']) {
                 $roommates[] = $roommate->asu_username;
             }
         }
     }
     if (empty($roommates)) {
         $tpl['roommate'][]['ROOMMATE'] = 'You do not have a roommate.';
     } else {
         foreach ($roommates as $roommate) {
             $tpl['roommate'][]['ROOMMATE'] = '' . HMS_SOAP::get_name($roommate) . ' (<a href="mailto:' . $roommate . '@appstate.edu">' . $roommate . '@appstate.edu</a>)';
         }
     }
     $rlc_assignment = HMS_RLC_Assignment::check_for_assignment($_SESSION['asu_username'], $_SESSION['application_term']);
     if ($rlc_assignment == NULL || $rlc_assignment === FALSE) {
         $tpl['RLC'] = "You have not been accepted to an RLC.";
     } else {
         $rlc_list = HMS_Learning_Community::getRlcList();
         $tpl['RLC'] = 'You have been assigned to the ' . $rlc_list[$rlc_assignment['rlc_id']];
     }
     $tpl['MENU_LINK'] = PHPWS_Text::secureLink('Back to Main Menu', 'hms', array('type' => 'student', 'op' => 'show_main_menu'));
     return PHPWS_Template::process($tpl, 'hms', 'student/verify_assignment.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:57,代码来源:Student_UI.php

示例5: show

 public function show()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php');
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Movein_Time.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     $tpl = array();
     $assignment = HMS_Assignment::getAssignment($this->student->getUsername(), $this->term);
     if ($assignment === NULL || $assignment == FALSE) {
         $tpl['NO_ASSIGNMENT'] = "You do not currently have a housing assignment.";
     } else {
         $tpl['ASSIGNMENT'] = $assignment->where_am_i() . '<br />';
         # Determine the student's type and figure out their movein time
         $type = $this->student->getType();
         if ($type == TYPE_CONTINUING) {
             $movein_time_id = $assignment->get_rt_movein_time_id();
         } elseif ($type == TYPE_TRANSFER) {
             $movein_time_id = $assignment->get_t_movein_time_id();
         } else {
             $movein_time_id = $assignment->get_f_movein_time_id();
         }
         if ($movein_time_id == NULL) {
             $tpl['MOVE_IN_TIME'] = 'To be determined<br />';
         } else {
             $movein_times = HMS_Movein_Time::get_movein_times_array($this->term);
             $tpl['MOVE_IN_TIME'] = $movein_times[$movein_time_id];
         }
     }
     //get the assignees to the room that the bed that the assignment is in
     $assignees = !is_null($assignment) ? $assignment->get_parent()->get_parent()->get_assignees() : NULL;
     if (!is_null($assignees)) {
         foreach ($assignees as $roommate) {
             if ($roommate->getUsername() != $this->student->getUsername()) {
                 $assignment = HMS_Assignment::getAssignment($roommate->getUsername(), $this->term);
                 $assignment->loadBed();
                 $label = $assignment->_bed->bedroom_label;
                 $tpl['roommate'][]['ROOMMATE'] = $roommate->getFullName() . ' - ' . $label . ' (' . $roommate->getEmailLink() . ')';
             }
         }
     } else {
         $tpl['roommate'] = 'You do not have a roommate';
     }
     $rlc_assignment = HMS_RLC_Assignment::checkForAssignment($this->student->getUsername(), $this->term);
     if ($rlc_assignment == NULL || $rlc_assignment === FALSE) {
         $tpl['RLC'] = "You have not been accepted to an RLC.";
     } else {
         $rlc_list = HMS_Learning_Community::getRlcList();
         $tpl['RLC'] = 'You have been assigned to the ' . $rlc_list[$rlc_assignment['rlc_id']];
     }
     $tpl['MENU_LINK'] = PHPWS_Text::secureLink('Back to Main Menu', 'hms', array('type' => 'student', 'op' => 'show_main_menu'));
     Layout::addPageTitle("Verify Assignment");
     return PHPWS_Template::process($tpl, 'hms', 'student/verify_assignment.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:54,代码来源:VerifyAssignmentView.php

示例6: getPagerTags

 public function getPagerTags()
 {
     $template['NAME'] = $this->name;
     $template['TYPE'] = $this->type;
     $template['ACTIVE'] = $this->active ? 'Active' : 'Inactive';
     $template['ACTION'] = 'Herp';
     $actions = array();
     $actions[] = PHPWS_Text::secureLink('Edit', 'analytics', array('command' => 'edit', 'tracker_id' => $this->id));
     $actions[] = PHPWS_Text::secureLink('Delete', 'analytics', array('command' => 'delete', 'tracker_id' => $this->id));
     $template['ACTION'] = implode(' | ', $actions);
     return $template;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:GenericTracker.php

示例7: rowTags

 public function rowTags()
 {
     $vars['reason_id'] = $this->id;
     $vars['aop'] = 'edit_reason';
     $links[] = PHPWS_Text::secureLink(Icon::show('edit'), 'checkin', $vars);
     $vars['aop'] = 'delete_reason';
     $js['question'] = dgettext('confirm', 'Are you sure you want to delete this reason?.');
     $js['address'] = PHPWS_Text::linkAddress('checkin', $vars, true);
     $js['link'] = Icon::show('delete');
     $links[] = javascript('confirm', $js);
     $tpl['ACTION'] = implode('', $links);
     return $tpl;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:Reasons.php

示例8: show

 public function show()
 {
     $tpl = array();
     $tpl['VIEW_APPLICATION'] = PHPWS_Text::secureLink(_('View My Application'), 'hms', array('type' => 'student', 'op' => 'view_application'));
     $tpl['MAIN_MENU_LINK'] = PHPWS_Text::secureLink(_('Back to Main Menu'), 'hms', array('type' => 'student', 'op' => 'main'));
     $tpl['LOGOUT_LINK'] = PHPWS_Text::moduleLink(_('Logout'), 'users', array('action' => 'user', 'command' => 'logout'));
     // TODO HMS_Entry_Term is deprecated, use something else
     PHPWS_Core::initModClass('hms', 'HMS_Entry_Term.php');
     if (HMS_Entry_Term::get_entry_semester($_SESSION['asu_username']) == TERM_FALL) {
         $tpl['RLC_LINK'] = PHPWS_Text::secureLink(_('Residential Learning Communities Application'), 'hms', array('type' => 'student', 'op' => 'show_rlc_application_form'));
     }
     Layout::addPageTitle("Thank you");
     return PHPWS_Template::process($tpl, 'hms', 'student/student_application_thankyou.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:14,代码来源:HousingApplicationThanksView.php

示例9: pagerTags

 public function pagerTags()
 {
     $vars['command'] = 'reset_feed';
     $vars['feed_id'] = $this->id;
     $links[] = PHPWS_Text::secureLink('<i class="fa fa-refresh" title="' . dgettext('rss', 'Reset') . '"></i>', 'rss', $vars);
     $links[] = '<i data-id="' . $this->id . '" class="edit-feed pointer fa fa-edit" title="' . dgettext('rss', 'Edit the feed') . '"></i>';
     $js['QUESTION'] = dgettext('rss', 'Are you sure you want to delete this RSS feed?');
     $js['ADDRESS'] = sprintf('index.php?module=rss&command=delete_feed&feed_id=%s&authkey=%s', $this->id, Current_User::getAuthKey());
     $js['LINK'] = '<i class="fa fa-trash-o" title="' . dgettext('rss', 'Delete feed') . '"></i>';
     $links[] = javascript('confirm', $js);
     $tpl['ACTION'] = implode(' ', $links);
     if ($this->display) {
         $vars['command'] = 'turn_off_display';
         $tpl['DISPLAY'] = PHPWS_Text::secureLink(dgettext('rss', 'Yes'), 'rss', $vars);
     } else {
         $vars['command'] = 'turn_on_display';
         $tpl['DISPLAY'] = PHPWS_Text::secureLink(dgettext('rss', 'No'), 'rss', $vars);
     }
     $hours = floor($this->refresh_time / 3600);
     $remaining = $this->refresh_time - $hours * 3600;
     $minutes = floor($remaining / 60);
     $seconds = $remaining - $minutes * 60;
     $time = NULL;
     if ($seconds) {
         $time = sprintf(dgettext('rss', '%d seconds'), $seconds);
     }
     if ($minutes) {
         if (isset($time)) {
             $time = sprintf(dgettext('rss', '%d minutes, '), $minutes) . $time;
         } else {
             $time = sprintf(dgettext('rss', '%d minutes'), $minutes) . $time;
         }
     }
     if ($hours) {
         if (isset($time)) {
             $time = sprintf(dgettext('rss', '%d hours, '), $hours) . $time;
         } else {
             $time = sprintf(dgettext('rss', '%d hours'), $hours) . $time;
         }
     }
     $refresh_time = sprintf(dgettext('rss', 'Every %s'), $time);
     $shortened_array = parse_url($this->address);
     $shortened = $shortened_array['scheme'] . '://' . $shortened_array['host'];
     $tpl['ADDRESS'] = sprintf('<a href="%s" title="%s">%s</a>', $this->address, $this->address, $shortened);
     $tpl['REFRESH_TIME'] = $refresh_time;
     return $tpl;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:47,代码来源:Feed.php

示例10: display

 /**
  * Main display method
  */
 public function display()
 {
     javascript('jquery');
     // housekeeping
     if (isset($_SESSION['query'])) {
         unset($_SESSION['query']);
     }
     $tags = array();
     // Total number of internships for Diety users
     if (\Current_User::isDeity()) {
         $tags['GRAND_TOTAL_LABEL'] = _('Total Internships in Database: ');
         $db = new \PHPWS_DB('intern_internship');
         $gt = $db->select('count');
         $tags['GRAND_TOTAL'] = $gt;
     }
     // Example form link
     $tags['EXAMPLE_LINK'] = \PHPWS_Text::secureLink('Example form', 'intern', array('action' => 'example_form'));
     return \PHPWS_Template::process($tags, 'intern', 'menu.tpl');
 }
开发者ID:jlbooker,项目名称:InternshipInventory,代码行数:22,代码来源:InternMenu.php

示例11: editSettings

 function editSettings()
 {
     $form = new PHPWS_Form('whatsnew_settings');
     $form->addHidden('module', 'whatsnew');
     $form->addHidden('aop', 'post_settings');
     $form->addCheckbox('enable', 1);
     $form->setMatch('enable', PHPWS_Settings::get('whatsnew', 'enable'));
     $form->setLabel('enable', dgettext('whatsnew', 'Enable whatsnew'));
     $form->addCheckbox('homeonly', 1);
     $form->setMatch('homeonly', PHPWS_Settings::get('whatsnew', 'homeonly'));
     $form->setLabel('homeonly', dgettext('whatsnew', 'Show whatsnew sidebox on home page only'));
     $form->addTextField('title', PHPWS_Settings::get('whatsnew', 'title'));
     $form->setLabel('title', dgettext('whatsnew', 'Sidebox title'));
     $form->setSize('title', 30);
     $form->addTextArea('text', PHPWS_Settings::get('whatsnew', 'text'));
     $form->setRows('text', '4');
     $form->setCols('text', '40');
     $form->setLabel('text', dgettext('whatsnew', 'Sidebox text'));
     $form->addTextField('cache_timeout', PHPWS_Settings::get('whatsnew', 'cache_timeout'));
     $form->setLabel('cache_timeout', dgettext('whatsnew', 'Cache duration for whatsnew list (in seconds, 0-7200)'));
     $form->setSize('cache_timeout', 4, 4);
     $form->addTextField('qty_items', PHPWS_Settings::get('whatsnew', 'qty_items'));
     $form->setLabel('qty_items', dgettext('whatsnew', 'Number of recent items to display (0-50)'));
     $form->setSize('qty_items', 4, 4);
     $form->addCheckbox('show_summaries', 1);
     $form->setMatch('show_summaries', PHPWS_Settings::get('whatsnew', 'show_summaries'));
     $form->setLabel('show_summaries', dgettext('whatsnew', 'Show item summaries'));
     $form->addCheckbox('show_dates', 1);
     $form->setMatch('show_dates', PHPWS_Settings::get('whatsnew', 'show_dates'));
     $form->setLabel('show_dates', dgettext('whatsnew', 'Show item update dates'));
     $form->addCheckbox('show_source_modules', 1);
     $form->setMatch('show_source_modules', PHPWS_Settings::get('whatsnew', 'show_source_modules'));
     $form->setLabel('show_source_modules', dgettext('whatsnew', 'Show item source module names'));
     $form->addSubmit('save', dgettext('whatsnew', 'Save settings'));
     $tpl = $form->getTemplate();
     $tpl['SETTINGS_LABEL'] = dgettext('whatsnew', 'General Settings');
     $tpl['FLUSH_LINK'] = PHPWS_Text::secureLink(dgettext('whatsnew', 'Flush cache'), 'whatsnew', array('aop' => 'flush_cache'));
     $tpl['EXCLUDE'] = $this->whatsnew->getKeyMods(unserialize(PHPWS_Settings::get('whatsnew', 'exclude')), 'exclude');
     $tpl['EXCLUDE_LABEL'] = dgettext('whatsnew', 'Select any modules you wish to exclude from your whatsnew box.');
     $this->whatsnew->title = dgettext('whatsnew', 'Settings');
     $this->whatsnew->content = PHPWS_Template::process($tpl, 'whatsnew', 'edit_settings.tpl');
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:42,代码来源:Whatsnew_Forms.php

示例12: plug

 public static function plug()
 {
     $tpl = array();
     $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Menu', 'intern');
     $tpl['ADD_LINK'] = PHPWS_Text::moduleLink('Add Student', 'intern', array('action' => 'edit_internship'));
     $tpl['SEARCH_LINK'] = PHPWS_Text::moduleLink('Search', 'intern', array('action' => 'search'));
     $auth = Current_User::getAuthorization();
     $tpl['USER_FULL_NAME'] = Current_User::getDisplayName();
     $tpl['LOGOUT_URI'] = $auth->logout_link;
     $adminOptions = array();
     // Edit list of majors
     if (Current_User::allow('intern', 'edit_major')) {
         $adminOptions['EDIT_MAJORS_LINK'] = PHPWS_Text::secureLink('Edit Undergraduate Majors', 'intern', array('action' => MAJOR_EDIT));
     }
     // Edit list grad programs
     if (Current_User::allow('intern', 'edit_grad_prog')) {
         $adminOptions['EDIT_GRAD_LINK'] = PHPWS_Text::secureLink('Edit Graduate Programs', 'intern', array('action' => GRAD_PROG_EDIT));
     }
     // Edit departments
     if (Current_User::allow('intern', 'edit_dept')) {
         $adminOptions['EDIT_DEPARTMENTS_LINK'] = PHPWS_Text::secureLink('Edit Departments', 'intern', array('action' => DEPT_EDIT));
     }
     // Edit list of states
     if (Current_User::allow('intern', 'edit_states')) {
         $adminOptions['EDIT_STATES_LINK'] = PHPWS_Text::secureLink('Edit States', 'intern', array('action' => STATE_EDIT));
     }
     if (Current_User::isDeity()) {
         $adminOptions['CONTROL_PANEL'] = PHPWS_Text::secureLink('Control Panel', 'controlpanel');
         $adminOptions['EDIT_ADMINS_LINK'] = PHPWS_Text::secureLink('Edit Administrators', 'intern', array('action' => 'edit_admins'));
     }
     // If any admin options were added, them show the dropdown and merge those
     // links into the main set of template tags
     if (sizeof($adminOptions) > 0) {
         $tpl['ADMIN_OPTIONS'] = '';
         // dummy var to show dropdown menu in template
         $tpl = array_merge($tpl, $adminOptions);
     }
     Layout::plug(PHPWS_Template::process($tpl, 'intern', 'top.tpl'), 'NAV_LINKS');
 }
开发者ID:jeffrafter,项目名称:InternshipInventory,代码行数:39,代码来源:TopUI.php

示例13: viewReported

 private function viewReported()
 {
     javascriptMod('properties', 'report');
     javascript('confirm');
     \PHPWS_Core::initModClass('properties', 'Report.php');
     $this->title = 'Reported messages';
     $pager = new \DBPager('prop_report', 'Properties\\Report');
     if (!isset($_SESSION['prop_show_blocked'])) {
         $vars['aop'] = 'show_blocked';
         $tags['BLOCKED'] = \PHPWS_Text::secureLink('Show blocked', 'properties', $vars, null, null, 'btn btn-default');
         $pager->db->addWhere('prop_report.block', 0);
     } else {
         $vars['aop'] = 'hide_blocked';
         $tags['BLOCKED'] = \PHPWS_Text::secureLink('Hide blocked', 'properties', $vars, null, null, 'btn btn-default');
     }
     $pager->addPageTags($tags);
     $pager->addSortHeader('date_sent', 'Date reported');
     $pager->joinResult('message_id', 'prop_messages', 'id', 'body', 'message');
     $pager->db->addJoin('left', 'prop_report', 'prop_messages', 'message_id', 'id');
     $pager->setModule('properties');
     $pager->setTemplate('reported_list.tpl');
     $pager->addRowTags('row');
     $this->content = $pager->get();
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:24,代码来源:Admin.php

示例14: folderContentView

 /**
  * View of files in current folder
  */
 public function folderContentView()
 {
     javascript('jquery');
     PHPWS_Core::initModClass('filecabinet', 'Image.php');
     javascript('confirm');
     // needed for deletion
     Layout::addStyle('filecabinet');
     if (empty($this->current_folder) || empty($this->folder_type)) {
         javascript('alert', array('content' => dgettext('filecabinet', 'Problem with opening browser page. Closing File Manager window.')));
         javascript('close_refresh', array('timeout' => 3, 'refresh' => 0));
         return;
     }
     $tpl = array();
     $this->folderIcons($tpl);
     if (Current_User::allow('filecabinet', 'edit_folders')) {
         $tpl['FOLDER_TITLE'] = $this->current_folder->editLink('title', $this->current_folder->module_created);
     } else {
         $tpl['FOLDER_TITLE'] =& $this->current_folder->title;
     }
     $img_dir = PHPWS_SOURCE_HTTP . 'mod/filecabinet/img/file_manager/';
     $image_string = '<img src="%s" title="%s" alt="%s" />';
     $link_info = $this->linkInfo();
     switch ($this->folder_type) {
         case IMAGE_FOLDER:
             $js = $link_info;
             $js['authkey'] = Current_User::getAuthKey();
             $js['failure_message'] = dgettext('filecabinet', 'Unable to resize image.');
             $js['confirmation'] = sprintf(dgettext('filecabinet', 'This image is larger than the %s x %s limit. Do you want to resize the image to fit?'), $this->max_width, $this->max_height);
             javascriptMod('filecabinet', 'pick_file', $js);
             $db = new PHPWS_DB('images');
             $class_name = 'PHPWS_Image';
             $file_type = FC_IMAGE;
             $altvars = $link_info;
             // check
             unset($altvars['mw']);
             unset($altvars['mh']);
             unset($altvars['fr']);
             $img1 = 'folder_random.png';
             $img2 = 'thumbnails.png';
             $img3 = 'lightbox.png';
             $img1_alt = dgettext('filecabinet', 'Random image icon');
             $img2_alt = dgettext('filecabinet', 'Thumbnail icon');
             $img3_alt = dgettext('filecabinet', 'Lightbox icon');
             if (!$this->reserved_folder) {
                 if ($this->current_folder->public_folder) {
                     $altvars['id'] = $this->current_folder->id;
                     $altvars['fop'] = 'pick_file';
                     $altvars['file_type'] = FC_IMAGE_RANDOM;
                     $not_allowed = dgettext('filecabinet', 'Action not allowed');
                     if (!$this->lock_type || in_array(FC_IMAGE_RANDOM, $this->lock_type)) {
                         $img1_title = dgettext('filecabinet', 'Show a random image from this folder');
                         $image1 = sprintf($image_string, $img_dir . $img1, $img1_title, $img1_alt);
                         $tpl['ALT1'] = PHPWS_Text::secureLink($image1, 'filecabinet', $altvars);
                         if ($this->file_assoc->file_type == FC_IMAGE_RANDOM && $this->current_folder->id == $this->file_assoc->file_id) {
                             $tpl['ALT_HIGH1'] = ' alt-high';
                         }
                     } else {
                         $image1 = sprintf($image_string, $img_dir . $img1, $not_allowed, $img1_alt);
                         $tpl['ALT1'] = $image1;
                         $tpl['ALT_HIGH1'] = ' no-use';
                     }
                     if (!$this->lock_type || in_array(FC_IMAGE_FOLDER, $this->lock_type)) {
                         /** start new * */
                         if ($this->file_assoc->file_type == FC_IMAGE_FOLDER) {
                             $tpl['ALT_HIGH2'] = ' alt-high';
                         }
                         $img2_title = dgettext('filecabinet', 'Show block of thumbnails');
                         $image2 = sprintf($image_string, $img_dir . $img2, $img2_title, $img2_alt);
                         $form = new PHPWS_Form('carousel-options');
                         $form->setMethod('get');
                         $altvars['file_type'] = FC_IMAGE_FOLDER;
                         $form->addHidden($altvars);
                         $form->addHidden('module', 'filecabinet');
                         $form->addRadioAssoc('direction', array(0 => dgettext('filecabinet', 'Horizontal'), 1 => dgettext('filecabinet', 'Vertical')));
                         $match = $this->file_assoc->vertical;
                         $form->setMatch('direction', $match);
                         $num = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8);
                         $form->addSelect('num_visible', $num);
                         $form->setLabel('num_visible', dgettext('filecabinet', 'Number shown'));
                         $form->setMatch('num_visible', $this->file_assoc->num_visible);
                         $form->addSubmit('go', dgettext('filecabinet', 'Go'));
                         $subtpl = $form->getTemplate();
                         $subtpl['DIRECTION_DESC'] = dgettext('filecabinet', 'Carousel direction');
                         $subtpl['LINK'] = sprintf('<a href="#" onclick="return carousel_pick();">%s</a>', $image2);
                         $subtpl['CANCEL'] = dgettext('filecabinet', 'Cancel');
                         $tpl['ALT2'] = PHPWS_Template::process($subtpl, 'filecabinet', 'file_manager/carousel_pick.tpl');
                     } else {
                         $image2 = sprintf($image_string, $img_dir . $img2, $not_allowed, $img2_alt);
                         $tpl['ALT2'] = $image2;
                         $tpl['ALT_HIGH2'] = ' no-use';
                     }
                     if (!$this->lock_type || in_array(FC_IMAGE_LIGHTBOX, $this->lock_type)) {
                         /** start VV * */
                         if ($this->file_assoc->file_type == FC_IMAGE_LIGHTBOX) {
                             $tpl['ALT_HIGH3'] = ' alt-high';
                         }
                         $img3_title = dgettext('filecabinet', 'Show lightbox slideshow');
//.........这里部分代码省略.........
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:101,代码来源:File_Manager.php

示例15: addToMiniAdmin

 /**
  * Adds wiki links to the MiniAdmin box
  *
  * @author Greg Meiste <greg.meiste+github@gmail.com>
  */
 function addToMiniAdmin()
 {
     $admin = dgettext('wiki', 'Admin');
     $image = dgettext('wiki', 'Image upload');
     $linkshere = dgettext('wiki', 'What links here');
     $recentchanges = dgettext('wiki', 'Recent changes');
     $randompage = dgettext('wiki', 'Random page');
     $interwiki = dgettext('wiki', 'Interwiki setup');
     if (isset($_REQUEST['page']) && isset($_REQUEST['page_op']) && $_REQUEST['page_op'] == 'view' && PHPWS_Settings::get('wiki', 'what_links_here')) {
         $links[] = PHPWS_Text::moduleLink($linkshere, 'wiki', array('page' => $_REQUEST['page'], 'page_op' => 'whatlinkshere'));
     }
     if (PHPWS_Settings::get('wiki', 'recent_changes')) {
         $links[] = PHPWS_Text::moduleLink($recentchanges, 'wiki', array('op' => 'recentchanges'));
     }
     if (PHPWS_Settings::get('wiki', 'random_page')) {
         $links[] = PHPWS_Text::moduleLink($randompage, 'wiki', array('op' => 'random'));
     }
     if (PHPWS_Settings::get('wiki', 'allow_image_upload') && Current_User::isLogged() || Current_User::allow('wiki', 'upload_images')) {
         $links[] = PHPWS_Text::secureLink($image, 'wiki', array('op' => 'imageupload'));
     }
     if (Current_User::allow('wiki', 'edit_page') || PHPWS_Settings::get('wiki', 'allow_page_edit') && Current_User::isLogged()) {
         $links[] = PHPWS_Text::secureLink($interwiki, 'wiki', array('op' => 'interwikisetup'));
     }
     if (Current_User::allow('wiki', 'edit_settings')) {
         $links[] = PHPWS_Text::secureLink($admin, 'wiki', array('op' => 'admin'));
     }
     if (isset($links)) {
         /* Clear out any existing links that may be present before adding these */
         $GLOBALS['MiniAdmin']['wiki'] = NULL;
         MiniAdmin::add('wiki', $links);
     }
 }
开发者ID:Jopperi,项目名称:wiki,代码行数:37,代码来源:WikiManager.php


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