コード例 #1
0
ファイル: sibdiet.php プロジェクト: smhnaji/sdnet
 /**
  * Show Setdiet Status Checkboxes
  *
  * @param   object   $item   The request item
  *
  * @return  string           HTML code
  */
 public static function setdietStatus($item)
 {
     require_once JPATH_COMPONENT_SITE . '/helpers/route.php';
     $html = array();
     $checked = '<i class="icon-checkbox hasTooltip" title="';
     $unchecked = '<i class="icon-checkbox-unchecked hasTooltip" title="';
     $end = '"></i>';
     for ($i = 1; $i <= 6; $i++) {
         $room = 'room' . $i;
         $room_date = $room . '_date';
         $html[] = $item->{$room} ? $checked . JText::_('COM_SIBDIET_ROOM' . $i) . '<br />' . JFactory::getUser($item->{$room})->name . '<br />' . JHtml::_('date', $item->{$room_date}, JText::_('DATE_FORMAT_LC2')) . $end : $unchecked . JText::_('COM_SIBDIET_ROOM' . $i) . $end;
     }
     if ($item->room1 && $item->room2 && $item->room3 && $item->room4 && $item->room5) {
         $html[] = '<br /><a href="' . SibdietHelperRoute::getRequestRoute($item->id, $item->secretkey) . '" target="_blank">' . JText::_('COM_SIBDIET_PREVIEW_PRINT') . '</a>';
     }
     return implode(' ', $html);
 }
コード例 #2
0
ファイル: icon.php プロジェクト: smhnaji/sdnet
 /**
  * Method to generate a popup link to print an request's diet
  *
  * @param   object     $request  The request information
  * @param   JRegistry  $params   The item parameters
  * @param   array      $attribs  Optional attributes for the link
  *
  * @return  string  The HTML markup for the popup link
  */
 public static function print_popup($request, $params, $attribs = array())
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $request = $input->request;
     $url = SibdietHelperRoute::getDietRoute($request->secretkey);
     $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
     $text = '<span class="icon-print"></span>&#160;' . JText::_('JGLOBAL_PRINT') . '&#160;';
     $attribs['title'] = JText::_('JGLOBAL_PRINT');
     $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
     $attribs['rel'] = 'nofollow';
     return JHtml::_('link', JRoute::_($url), $text, $attribs);
 }
コード例 #3
0
ファイル: view.html.php プロジェクト: smhnaji/sdnet
 public static function setdietStatus($item)
 {
     $html = array();
     $checked = '<i class="icon-check hasTooltip" title="';
     $unchecked = '<i class="icon-stop hasTooltip" title="';
     $end = '"></i>';
     for ($i = 1; $i <= 6; $i++) {
         $room = 'room' . $i;
         $room_date = $room . '_date';
         $html[] = $item->{$room} ? $checked . JText::_('COM_SIBDIET_ROOM' . $i) . $end : $unchecked . JText::_('COM_SIBDIET_ROOM' . $i) . $end;
     }
     $html[] = '<br />';
     if (!$item->room1 && !$item->room2 && !$item->room3 && !$item->room4 && !$item->room5) {
         $html[] = JHtml::_('icon.edit', $item);
     } elseif ($item->room1 && $item->room2 && $item->room3 && $item->room4 && $item->room5) {
         $html[] = '<a href="' . SibdietHelperRoute::getRequestRoute($item->id, $item->secretkey) . '" target="_blank">' . JText::_('COM_SIBDIET_PREVIEW_PRINT') . '</a>';
     }
     return implode(' ', $html);
 }