本文整理汇总了PHP中PHPWS_Text类的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Text类的具体用法?PHP PHPWS_Text怎么用?PHP PHPWS_Text使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PHPWS_Text类的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);
}
}
示例2: 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();
}
示例3: view
/**
* View this PHAT_Checkbox
*
* @return string The HTML content to view the PHAT_Checkbox
* @access public
*/
function view()
{
$label = $this->getLabel();
if (isset($_REQUEST['PHAT_' . $label]) && is_array($_REQUEST['PHAT_' . $label])) {
$this->setValue($_REQUEST['PHAT_' . $label]);
}
if ($this->isRequired()) {
$viewTags['REQUIRED_FLAG'] = '*';
}
$viewTags['BLURB'] = PHPWS_Text::parseOutput($this->getBlurb(), ENCODE_PARSED_TEXT, false, true);
$viewTags['CHECK_BOXES'] = '';
$optionText = $this->getOptionText();
$optionValues = $this->getOptionValues();
$value = $this->getValue();
$viewTags['CHECK_BOXES'] = null;
for ($i = 0; $i < sizeof($optionText); $i++) {
if (isset($value[$i])) {
$match = $value[$i];
} else {
$match = null;
}
$option_value = $optionValues[$i];
$element = new Form_CheckBox('PHAT_' . $label . '[' . $i . ']', $option_value);
$element->setMatch($match);
$id = preg_replace('/\\W/', '', $option_value) . $i;
$element->setId($id);
$label_text = "<label for='{$id}'>" . $optionText[$i] . "</label>";
$viewTags['CHECK_BOXES'] .= $element->get() . " {$label_text}<br />\n";
}
return PHPWS_Template::processTemplate($viewTags, 'phatform', 'checkbox/view.tpl');
}
示例4: 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');
}
示例5: getSubLink
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') . ']';
}
示例6: 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');
}
示例7: 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');
}
示例8: getOptions
public function getOptions()
{
if (!$this->reported) {
$opt[] = sprintf('<a style="cursor : pointer" class="message" id="%s">%s</a>', $this->from_user_id, \Icon::show('undo', 'Reply to contact'));
$opt[] = sprintf('<a style="cursor:pointer" class="report" id="%s">%s</a>', $this->id, \Icon::show('warning', 'Report'));
$opt[] = javascript('confirm', array('question' => 'Are you sure you want to delete this message?', 'address' => \PHPWS_Text::linkAddress('properties', array('rop' => 'delete_message', 'id' => $this->id)), 'link' => \Icon::show('delete'), 'title' => 'Delete message'));
return implode('', $opt);
} else {
return null;
}
}
示例9: 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;
}
示例10: 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;
}
示例11: processForm
public function processForm(array $values)
{
$this->setName(PHPWS_Text::parseInput($values['name']));
if (isset($values['active'])) {
$this->setActive();
} else {
$this->setInactive();
}
if (isset($values['disable_if_logged'])) {
$this->setDisableIfLogged(true);
} else {
$this->setDisableIfLogged(false);
}
}
示例12: new_account
/**
* @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);
}
示例13: 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');
}
示例14: execute
public function execute(CommandContext $context)
{
if (!UserStatus::isUser()) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You do not have permission to request a roommate.');
}
$term = $context->get('term');
$requestee = $context->get('username');
$requestor = UserStatus::getUsername();
if (empty($term)) {
throw new InvalidArgumentException('Term was not specified.');
}
$err = CommandFactory::getCommand('ShowRequestRoommate');
$err->setTerm($term);
if (empty($requestee)) {
NQ::simple('hms', hms\NotificationView::WARNING, 'You did not enter a username.');
$err->redirect();
}
if (!PHPWS_Text::isValidInput($requestee)) {
NQ::simple('hms', hms\NotificationView::WARNING, 'You entered an invalid username. Please use letters and numbers only.');
$err->redirect();
}
// Attempt to Create Roommate Request
PHPWS_Core::initModClass('hms', 'HMS_Roommate.php');
$request = new HMS_Roommate();
try {
$request->request($requestor, $requestee, $term);
} catch (RoommateCompatibilityException $rre) {
NQ::simple('hms', hms\NotificationView::WARNING, $rre->getMessage());
$err->redirect();
}
$request->save();
$endTime = $request->calc_req_expiration_date();
$expirationMsg = " expires on " . date('m/d/Y h:i:s a', $endTime);
HMS_Activity_Log::log_activity($requestee, ACTIVITY_REQUESTED_AS_ROOMMATE, $requestor, "{$requestor} requested {$requestee}" . $expirationMsg);
HMS_Activity_Log::log_activity($requestor, ACTIVITY_REQUESTED_AS_ROOMMATE, $requestee, "{$requestor} requested {$requestee}" . $expirationMsg);
// Email both parties
PHPWS_Core::initModClass('hms', 'HMS_Email.php');
HMS_Email::send_request_emails($request);
// Notify
PHPWS_Core::initModClass('hms', 'StudentFactory.php');
$student = StudentFactory::getStudentByUsername($requestee, $term);
$name = $student->getName();
$fname = $student->getFirstName();
NQ::simple('hms', hms\NotificationView::SUCCESS, "You have requested {$name} to be your roommate. {$fname} has been emailed, and will need to log into HMS and approve your roommate request.");
$cmd = CommandFactory::getCommand('ShowStudentMenu');
$cmd->redirect();
}
示例15: 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;
}