⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-horde
/
nag
/
lib
/
Ui
/
VarRenderer
/
View File Name :
Nag.php
* @package Nag */ class Horde_Core_Ui_VarRenderer_Nag extends Horde_Core_Ui_VarRenderer_Html { protected function _renderVarInput_NagAlarm($form, $var, $vars) { $varname = htmlspecialchars($var->getVarName()); $value = $var->getValue($vars); if (!is_array($value)) { if ($value) { if ($value % 10080 == 0) { $value = array('value' => $value / 10080, 'unit' => 10080); } elseif ($value % 1440 == 0) { $value = array('value' => $value / 1440, 'unit' => 1440); } elseif ($value % 60 == 0) { $value = array('value' => $value / 60, 'unit' => 60); } else { $value = array('value' => $value, 'unit' => 1); } $value['on'] = true; } else { $value = array('on' => false); } } $units = array(1 => _("Minute(s)"), 60 => _("Hour(s)"), 1440 => _("Day(s)"), 10080 => _("Week(s)")); $options = ''; foreach ($units as $unit => $label) { $options .= '
' . $label . '
'; } return sprintf('
%s
', $varname, $varname, $value['on'] ? '' : ' checked="checked"', $varname, _("None")) . sprintf('
', $varname, $varname, $value['on'] ? ' checked="checked"' : '') . sprintf('
', $varname, $varname, $value['on'] ? htmlspecialchars($value['value']) : 15) . sprintf('
%s
', $varname, $varname, $options); } protected function _renderVarInput_NagDue($form, $var, $vars) { $var->type->getInfo($vars, $var, $task_due); if ($task_due == 0) { $date = '+' . (int)$GLOBALS['prefs']->getValue('default_due_days') . ' days'; $time = $GLOBALS['prefs']->getValue('default_due_time'); if ($time == 'now') { $time = ''; } else { $time = ' ' . $time; } $due_dt = strtotime($date . $time); // Default to having a due date for new tasks if the // default_due preference is set. if (!$vars->exists('task_id') && $GLOBALS['prefs']->getValue('default_due')) { $task_due = strtotime($date . $time); } } else { $due_dt = $task_due; } $on = $task_due > 0; /* Set up the radio buttons. */ $html = sprintf( '
%s
%s
%s
', $on ? '' : ' checked="checked"', Horde::label('due_type_none', _("No due date.")), $on ? ' checked="checked"' : '', _("Due date specified."), _("Date"), htmlspecialchars(strftime($GLOBALS['prefs']->getValue('date_format_mini'), $due_dt)) ); if ($GLOBALS['browser']->hasFeature('javascript')) { Horde_Core_Ui_JsCalendar::init(array( 'full_weekdays' => true )); $GLOBALS['page_output']->addScriptFile('calendar.js'); $html .= '
' . Horde::img('calendar.png', _("Calendar"), 'id="dueimg"'); } $time_format = $GLOBALS['prefs']->getValue('twentyFour') ? 'H:i' : 'h:i a'; $due_time = date($time_format, $due_dt); $html .= _("at") . sprintf( '
%s
', _("Time"), htmlspecialchars($due_time) ); return $html; } protected function _renderVarInput_NagMethod($form, $var, $vars) { $varname = htmlspecialchars($var->getVarName()); $varvalue = $var->getValue($vars); $on = !empty($varvalue) && (!isset($varvalue['on']) || !empty($varvalue['on'])); $html = sprintf( '
%s
', $varname, $varname, $on ? '' : ' checked="checked"', $this->_getActionScripts($form, $var), $varname, _("Use default notification method") ) . sprintf( '
%s
', $varname, $on ? ' checked="checked"' : '', $this->_getActionScripts($form, $var), $varname, _("Use custom notification method") ); if ($on) { Horde_Core_Prefs_Ui_Widgets::alarmInit(); $html .= '
'; $params = array('pref' => 'task_alarms', 'label' => ''); if ((!empty($varvalue) && !isset($varvalue['on'])) || $form->isSubmitted()) { $params['value'] = $varvalue; } $html .= Horde_Core_Prefs_Ui_Widgets::alarm($params); } return $html; } /** * Render the recurrence fields */ public function _renderVarInput_NagRecurrence($form, $var, $vars) { if ($vars->recurrence instanceof Horde_Date_Recurrence) { $recur = $var->getValue($vars); } else { $var->type->getInfo($vars, $var, $recur); } /* No recurrence. */ $html = sprintf( '
%s
', Horde_Date_Recurrence::RECUR_NONE, $recur ? '' : ' checked="checked"', Horde::label('recurnone', _("No recurrence")) ); /* Daily. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_DAILY); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_DAILY, $on ? ' checked="checked"' : '', _("Daily: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_daily_interval', _("day(s)")) ); /* Weekly. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_WEEKLY); $html .= sprintf( '
%s
%s
%s
%s
%s
%s
%s
%s
%s
', Horde_Date_Recurrence::RECUR_WEEKLY, $on ? ' checked="checked"' : '', _("Weekly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_weekly_interval', _("week(s) on:")), Horde::label('mo', _("Mo")), Horde_Date::MASK_MONDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_MONDAY) ? ' checked="checked"' : '', Horde::label('tu', _("Tu")), Horde_Date::MASK_TUESDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_TUESDAY) ? ' checked="checked"' : '', Horde::label('we', _("We")), Horde_Date::MASK_WEDNESDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_WEDNESDAY) ? ' checked="checked"' : '', Horde::label('th', _("Th")), Horde_Date::MASK_THURSDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_THURSDAY) ? ' checked="checked"' : '', Horde::label('fr', _("Fr")), Horde_Date::MASK_FRIDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_FRIDAY) ? ' checked="checked"' : '', Horde::label('sa', _("Sa")), Horde_Date::MASK_SATURDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_SATURDAY) ? ' checked="checked"' : '', Horde::label('su', _("Su")), Horde_Date::MASK_SUNDAY, $recur && $recur->recurOnDay(Horde_Date::MASK_SUNDAY) ? ' checked="checked"' : '' ); /* Monthly on same date. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_MONTHLY_DATE, $on ? ' checked="checked"' : '', _("Monthly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_day_of_month_interval', _("month(s)") . ' ' . _("on the same date")) ); /* Monthly on same weekday. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY, $on ? ' checked="checked"' : '', _("Monthly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_week_of_month_interval', _("month(s)") . ' ' . _("on the same weekday")) ); /* Yearly on same date. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DATE); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_YEARLY_DATE, $on ? ' checked="checked"' : '', _("Yearly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_yearly_interval', _("year(s) on the same date")) ); /* Yearly on same day of year. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DAY); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_YEARLY_DAY, $on ? ' checked="checked"' : '', _("Yearly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_yearly_day_interval', _("year(s) on the same day of the year")) ); /* Yearly on same week day. */ $on = $recur && $recur->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY); $html .= sprintf( '
%s
%s
', Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY, $on ? ' checked="checked"' : '', _("Yearly: Recurs every"), $on ? $recur->getRecurInterval() : '', Horde::label('recur_yearly_weekday_interval', _("year(s) on the same weekday and month of the year")) ); /* Recurrence end. */ $html .= sprintf( '
%s
%s
', Horde::label('recur_end_type', _("Recur Until")), $recur && ($recur->hasRecurEnd() || $recur->hasRecurCount()) ? '' : ' checked="checked"', Horde::label('recurnoend', _("No end date")), $recur && $recur->hasRecurEnd() ? ' checked="checked"' : '', $recur && $recur->hasRecurEnd() ? $recur->getRecurEnd()->strftime('%x') : '' ); if ($GLOBALS['browser']->hasFeature('javascript')) { Horde_Core_Ui_JsCalendar::init(array( 'full_weekdays' => true )); $GLOBALS['page_output']->addScriptFile('calendar.js'); $html .= '
' . Horde::img('calendar.png', _("Set recurrence end date"), 'id="recur_endimg"'); } $on = $recur && $recur->getRecurCount(); $html .= sprintf( '
%s', $on ? ' checked="checked"' : '', $on ? $recur->getRecurCount() : '', Horde::label('recur_count', _("recurrences")) ); /* Exceptions and completions. */ if ($recur) { foreach ($recur->getExceptions() as $exception) { $html .= sprintf( '
', $exception ); } foreach ($recur->getCompletions() as $completion) { $html .= sprintf( '
', $completion ); } } return $html; } /** * Render the search due date fields */ public function _renderVarInput_NagSearchDue($form, $var, $vars) { $html = sprintf( _("%s %s days of %s"), Horde::label('due_within', _("Is due within")), '
', '
') . '
' . _("E.g., Is due within 2 days of today") . '
'; return $html; } protected function _renderVarInput_NagStart($form, $var, $vars) { $var->type->getInfo($vars, $var, $task_start); $start_dt = ($task_start == 0) // About a week from now ? $_SERVER['REQUEST_TIME'] + 604800 : $task_start; $on = $task_start > 0; /* Set up the radio buttons. */ $html = sprintf( '
%s
%s
%s
', $on ? '' : ' checked="checked"', Horde::label('start_date_none', _("No delay")), $on ? ' checked="checked"' : '', _("Start date specified."), _("Date"), htmlspecialchars(strftime($GLOBALS['prefs']->getValue('date_format_mini'), $start_dt)) ); if ($GLOBALS['browser']->hasFeature('javascript')) { Horde_Core_Ui_JsCalendar::init(array( 'full_weekdays' => true )); $GLOBALS['page_output']->addScriptFile('calendar.js'); $html .= '
' . Horde::img('calendar.png', _("Calendar"), 'id="startimg"'); } return $html; } /** * Render tag field. */ protected function _renderVarInput_NagTags($form, $var, $vars) { $varname = htmlspecialchars($var->getVarName()); $value = htmlspecialchars($var->getValue($vars)); $html = sprintf('
', $varname, $varname, $value); $html .= sprintf('
%s
', $varname, Horde::img('loading.gif', _("Loading..."))); $GLOBALS['injector']->getInstance('Horde_Core_Factory_Imple')->create('Nag_Ajax_Imple_TagAutoCompleter', array('id' => $varname)); return $html; } }