Exemplo n.º 1
0
 public static function buildWeekDaysCheck($reccurweekdays, $args, $name = "reccurweekdays")
 {
     // get array
     $day_name = JEVHelper::getWeekdayLetter(null, 1);
     $day_name[0] = '<span class="sunday">' . $day_name[0] . '</span>';
     $day_name[6] = '<span class="saturday">' . $day_name[6] . '</span>';
     $tosend = '';
     if ($reccurweekdays === '') {
         $split = array();
         $countsplit = 0;
     } else {
         $split = explode('|', $reccurweekdays);
         $countsplit = count($split);
     }
     for ($a = 0; $a < 7; $a++) {
         $checked = '';
         for ($x = 0; $x < $countsplit; $x++) {
             if ($split[$x] == $a) {
                 $checked = ' checked="checked"';
             }
         }
         // bootstrap version
         $tosend .= '' . '<label for="cb_wd' . $a . '" class="checkbox btn">' . '<input type="checkbox" id="cb_wd' . $a . '" name="' . $name . '[]" value="' . $a . '" ' . $args . $checked . ' onclick="updateRepeatWarning();" class="checkbox " />' . $day_name[$a] . '</label>' . "\n";
     }
     echo $tosend;
 }
Exemplo n.º 2
0
 function getAjaxCal($modid = 0, $month, $year)
 {
     // capture module id so that we can use it for ajax type navigation
     if ($modid != 0) {
         $this->_modid = $modid;
     }
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     static $isloaded_css = false;
     // this will get the viewname based on which classes have been implemented
     $cfg =& JEVConfig::getInstance();
     $viewname = ucfirst($cfg->get('com_calViewName', "default"));
     $cfg =& JEVConfig::getInstance();
     // get array
     $day_name = JEVHelper::getWeekdayLetter(null, 1);
     $day_name[0] = '<span class="sunday">' . $day_name[0] . '</span>';
     $day_name[6] = '<span class="saturday">' . $day_name[6] . '</span>';
     $content = "";
     $mod = "";
     if (isset($this->_modid) && $this->_modid > 0) {
         $mod = 'id="modid_' . $this->_modid . '" ';
         $content .= "<span id='testspan" . $this->_modid . "' style='display:none'></span>\n";
     }
     $temptime = JevDate::mktime(12, 0, 0, $month, 15, $year);
     //$content .= $this->_displayCalendarMod($temptime,$this->com_starday, JText::_('JEV_THIS_MONTH'),$day_name, false);
     $thisDayOfMonth = date("j", $temptime);
     $daysLeftInMonth = date("t", $temptime) - date("j", $temptime) + 1;
     // calculate month offset from first of month
     $first_of_current_month = JevDate::strtotime(date('Y-m-01', $temptime));
     $base_year = date("Y", $temptime);
     $base_month = date("m", $temptime);
     $basefirst_of_month = JevDate::mktime(0, 0, 0, $base_month, 1, $base_year);
     if ($this->disp_lastMonth && (!$this->disp_lastMonthDays || $thisDayOfMonth <= $this->disp_lastMonthDays)) {
         $content .= $this->_displayCalendarMod(JevDate::strtotime("-1 month", $first_of_current_month), $this->com_starday, JText::_('JEV_LAST_MONTH'), $day_name, $this->disp_lastMonth == 2, $first_of_current_month);
     }
     $content .= $this->_displayCalendarMod($temptime, $this->com_starday, JText::_('JEV_THIS_MONTH'), $day_name, false, $first_of_current_month);
     if ($this->disp_nextMonth && (!$this->disp_nextMonthDays || $daysLeftInMonth <= $this->disp_nextMonthDays)) {
         $content .= $this->_displayCalendarMod(JevDate::strtotime("+1 month", $first_of_current_month), $this->com_starday, JText::_('JEV_NEXT_MONTH'), $day_name, $this->disp_nextMonth == 2, $first_of_current_month);
     }
     return $content;
 }
Exemplo n.º 3
0
 public static function buildWeekDaysCheck($reccurweekdays, $args, $name = "reccurweekdays")
 {
     // get array
     $day_name = JEVHelper::getWeekdayLetter(null, 1);
     $day_name[0] = '<span class="sunday">' . $day_name[0] . '</span>';
     $day_name[6] = '<span class="saturday">' . $day_name[6] . '</span>';
     $tosend = '';
     if ($reccurweekdays === '') {
         $split = array();
         $countsplit = 0;
     } else {
         $split = explode('|', $reccurweekdays);
         $countsplit = count($split);
     }
     for ($a = 0; $a < 7; $a++) {
         $checked = '';
         for ($x = 0; $x < $countsplit; $x++) {
             if ($split[$x] == $a) {
                 $checked = ' checked="checked"';
             }
         }
         if (JevJoomlaVersion::isCompatible("3.0") || JComponentHelper::getParams(JEV_COM_COMPONENT)->get("useboostrap", 1)) {
             // bootstrap version
             $tosend .= '' . '<input type="checkbox" id="cb_wd' . $a . '" name="' . $name . '[]" value="' . $a . '" ' . $args . $checked . ' onclick="updateRepeatWarning();" class="checkbox btn" />' . '<label for="cb_wd' . $a . '" class="checkbox btn">' . $day_name[$a] . '</label>' . "\n";
         } else {
             $tosend .= '<li  class="r' . ($a % 2 + 1) . '" >' . '<label for="cb_wd' . $a . '">' . '<input type="checkbox" id="cb_wd' . $a . '" name="' . $name . '[]" value="' . $a . '" ' . $args . $checked . ' onclick="updateRepeatWarning();" />&nbsp;' . "\n" . $day_name[$a] . '</label></li>' . "\n";
         }
     }
     if (JevJoomlaVersion::isCompatible("3.0") || JComponentHelper::getParams(JEV_COM_COMPONENT)->get("useboostrap", 1)) {
         echo $tosend;
     } else {
         echo "<ul>\n" . $tosend . "\n</ul>\n";
     }
 }