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(); }
public function getSubLink($text, $parentVars) { $regularLink = PHPWS_Text::moduleLink(dgettext('hms', $text), 'hms', $parentVars); $nakedDisplayCmd = CommandFactory::getCommand('SelectResidenceHall'); $nakedDisplayCmd->setTitle('Hall Overview'); $nakedDisplayCmd->setOnSelectCmd(CommandFactory::getCommand('HallOverviewNakedDisplay')); return $regularLink . ' [' . $nakedDisplayCmd->getLink('Printable') . ']'; }
public function getTitle($linkable = true) { if ($linkable) { $vars['mod_title'] = $this->module; return PHPWS_Text::moduleLink($this->title, 'rss', $vars); } else { return $this->title; } }
/** * @author Matthew McNaney * @version $Id$ */ function new_account($item) { if (!PHPWS_User::getUserSetting('new_user_method') > 0) { $msg = dgettext('users', 'New user signup is currently disabled.'); return $msg; } $signup_vars = array('action' => 'user', 'command' => 'signup_user'); if (!empty($item[1])) { $link = strip_tags($item[1]); } else { $link = USER_SIGNUP_QUESTION; } return PHPWS_Text::moduleLink($link, 'users', $signup_vars); }
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'); }
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'); }
/** * Diff * * Main function: Calls the diff and render, then outputs to layout * * @author Greg Meiste <*****@*****.**> */ function diff($oVer, $nVer) { PHPWS_Core::initModClass('wiki', 'OldWikiPage.php'); $olderpage = new OldWikiPage(); $newerpage = new OldWikiPage(); $db = new PHPWS_DB('wiki_pages_version'); $db->addWhere('title', $_REQUEST['page']); $db->addWhere('vr_number', $oVer); $db->loadObject($olderpage); $db->reset(); $db->addWhere('title', $_REQUEST['page']); $db->addWhere('vr_number', $nVer); $db->loadObject($newerpage); // Need to parse the text, but we can't call parseOutput or this module's // transform function. They both do too much parsing and can't be used // for a diff. So, we call what is needed directly: $oPagetext = htmlspecialchars(str_replace("'", "'", $olderpage->getPagetext(FALSE))); $nPagetext = htmlspecialchars(str_replace("'", "'", $newerpage->getPagetext(FALSE))); if (!ALLOW_PROFANITY) { $oPagetext = PHPWS_Text::profanityFilter($oPagetext); $nPagetext = PHPWS_Text::profanityFilter($nPagetext); } // End diff text parsing $oPagetext = explode("\n", $oPagetext); $nPageText = explode("\n", $nPagetext); $diff = new Text_Diff($oPagetext, $nPageText); $this->render($diff); $tags = array(); $tags['TITLE'] = dgettext('wiki', 'Difference between revisions'); $tags['BACK_PAGE'] = PHPWS_Text::moduleLink(dgettext('wiki', 'Back to Page'), 'wiki', array('page' => $_REQUEST['page'])); $tags['BACK_HISTORY'] = PHPWS_Text::moduleLink(dgettext('wiki', 'Back to History'), 'wiki', array('page_op' => 'history', 'page_id' => $newerpage->getSourceId())); $tags['DIFF'] = $this->_output; $tags['OLDER_VERSION'] = $olderpage->getVrNumber(); $tags['NEWER_VERSION'] = $newerpage->getVrNumber(); $tags['OLDER_UPDATED'] = $olderpage->getUpdated(); $tags['NEWER_UPDATED'] = $newerpage->getUpdated(); $tags['VERSION_LABEL'] = dgettext('wiki', 'Version'); return PHPWS_Template::process($tags, 'wiki', 'diff/' . $this->_format . '/diff.tpl'); }
public function upcomingEvents() { $db = new PHPWS_DB('calendar_schedule'); $db->addWhere('show_upcoming', 0, '>'); $db->addWhere('public', 1); Key::restrictView($db, 'calendar'); $result = $db->getObjects('Calendar_Schedule'); if (PHPWS_Error::logIfError($result) || !$result) { return null; } $startdate = time(); foreach ($result as $schedule) { $tpl = array(); switch ($schedule->show_upcoming) { case 1: // one week $days_ahead = 7; break; case 2: // two weeks $days_ahead = 14; break; case 3: // one month $days_ahead = 30; break; } $enddate = $startdate + 86400 * $days_ahead; $event_list = $schedule->getEvents($startdate, $enddate); if (!$event_list) { continue; } $tpl['TITLE'] = $schedule->getViewLink(); $current_day = null; $count = 0; if (empty($event_list)) { continue; } foreach ($event_list as $event) { $vars = array('view' => 'day', 'date' => $event->start_time, 'sch_id' => $schedule->id); $tpl['events'][$count] = $event->getTpl(); if ($current_day != strftime(CALENDAR_UPCOMING_FORMAT, $event->start_time)) { $current_day = strftime(CALENDAR_UPCOMING_FORMAT, $event->start_time); $tpl['events'][$count]['DAY'] = PHPWS_Text::moduleLink($current_day, 'calendar', $vars); } else { $tpl['events'][$count]['DAY'] = null; } $count++; } $upcoming[] = PHPWS_Template::process($tpl, 'calendar', 'view/upcoming.tpl'); } if (!empty($upcoming)) { $ftpl['TITLE'] = dgettext('calendar', 'Upcoming events'); $ftpl['CONTENT'] = implode("\n", $upcoming); return PHPWS_Template::process($ftpl, 'calendar', 'user_main.tpl'); } else { return null; } }
/** * Row tags for DBPager */ public function getRowTags() { PHPWS_Core::initModClass('intern', 'Term.php'); $tags = array(); // Get objects associated with this internship. $a = $this->getAgency(); $d = $this->getDepartment(); // Student info. $tags['STUDENT_NAME'] = PHPWS_Text::moduleLink($this->getFullName(), 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); $tags['STUDENT_BANNER'] = PHPWS_Text::moduleLink($this->getBannerId(), 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); // Dept. info $tags['DEPT_NAME'] = PHPWS_Text::moduleLink($d->name, 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); // Faculty info. if (isset($this->faculty_id)) { $f = $this->getFaculty(); $facultyName = $f->getFullName(); $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink($f->getFullName(), 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); } else { // Makes this cell in the table a clickable link, even if there's no faculty name $tags['FACULTY_NAME'] = PHPWS_Text::moduleLink(' ', 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); } $tags['TERM'] = PHPWS_Text::moduleLink(Term::rawToRead($this->term), 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); $tags['WORKFLOW_STATE'] = PHPWS_Text::moduleLink($this->getWorkflowState()->getFriendlyName(), 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); //$tags['EDIT'] = PHPWS_Text::moduleLink('Edit', 'intern', array('action' => 'edit_internship', 'internship_id' => $this->id)); //$tags['PDF'] = PHPWS_Text::moduleLink('Generate Contract', 'intern', array('action' => 'pdf', 'id' => $this->id)); return $tags; }
/** * Get the link to download this document. */ public function getDownloadLink() { \PHPWS_Core::initModClass('filecabinet', 'Document.php'); $doc = new \PHPWS_Document($this->document_fc_id); return \PHPWS_Text::moduleLink($doc->title, 'filecabinet', array('id' => $doc->id)); }
/** * Creates the edit form for an event */ public static function event_form(Calendar_Event $event, $suggest = false) { Layout::addStyle('calendar'); javascript('datetimepicker'); // the form id is linked to the check_date javascript $form = new PHPWS_Form('event_form'); if (isset($_REQUEST['js'])) { $form->addHidden('js', 1); } $form->addHidden('module', 'calendar'); if ($suggest) { $form->addHidden('uop', 'post_suggestion'); } else { $form->addHidden('aop', 'post_event'); } $form->addHidden('event_id', $event->id); $form->addHidden('sch_id', $event->_schedule->id); $form->addText('summary', $event->summary); $form->setLabel('summary', dgettext('calendar', 'Summary')); $form->setSize('summary', 60); $form->addText('location', $event->location); $form->setLabel('location', dgettext('calendar', 'Location')); $form->setSize('location', 60); $form->addText('loc_link', $event->loc_link); $form->setLabel('loc_link', dgettext('calendar', 'Location link')); $form->setSize('loc_link', 60); $form->addTextArea('description', $event->description); if ($suggest) { $form->setRows('description', 8); $form->setCols('description', 55); } else { $form->useEditor('description'); } $form->setLabel('description', dgettext('calendar', 'Description')); $form->addText('start_date', $event->getStartTime('%Y/%m/%d')); $form->setLabel('start_date', dgettext('calendar', 'Start time')); $form->setExtra('start_date', 'onblur="check_start_date()"'); $form->addText('end_date', $event->getEndTime('%Y/%m/%d')); $form->setLabel('end_date', dgettext('calendar', 'End time')); $form->setExtra('end_date', 'onblur="check_end_date()" onfocus="check_start_date()"'); $event->timeForm('start_time', $event->start_time, $form); $event->timeForm('end_time', $event->end_time, $form); $form->setExtra('start_time_hour', 'onchange="check_start_date()"'); $form->setExtra('end_time_hour', 'onchange="check_end_date()"'); $form->addCheck('all_day', 1); $form->setMatch('all_day', $event->all_day); $form->setLabel('all_day', dgettext('calendar', 'All day event')); $form->setExtra('all_day', 'onchange="alter_date(this)"'); if (!$suggest) { $form->addCheck('show_busy', 1); $form->setMatch('show_busy', $event->show_busy); $form->setLabel('show_busy', dgettext('calendar', 'Show busy')); } if ($suggest) { $form->addSubmit('save', dgettext('calendar', 'Suggest event')); } else { // Suggested events are not allowed repeats /** * Repeat form elements */ $form->addCheck('repeat_event', 1); $form->setLabel('repeat_event', dgettext('calendar', 'Make a repeating event')); $form->addText('end_repeat_date', $event->getEndRepeat('%Y/%m/%d')); $form->setLabel('end_repeat_date', dgettext('calendar', 'Repeat event until:')); $modes = array('daily', 'weekly', 'monthly', 'yearly', 'every'); $modes_label = array(dgettext('calendar', 'Daily'), dgettext('calendar', 'Weekly'), dgettext('calendar', 'Monthly'), dgettext('calendar', 'Yearly'), dgettext('calendar', 'Every')); $form->addRadio('repeat_mode', $modes); $form->setLabel('repeat_mode', $modes_label); $weekdays = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7); $weekday_labels = array(1 => strftime('%A', mktime(0, 0, 0, 1, 5, 1970)), 2 => strftime('%A', mktime(0, 0, 0, 1, 6, 1970)), 3 => strftime('%A', mktime(0, 0, 0, 1, 7, 1970)), 4 => strftime('%A', mktime(0, 0, 0, 1, 8, 1970)), 5 => strftime('%A', mktime(0, 0, 0, 1, 9, 1970)), 6 => strftime('%A', mktime(0, 0, 0, 1, 10, 1970)), 7 => strftime('%A', mktime(0, 0, 0, 1, 11, 1970))); $form->addCheck('weekday_repeat', $weekdays); $form->setLabel('weekday_repeat', $weekday_labels); $monthly = array('begin' => dgettext('calendar', 'Beginning of each month'), 'end' => dgettext('calendar', 'End of each month'), 'start' => dgettext('calendar', 'Every month on start date')); $form->addSelect('monthly_repeat', $monthly); $every_repeat_week = array(1 => dgettext('calendar', '1st'), 2 => dgettext('calendar', '2nd'), 3 => dgettext('calendar', '3rd'), 4 => dgettext('calendar', '4th'), 5 => dgettext('calendar', 'Last')); $frequency = array('every_month' => dgettext('calendar', 'Every month'), 1 => strftime('%B', mktime(0, 0, 0, 1, 1, 1970)), 2 => strftime('%B', mktime(0, 0, 0, 2, 1, 1970)), 3 => strftime('%B', mktime(0, 0, 0, 3, 1, 1970)), 4 => strftime('%B', mktime(0, 0, 0, 4, 1, 1970)), 5 => strftime('%B', mktime(0, 0, 0, 5, 1, 1970)), 6 => strftime('%B', mktime(0, 0, 0, 6, 1, 1970)), 7 => strftime('%B', mktime(0, 0, 0, 7, 1, 1970)), 8 => strftime('%B', mktime(0, 0, 0, 8, 1, 1970)), 9 => strftime('%B', mktime(0, 0, 0, 9, 1, 1970)), 10 => strftime('%B', mktime(0, 0, 0, 10, 1, 1970)), 11 => strftime('%B', mktime(0, 0, 0, 11, 1, 1970)), 12 => strftime('%B', mktime(0, 0, 0, 12, 1, 1970))); $form->addSelect('every_repeat_number', $every_repeat_week); $form->addSelect('every_repeat_weekday', $weekday_labels); $form->addSelect('every_repeat_frequency', $frequency); /* set repeat form matches */ if (!empty($event->repeat_type)) { $repeat_info = explode(':', $event->repeat_type); $repeat_mode_match = $repeat_info[0]; if (isset($repeat_info[1])) { $repeat_vars = explode(';', $repeat_info[1]); } else { $repeat_vars = null; } $form->setMatch('repeat_mode', $repeat_mode_match); switch ($repeat_mode_match) { case 'weekly': $form->setMatch('weekday_repeat', $repeat_vars); break; case 'monthly': $form->setMatch('monthly_repeat', $repeat_vars[0]); break; case 'every': $form->setMatch('every_repeat_number', $repeat_vars[0]); $form->setMatch('every_repeat_weekday', $repeat_vars[1]); $form->setMatch('every_repeat_frequency', $repeat_vars[2]); break; } $form->setMatch('repeat_event', 1); } if ($event->pid) { $form->addHidden('pid', $event->pid); // This is a repeat copy, if saved it removes it from the copy list $form->addSubmit('save', dgettext('calendar', 'Save and remove repeat')); $form->setExtra('save', sprintf('onclick="return confirm(\'%s\')"', dgettext('calendar', 'Remove event from repeat list?'))); } elseif ($event->id && $event->repeat_type) { // This is event is a source repeating event // Save this // Not sure if coding this portion. commenting for now // $form->addSubmit('save_source', dgettext('calendar', 'Save this event only')); $form->addSubmit('save_copy', dgettext('calendar', 'Save and apply to repeats')); $form->setExtra('save_copy', sprintf('onclick="return confirm(\'%s\')"', dgettext('calendar', 'Apply changes to repeats?'))); } else { // this is a non-repeating event $form->addSubmit('save', dgettext('calendar', 'Save event')); } } $tpl = $form->getTemplate(); if (!$suggest) { $tpl['EVENT_TAB'] = dgettext('calendar', 'Event'); $tpl['REPEAT_TAB'] = dgettext('calendar', 'Repeat'); } if (isset($event->_error)) { $tpl['ERROR'] = implode('<br />', $event->_error); } if ($event->pid) { $linkvar['aop'] = 'edit_event'; $linkvar['sch_id'] = $event->_schedule->id; $linkvar['event_id'] = $event->pid; if (javascriptEnabled()) { $linkvar['js'] = 1; } $source_link = PHPWS_Text::moduleLink(dgettext('calendar', 'Click here if you would prefer to edit the source event.'), 'calendar', $linkvar); $tpl['REPEAT_WARNING'] = dgettext('calendar', 'This is a repeat of another event.') . '<br />' . $source_link; } $tpl['SYNC'] = sprintf('<input type="button" style="display : none" id="sync-dates" onclick="sync_dates(); return false;" name="sync-dates" value="%s" />', dgettext('calendar', 'Sync dates')); if (javascriptEnabled()) { Layout::addJSHeader('<script src="' . PHPWS_SOURCE_HTTP . 'mod/calendar/javascript/edit_event/head.js"></script>'); Layout::addJSHeader('<script src="' . PHPWS_SOURCE_HTTP . 'mod/calendar/javascript/check_date/head.js"></script>'); } return PHPWS_Template::process($tpl, 'calendar', 'admin/forms/edit_event.tpl'); }
public function getSubLink($text, $parentVars) { return PHPWS_Text::moduleLink(dgettext('hms', $text), 'hms', $parentVars); }
/** * Row tags for DBPager. */ public function getRowTags() { $tags = array(); $tags['ID'] = $this->id; if ($this->isHidden()) { $tags['NAME'] = "<span id='{$this->id}' class='{$this->id} prog hidden-prog'>{$this->name}</span>"; } else { $tags['NAME'] = "<span id='{$this->id}' class='{$this->id} prog'>{$this->name}</span>"; } if (Current_User::allow('intern', $this->getEditPermission())) { $tags['EDIT'] = "<span id='edit-{$this->id}' class='{$this->id} edit-prog'>Edit</span> | "; if ($this->isHidden()) { $tags['HIDE'] = PHPWS_Text::moduleLink('Show', 'intern', array('action' => $this->getEditAction(), 'hide' => false, 'id' => $this->getId())); } else { $tags['HIDE'] = PHPWS_Text::moduleLink('Hide', 'intern', array('action' => $this->getEditAction(), 'hide' => true, 'id' => $this->getId())); } } if (Current_User::allow('intern', $this->getDeletePermission())) { $div = null; if (isset($tags['HIDE'])) { $div = ' | '; } $tags['DELETE'] = $div . PHPWS_Text::moduleLink('Delete', 'intern', array('action' => $this->getEditAction(), 'del' => TRUE, 'id' => $this->getID())); } return $tags; }
public static function miniLinks() { $vars['action'] = 'admin'; if (Layout::isMoveBox()) { $vars['command'] = 'turn_off_box_move'; $links[] = PHPWS_Text::moduleLink('<i class="fa fa-toggle-on"></i> ' . dgettext('layout', 'Turn box move off'), 'layout', $vars); } else { $vars['command'] = 'move_boxes_on'; $links[] = PHPWS_Text::secureLink('<i class="fa fa-toggle-off"></i> ' . dgettext('layout', 'Turn box move on'), 'layout', $vars); } unset($vars['command']); $vars['tab'] = 'meta'; $links[] = PHPWS_Text::secureLink('<i class="fa fa-edit"></i> ' . dgettext('layout', 'Change Website Title'), 'layout', $vars); $key = Key::getCurrent(); if (javascriptEnabled() && Layout::getExtraStyles() && Key::checkKey($key)) { $js_vars['width'] = 400; $js_vars['height'] = 200; $vars['key_id'] = $key->id; $vars['action'] = 'admin'; $js_vars['label'] = '<i class="fa fa-paint-brush"></i> ' . dgettext('layout', 'Change style'); $vars['command'] = 'js_style_change'; $js_vars['address'] = PHPWS_Text::linkAddress('layout', $vars, TRUE); $links[] = javascript('open_window', $js_vars); if (!$key->isHomeKey()) { $js_vars['height'] = 400; $js_vars['label'] = dgettext('layout', 'Meta tags'); $vars['command'] = 'page_meta_tags'; $js_vars['address'] = PHPWS_Text::linkAddress('layout', $vars, TRUE); $links[] = javascript('open_window', $js_vars); } } if (!isset($links)) { return; } MiniAdmin::add('layout', $links); // MiniAdmin runs get before layout and runtime won't work // with flagged keys MiniAdmin::get(); }
public function row_tags($subpage = false) { $vars['uop'] = 'view_page'; $tpl['ID'] = $vars['id'] = $this->id; $tpl['TITLE'] = PHPWS_Text::moduleLink($this->title, 'pagesmith', $vars); if (Current_User::allow('pagesmith', 'edit_page', $this->id)) { $links[] = $this->editLink(null, true); } if (Current_User::allow('pagesmith', 'delete_page')) { $links[] = $this->deleteLink(true); } if (Current_User::allow('pagesmith', 'edit_page', $this->id)) { if (!$subpage) { $links[] = $this->frontPageToggle(true); } } if (isset($links)) { $tpl['ACTION'] = implode(' ', $links); } $tpl['CREATE_DATE'] = strftime('%d %b %y, %H:%M', $this->create_date); $tpl['LAST_UPDATED'] = strftime('%d %b %y, %H:%M', $this->last_updated); $tpl['UPDATER'] = $this->_updater; if ($subpage) { $tpl['PAGE_NO'] = $this->page_order + 1; } return $tpl; }
public function rowTags() { PHPWS_Core::requireConfig('filecabinet', 'config.php'); if (FC_ICON_PAGER_LINKS) { $mode = 'icon'; $spacer = ''; } else { $mode = null; $spacer = ' | '; } //$icon = sprintf('<img src="%s" />', $this->icon); $vars['aop'] = 'view_folder'; $vars['folder_id'] = $this->id; $tpl['TITLE'] = PHPWS_Text::moduleLink($this->title, 'filecabinet', $vars); $tpl['ITEMS'] = $this->tallyItems(); if (Current_User::allow('filecabinet', 'edit_folders', $this->id, 'folder')) { $links[] = $this->editLink('image'); $links[] = $this->uploadLink('icon'); } if (Current_User::allow('filecabinet', 'edit_folders', $this->id, 'folder', true)) { if ($this->key_id) { $links[] = Current_User::popupPermission($this->key_id, null, $mode); } } if (Current_User::allow('filecabinet', 'delete_folders', null, null, true)) { $links[] = $this->deleteLink('image'); } $mods = PHPWS_Core::getModuleNames(); if ($this->module_created && isset($mods[$this->module_created])) { $tpl['MODULE_CREATED'] = $mods[$this->module_created]; } else { $tpl['MODULE_CREATED'] = dgettext('filecabinet', 'General'); } $tpl['PUBLIC'] = $this->getPublic(); if (@$links) { $tpl['LINKS'] = implode($spacer, $links); } return $tpl; }
function getRecentChangesTpl() { $db = new PHPWS_DB('wiki_pages_version'); $db->addWhere('source_id', $this->getSourceId()); $db->addColumn('vr_number', 'min'); if ($this->getVrNumber() != $db->select('min')) { $links[] = PHPWS_Text::moduleLink(dgettext('wiki', 'Diff'), 'wiki', array('page' => $this->getTitle(FALSE), 'page_op' => 'compare', 'oVer' => $this->getVrNumber() - 1, 'nVer' => $this->getVrNumber())); } $links[] = PHPWS_Text::moduleLink(dgettext('wiki', 'History'), 'wiki', array('page_op' => 'history', 'page_id' => $this->getSourceId())); $template['VIEW'] = implode(' | ', $links); $template['PAGE'] = PHPWS_Text::moduleLink($this->getTitle(), 'wiki', array('page' => $this->getTitle(FALSE))); $template['UPDATED'] = $this->getUpdated(); $template['EDITOR'] = $this->getEditor(); $template['COMMENT'] = $this->getComment() . ''; return $template; }
private function getCancel($s) { $img = ' <i style="color : red" class="fa fa-times-circle"></i>'; $vars['rop'] = 'remove'; $vars['s'] = $s; return \PHPWS_Text::moduleLink($img, 'properties', $vars); }
function getTpl() { $vars['page'] = $this->getTitle(FALSE); $links[] = PHPWS_Text::moduleLink(dgettext('wiki', 'View'), 'wiki', $vars); if (Current_User::allow('wiki', 'edit_page')) { $vars['page_op'] = 'edit'; $links[] = PHPWS_Text::secureLink(dgettext('wiki', 'Edit'), 'wiki', $vars); } if (Current_User::allow('wiki', 'delete_page')) { $vars['page_op'] = 'delete'; $links[] = PHPWS_Text::secureLink(dgettext('wiki', 'Delete'), 'wiki', $vars); } $template['ACTIONS'] = implode(' | ', $links); $template['TITLE'] = $this->getTitle(); $template['UPDATED'] = $this->getUpdated(); $template['VERSION'] = $this->getVersion(); $template['HITS'] = $this->getHits(); $template['ORPHANED'] = $this->isOrphaned(); return $template; }
public function getTitle() { $vars['site_map'] = $this->id; return PHPWS_Text::moduleLink($this->title, 'menu', $vars); }
/** * Adds wiki links to the MiniAdmin box * * @author Greg Meiste <*****@*****.**> */ 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); } }
public function loginMenu() { $vars['k'] = $this->key; $vars['cop'] = 'edit_property'; $tpl['CREATE'] = \PHPWS_Text::moduleLink('Create property', 'properties', $vars); $vars['cop'] = 'view_properties'; $tpl['VIEW'] = \PHPWS_Text::moduleLink('View properties', 'properties', $vars); $vars['cop'] = 'edit_contact'; $tpl['EDIT'] = \PHPWS_Text::moduleLink('Edit my information', 'properties', $vars); $vars['cop'] = 'logout'; $tpl['LOGOUT'] = \PHPWS_Text::moduleLink('Logout', 'properties', $vars); $content = \PHPWS_Template::process($tpl, 'properties', 'mini_contact.tpl'); \Layout::add($content, 'properties', 'contact_login'); }
public function getLimitList() { $values = $this->getLinkValues(); unset($values['limit']); if (isset($values['module'])) { $module = $values['module']; unset($values['module']); } else { $module =& $this->module; } $anchor = $this->getAnchor(); if ($anchor) { $values['#'] = $anchor; } foreach ($this->limitList as $limit) { if ($limit == $this->limit) { $links[] = $limit; } else { $values['limit'] =& $limit; $links[] = \PHPWS_Text::moduleLink($limit, $module, $values, null, sprintf(_('Limit results to %s rows'), $limit)); } } return implode(' ', $links); }
public function view() { if (empty($this->id)) { \Layout::add('<h1>Sorry</h1><p>This property is not in our system. Please return to the <a href="./">property listing page</a> to try again.</p>'); return; } $tpl = $this->getBaseTpl(); $refund = '<span style="font-size : 90%">(Refundable)</span>'; \PHPWS_Core::initModClass('properties', 'Contact.php'); $max_width = PANEL_WIDTH; $max_height = PANEL_HEIGHT; \Layout::addStyle('properties', 'view.css'); $tpl['NAME'] = $this->viewLink($this->name); $photos = $this->getPhotos(); if ($photos) { javascriptMod('properties', 'galleryview', array('panel_width' => $max_width, 'panel_height' => $max_height)); foreach ($photos as $p) { if (is_file($p['path'])) { $dim = getimagesize($p['path']); $width =& $dim[0]; $height =& $dim[1]; $diff = \PHPWS_File::getDiff($width, $max_width, $height, $max_height); $new_width = round($width * $diff); $new_height = round($height * $diff); if ($new_width > $max_width || $new_height > $max_height) { $diff = \PHPWS_File::getDiff($new_width, $max_width, $new_height, $max_height); $new_width = round($width * $diff); $new_height = round($height * $diff); } } else { $p['path'] = PHPWS_SOURCE_HTTP . 'mod/properties/img/no_photo.gif'; $p['title'] = 'Photo not found'; $new_width = '150px'; $new_height = '113px'; } $all[] = sprintf('<li><img src="%s" title="%s" /> <div class="panel-content lightbox"> <a class="lightbox" href="%s"><img src="%s" width="%s" height="%s" /></a> </div></li>', Photo::thumbnailPath($p['path']), $p['title'], $p['path'], $p['path'], $new_width, $new_height); } $tpl['PHOTOS'] = implode("\n", $all); } else { $tpl['NO_PHOTO'] = '<img src="' . PHPWS_SOURCE_HTTP . 'mod/properties/img/no_photo.gif" alt="No photo" title="No photos available" />'; } $contact = new Contact($this->contact_id); if (!empty($contact->company_address)) { $tpl['COMPANY_ADDRESS'] = $contact->getCompanyAddress(); $tpl['GOOGLE_COMPANY'] = sprintf('<a target="_blank" href="http://maps.google.com/maps?q=%s"> <img class="google-map" src="%smod/properties/img/google-pin-red.gif" title="Google maps" target="_blank" /></a>', Property::googleMapUrl($contact->company_address), PHPWS_SOURCE_HTTP); } $tpl['COMPANY_NAME'] = $contact->getCompanyUrl(); $tpl['EMAIL'] = $contact->getEmailAddress(true); $tpl['PHONE'] = $contact->getPhone(); $tpl['TIMES_AVAILABLE'] = $contact->getTimesAvailable(); $tpl['ADDRESS'] = $this->getAddress(); $tpl['GOOGLE_MAP'] = sprintf('<a target="_blank" href="http://maps.google.com/maps?q=%s"> <img src="%smod/properties/img/google-pin-red.gif" title="Google maps" target="_blank" /></a>', Property::googleMapUrl($this->address), PHPWS_SOURCE_HTTP); $tpl['LEASE_TYPE'] = $this->getLeaseType(); if ($this->efficiency) { $tpl['BEDROOMS'] = 'One room efficiency'; } else { $tpl['BEDROOMS'] = $this->bedroom_no; } $tpl['BATHROOMS'] = $this->getBathroomNo(); if ($this->window_number) { $tpl['WINDOWS'] = 'Yes'; } else { $tpl['WINDOWS'] = 'No'; } if (!empty($this->admin_fee_amt)) { $tpl['ADMIN_FEE'] = '$' . $this->getAdminFeeAmt(); $tpl['ADMIN_FEE_REFUND'] = $this->admin_fee_refund ? $refund : null; } if (!empty($this->parking_fee)) { $tpl['PARKING_FEE'] = '$' . $this->getParkingFee(); } if (!empty($this->security_amt)) { $tpl['SECURITY_AMT'] = '$' . $this->getSecurityAmt(); $tpl['SECURITY_REFUND'] = $this->security_refund ? $refund : null; } if (!empty($this->other_fees)) { $tpl['OTHER_FEES'] = $this->getOtherFees(); } if (!empty($this->clean_fee_amt)) { $tpl['CLEAN_FEE_AMT'] = '$' . $this->getCleanFeeAmt(); $tpl['CLEAN_FEE_REFUND'] = $this->clean_fee_refund ? $refund : null; } $tpl['PARKING_PER_UNIT'] = $this->getParkingPerUnit(); if ($this->pets_allowed) { $tpl['PETS_ALLOWED'] = 'Yes'; $tpl['PET_TYPES'] = $this->getPetType(); if ($this->pet_deposit) { $tpl['PET_DEPOSIT'] = '$' . $this->getPetDeposit() . ' <span style="font-size : 90%">(refundable)</span>'; } else { $tpl['PET_DEPOSIT'] = 'None'; } if ($this->pet_fee) { $tpl['PET_FEE'] = '$' . $this->getPetFee() . ' <span style="font-size : 90%">(nonrefundable)</span>'; } else { $tpl['PET_FEE'] = 'None'; } } else { $tpl['PETS_ALLOWED'] = 'No'; } $utility_allowance = false; $tpl['STUDENT_TYPE'] = $this->getStudentType(); if ($this->util_water) { $utility_allowance = true; $tpl['UTIL_WATER'] = $this->getUtilWater(); } if ($this->util_trash) { $utility_allowance = true; $tpl['UTIL_TRASH'] = $this->getUtilTrash(); } if ($this->util_power) { $utility_allowance = true; $tpl['UTIL_POWER'] = $this->getUtilPower(); } if ($this->util_fuel) { $utility_allowance = true; $tpl['UTIL_FUEL'] = $this->getUtilFuel(); } if ($this->util_cable) { $utility_allowance = true; $tpl['UTIL_CABLE'] = $this->getUtilCable(); } if ($this->util_internet) { $utility_allowance = true; $tpl['UTIL_INTERNET'] = $this->getUtilInternet(); } if ($this->util_phone) { $utility_allowance = true; $tpl['UTIL_PHONE'] = $this->getUtilPhone(); } $photo = new Photo(); $photo->setPropertyId($this->id); if (isset($_GET['photo'])) { $data['pid'] = $this->id; } $data['view'] = 1; if (\Current_User::allow('properties')) { javascriptMod('properties', 'photo_upload', $data); $tpl['ADD_PHOTO'] = $photo->uploadNew(false); $tpl['EDIT'] = \PHPWS_Text::secureLink('<i class="fa fa-edit"></i> Edit', 'properties', array('aop' => 'edit_property', 'pid' => $this->id), null, null, 'btn btn-default'); if (!$this->active) { $tpl['ACTIVE'] = '<div id="not-active">This property is currently NOT ACTIVE</div>'; } } elseif (isset($_SESSION['Contact_User']->id) && $_SESSION['Contact_User']->id == $this->contact_id) { if (!$this->active) { $tpl['ACTIVE'] = '<div id="not-active">This property is currently NOT ACTIVE</div>'; } $data['is_contact'] = 1; javascriptMod('properties', 'photo_upload', $data); $tpl['ADD_PHOTO'] = $photo->uploadNew(false); $tpl['EDIT'] = \PHPWS_Text::moduleLink('Edit property', 'properties', array('cop' => 'edit_property', 'pid' => $this->id, 'k' => $_SESSION['Contact_User']->getKey())); } elseif (!$this->active) { \Layout::add('This property is currently not available'); return; } $heat_type = $this->getHeatType(); if ($heat_type) { $tpl['HEAT_TYPE'] = implode(', ', $this->getHeatType()); } $content = \PHPWS_Template::process($tpl, 'properties', 'view.tpl'); \Layout::add($content); }
/** * Interwiki Setup * * @author Greg Meiste <*****@*****.**> */ function setup() { if (!Current_User::authorized('wiki', 'edit_page') && !(PHPWS_Settings::get('wiki', 'allow_page_edit') && Current_User::isLogged())) { Current_User::disallow(dgettext('wiki', 'User attempted access to Interwiki setup.')); return; } PHPWS_Core::initCoreClass('DBPager.php'); if ($_REQUEST['op'] == 'editinterwiki') { $tags = $this->edit(); } else { if ($_REQUEST['op'] == 'deleteinterwiki') { $tags = $this->kill(); } else { $tags = $this->add(); } } if ($_REQUEST['op'] == 'addinterwiki' || $_REQUEST['op'] == 'saveinterwiki') { WikiManager::sendMessage($this->save(), 'interwikisetup'); } else { if ($_REQUEST['op'] == 'dodeleteinterwiki') { WikiManager::sendMessage($this->kill(), 'interwikisetup'); } } $tags['MESSAGE'] = WikiManager::getMessage(); $tags['BACK'] = PHPWS_Text::moduleLink(dgettext('wiki', 'Back to Wiki'), 'wiki'); $tags['SITE_LIST_LABEL'] = dgettext('wiki', 'Site list'); $tags['USAGE'] = sprintf(dgettext('wiki', 'To link to an interwiki site, use %s.'), 'WikiName:PageName'); $tags['LIST_LABEL'] = dgettext('wiki', 'Site Name'); $tags['LIST_URL'] = dgettext('wiki', 'URL'); $tags['LIST_UPDATED'] = dgettext('wiki', 'Updated'); $tags['LIST_ACTIONS'] = dgettext('wiki', 'Actions'); $pager = new DBPager('wiki_interwiki', 'InterWiki'); $pager->setModule('wiki'); $pager->setTemplate('interwiki/setup.tpl'); $pager->addToggle(PHPWS_LIST_TOGGLE_CLASS); $pager->addPageTags($tags); $pager->addRowTags('getTpl'); $pager->setSearch('label'); $pager->setDefaultOrder('label', 'asc'); $pager->cacheQueries(); $template['TITLE'] = dgettext('wiki', 'Interwiki Setup'); $template['CONTENT'] = $pager->get(); Layout::add(PHPWS_Template::process($template, 'wiki', 'box.tpl'), 'wiki', 'wiki_mod', TRUE); }
/** * Lists the contents of a folder for adminstrative changes. * @param object $folder * @param boolean $pick_image */ public function folderContents($folder) { $links = array(); javascript('jquery'); $src = PHPWS_SOURCE_HTTP . 'mod/filecabinet/javascript/folder_options/contents.js'; \Layout::addJSHeader("<script type='text/javascript' src='{$src}'></script>", 'folder-options'); Layout::addStyle('filecabinet'); PHPWS_Core::initCoreClass('DBPager.php'); $dir_write = true; if (!is_writable($folder->getFullDirectory())) { $this->cabinet->message .= dgettext('filecabinet', 'Warning: this folder\'s directory is not writable.'); $dir_write = false; } if ($folder->ftype == IMAGE_FOLDER) { javascript('lightbox'); PHPWS_Core::initModClass('filecabinet', 'Image.php'); $pager = new DBPager('images', 'PHPWS_Image'); $pager->setTemplate('Forms/image_grid.tpl'); $limits[9] = 9; $limits[16] = 16; $limits[25] = 25; $operation = 'iop'; $command = 'upload_image_form'; $label = _('Add image'); } elseif ($folder->ftype == DOCUMENT_FOLDER) { PHPWS_Core::initModClass('filecabinet', 'Document.php'); $pager = new DBPager('documents', 'PHPWS_Document'); $pager->setTemplate('Forms/file_list.tpl'); $limits[10] = 10; $limits[25] = 25; $limits[50] = 50; $operation = 'dop'; $label = _('Add document'); $command = 'upload_document_form'; $pager->addSortHeader('downloaded', sprintf('<abbr title="%s">%s</abbr>', dgettext('filecabinet', 'Downloaded'), dgettext('filecabinet', 'DL'))); } elseif ($folder->ftype = MULTIMEDIA_FOLDER) { PHPWS_Core::initModClass('filecabinet', 'Multimedia.php'); $pager = new DBPager('multimedia', 'PHPWS_Multimedia'); $pager->setTemplate('Forms/multimedia_grid.tpl'); $limits[9] = 9; $limits[16] = 16; $limits[25] = 25; $label = _('Add media'); $command = 'upload_multimedia_form'; $operation = 'mop'; } if (Current_User::allow('filecabinet', 'edit_folders', $folder->id, 'folder')) { if ($dir_write) { $links[] = $folder->uploadLink('button'); } if ($folder->ftype == MULTIMEDIA_FOLDER) { //$links[] = $folder->rtmpLink(); $salt = array('mop' => 'edit_rtmp', 'folder_id' => $folder->id); $authkey = \Current_User::getAuthKey(PHPWS_Text::saltArray($salt)); $links[] = <<<EOF <button class="btn btn-default show-modal" data-authkey="{$authkey}" data-command="edit_rtmp" data-operation="{$operation}" data-folder-id="{$folder->id}"><i class="fa fa-cloud"></i> Add RTMP video</button> EOF; } //$links[] = $folder->editLink(); $salt = array($operation => 'edit_folder', 'folder_id' => $folder->id); $authkey = \Current_User::getAuthKey(PHPWS_Text::saltArray($salt)); $links[] = <<<EOF <button class="btn btn-default show-modal" data-authkey="{$authkey}" data-command="edit_folder_modal" data-operation="aop" data-folder-id="{$folder->id}"><i class="fa fa-edit"></i> Edit</button> EOF; } if ($this->cabinet->panel) { $pagetags['BACK'] = PHPWS_Text::moduleLink('<i class="fa fa-reply"></i> ' . dgettext('filecabinet', 'Back to folder list'), 'filecabinet', array('tab' => $this->cabinet->panel->getCurrentTab()), null, null, 'btn btn-default'); } if (!empty($links)) { $pagetags['ADMIN_LINKS'] = implode(' ', $links); } $pagetags['MODAL'] = $this->getModal(); $pagetags['ACTION_LABEL'] = dgettext('filecabinet', 'Action'); $pager->setLimitList($limits); $pager->setSearch('file_name', 'title', 'description'); $pager->addWhere('folder_id', $folder->id); $pager->setOrder('title', 'asc', true); $pager->setModule('filecabinet'); $pager->addPageTags($pagetags); $pager->addRowTags('rowTags'); $pager->addSortHeader('title', dgettext('filecabinet', 'Title')); $pager->addSortHeader('file_name', dgettext('filecabinet', 'File name')); $pager->addSortHeader('file_type', dgettext('filecabinet', 'File type')); $pager->addSortHeader('size', dgettext('filecabinet', 'Size')); $pager->setEmptyMessage(dgettext('filecabinet', 'Folder is empty.')); $this->cabinet->content = $pager->get(); }
public function getLink($text, $target = null, $cssClass = null, $title = null) { return PHPWS_Text::moduleLink(dgettext('events', $text), 'events', $this->getRequestVars(), $target, $title, $cssClass); }
public function editSlotLink() { $vars['aop'] = 'edit_slots'; $vars['sheet_id'] = $this->id; return PHPWS_Text::moduleLink(dgettext('signup', 'Edit slots'), 'signup', $vars); }
private function contactPropertiesList($contact_id) { \PHPWS_Core::initModClass('properties', 'Property.php'); $this->title = $this->contact->getCompanyName() . '<br /> (c/o ' . $this->contact->getFirstName() . ' ' . $this->contact->getLastName() . ')'; $pager = new \DBPager('properties', 'Properties\\Property'); $pager->addWhere('contact_id', $contact_id); $data['is_contact'] = 1; $page_tags['new'] = \PHPWS_Text::moduleLink('Add new property', 'properties', array('aop' => 'edit_property', 'cid' => $contact_id)); $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'); $pager->joinResult('contact_id', 'prop_contacts', 'id', 'company_name', null, true); $pager->addPageTags($page_tags); $pager->cacheQueries(); $pager->addToggle(' style="background-color : #e3e3e3"'); $this->content = $pager->get(); }
public static function loggedOut() { if (isset($_REQUEST['phpws_username'])) { $username = $_REQUEST['phpws_username']; } else { $username = NULL; } $form = new PHPWS_Form('User_Login_Box'); $form->setProtected(false); $form->addHidden('module', 'users'); $form->addHidden('action', 'user'); $form->addHidden('command', 'login'); $form->addText('phpws_username', $username); $form->setSize('phpws_username', 10); $form->setClass('phpws_username', 'form-control'); $form->addPassword('phpws_password'); $form->setSize('phpws_password', 10); $form->setClass('phpws_password', 'form-control'); $form->addSubmit('submit', LOGIN_BUTTON); $form->setLabel('phpws_username', dgettext('users', 'Username')); $form->setLabel('phpws_password', dgettext('users', 'Password')); $form->setPlaceholder('phpws_username', dgettext('users', 'Username')); $form->setPlaceholder('phpws_password', dgettext('users', 'Password')); $template = $form->getTemplate(); $template = array(); $signup_vars = array('action' => 'user', 'command' => 'signup_user'); $template['HOME_LOGIN'] = PHPWS_Text::moduleLink(dgettext('users', 'Home')); if (PHPWS_Settings::get('users', 'new_user_method')) { $template['NEW_ACCOUNT'] = PHPWS_Text::moduleLink(USER_SIGNUP_QUESTION, 'users', $signup_vars); } $fg_vars = array('action' => 'user', 'command' => 'forgot_password'); $template['FORGOT'] = PHPWS_Text::moduleLink(dgettext('users', 'Forgot password?'), 'users', $fg_vars); $usermenu = PHPWS_User::getUserSetting('user_menu'); $user = Current_User::getUserObj(); $authorization = $user->getAuthorization(); $template['LOGIN_VIEW'] = $authorization->getView(); return PHPWS_Template::process($template, 'users', 'usermenus/' . $usermenu); }