/** * Gets the backend print window (sem_f038) * * @param int $art - The art * @param int $cid - The cid * @param int $uid - The uid * * @todo fix and update * @return string */ public static function getBackendPrintWindow($art, $cid, $uid = 0) { $search = trim(strtolower(JFactory::getApplication()->input->get('search', '', 'string'))); $limit = trim(JFactory::getApplication()->input->getInt('limit', 5)); $limitstart = trim(JFactory::getApplication()->input->getInt('limitstart', 0)); if (empty($uid)) { $uid = trim(JFactory::getApplication()->input->get('uid', 0)); } $href = JURI::ROOT() . "index.php?tmpl=component&s=" . 0 . "&option=" . JFactory::getApplication()->input->get('option') . "&view=printeventlist&search=" . $search . "&limit=" . $limit . "&limitstart=" . $limitstart . "&cid=" . $cid . "&uid=" . $uid . "&todo="; $x = 550; $y = 300; $image = "1932"; $title = JTEXT::_('COM_MATUKIO_PRINT'); switch ($art) { case 1: // Art 36 $href .= "print_eventlist"; break; case 2: // Teilnehmerliste - 34 $href .= "print_teilnehmerliste&art=1&cid=" . $cid; $image = "1932"; $title = JTEXT::_('COM_MATUKIO_PRINT_SIGNATURE_LIST'); break; case 3: $href .= "certificate&cid=" . $cid; $image = "2900"; $title = JTEXT::_('COM_MATUKIO_PRINT_CERTIFICATE'); break; case 4: // Unterschriftliste $href .= "print_teilnehmerliste&cid=" . $cid; $image = "2032"; $title = JTEXT::_('COM_MATUKIO_PRINT_PARTICIPANTS_LIST'); break; case 5: $href = JURI::ROOT() . "index.php?option=com_matukio&view=printeventlist&format=raw&todo=csvlist&cid=" . $cid; $image = "1632"; $title = JTEXT::_('COM_MATUKIO_DOWNLOAD_CSV_FILE'); break; case 6: // Invoice $href = JURI::ROOT() . "index.php?option=com_matukio&view=printeventlist&format=raw&todo=invoice&cid=" . $cid . "&uid=" . $uid; $image = "invoice"; $title = JTEXT::_('COM_MATUKIO_PRINT_INVOICE'); break; } if ($art != 5 && $art != 6) { $html = "<a title=\"" . $title . "\" class=\"modal cjmodal\" href=\"" . $href . "\" rel=\"{handler: 'iframe', size: {x: " . $x . ", y: " . $y . "}}\">"; } else { $html = "<a title=\"" . $title . "\" href=\"" . $href . "\">"; } $html .= "<img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . $image . ".png\" border=\"0\" valign=\"absmiddle\" alt=\"" . $title . "\" /></a>"; return $html; }
echo MatukioHelperUtilsBasic::printFormStart(1); $knopfoben = ""; $knopfunten = MatukioHelperUtilsEvents::getEventlistHeader($this->art + 1); if ($this->art == 2) { $newlink = JRoute::_("index.php?option=com_matukio&view=createevent"); $knopfoben .= JHTML::_('link', $newlink, JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '1832.png', null, array('border' => '0', 'align' => 'absmiddle')), array('title' => JTEXT::_('COM_MATUKIO_NEW_EVENT'))); $knopfunten .= '<a href="' . $newlink . '">' . "<span class=\"mat_button\" style=\"cursor:pointer;\" \">" . JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '1816.png', null, array('border' => '0', 'align' => 'absmiddle')) . " " . JTEXT::_('COM_MATUKIO_NEW_EVENT') . "</span></a>"; } if (count($this->rows) > 0) { if ($this->art == 0 and MatukioHelperSettings::getSettings('rss_feed', 1) == 1) { $href = JURI::ROOT() . "index.php?tmpl=component&option=" . JFactory::getApplication()->input->get('option') . "&view=rss&format=raw"; $knopfoben .= "<a href=\"" . $href . "\" target=\"_new\" title=\"" . JTEXT::_('COM_MATUKIO_RSS_FEED') . "\" border=\"0\">" . JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '3132.png', null, array('border' => '0', 'align' => 'absmiddle')) . "</a>"; $knopfunten .= " <span class=\"mat_button\" style=\"cursor:pointer;\" type=\"button\" onClick=\"window.open('" . $href . "');\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "3116.png\" border=\"0\" align=\"absmiddle\"> " . JTEXT::_('COM_MATUKIO_RSS_FEED') . "</span>"; } if ($this->art == 0 and MatukioHelperSettings::getSettings('frontend_usericsdownload', 1) == 1) { $href = JURI::ROOT() . "index.php?tmpl=component&option=" . JFactory::getApplication()->input->get('option') . "&view=ics&format=raw"; $knopfoben .= "<a href=\"" . $href . "\" target=\"_new\" title=\"" . JTEXT::_('COM_MATUKIO_DOWNLOAD_CALENDER_FILE') . "\" border=\"0\">" . JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '3316.png', null, array('border' => '0', 'align' => 'absmiddle')) . "</a>"; $knopfunten .= " <span class=\"mat_button\" style=\"cursor:pointer;\" type=\"button\" onClick=\"window.open('" . $href . "');\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "3316.png\" border=\"0\" align=\"absmiddle\"> " . JTEXT::_('COM_MATUKIO_DOWNLOAD_CALENDER_FILE') . "</span>"; } $knopfoben .= MatukioHelperUtilsEvents::getPrintWindow($this->art + 2, '', '', ''); $knopfunten .= " " . MatukioHelperUtilsEvents::getPrintWindow($this->art + 2, '', '', 'b'); } if (MatukioHelperSettings::getSettings('event_buttonposition', 2) == 0 or MatukioHelperSettings::getSettings('event_buttonposition', 2) == 2) { echo $knopfoben; } MatukioHelperUtilsEvents::getEventlistHeaderEnd(); $html = ""; // --------------------- // Anzeige Kategoriekopf // --------------------- $navioben1 = array();
?> " method="post" name="ParticipantsForm" id="ParticipantsForm"> <?php $knopfunten = ""; $zurueck = array(0, 1, 2, 24); $backlink = JRoute::_("index.php?option=com_matukio&"); $knopfoben = "<a title=\"" . JTEXT::_('COM_MATUKIO_BACK') . "\" href=\"javascript:history.go(-1)\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1032.png\" border=\"0\" align=\"absmiddle\"></a>"; if ($this->art > 1) { $knopfoben .= MatukioHelperUtilsEvents::getEmailWindow(MatukioHelperUtilsBasic::getComponentImagePath(), $this->kurs->id, 3); $knopfunten .= " " . MatukioHelperUtilsEvents::getEmailWindow(MatukioHelperUtilsBasic::getComponentImagePath(), $this->kurs->id, 4); } if (count($this->rows) > 0 and $this->art > 1) { $knopfoben .= MatukioHelperUtilsEvents::getPrintWindow(7, $this->kurs->id, '', ''); $knopfoben .= MatukioHelperUtilsEvents::getPrintWindow(5, $this->kurs->id, '', ''); $csvlink = JURI::ROOT() . 'index.php?option=com_matukio&view=printeventlist&format=raw&todo=csvlist&cid=' . $this->kurs->id; $knopfoben .= "<a title=\"" . JTEXT::_('COM_MATUKIO_DOWNLOAD_CSV_FILE') . "\" href=\"" . $csvlink . "\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1632.png\" border=\"0\" align=\"absmiddle\"></a>"; $knopfunten .= " " . MatukioHelperUtilsEvents::getPrintWindow(7, $this->kurs->id, '', 'b'); $knopfunten .= " " . MatukioHelperUtilsEvents::getPrintWindow(5, $this->kurs->id, '', 'b'); $knopfunten .= " <a href=\"" . $csvlink . "\" target=\"_blank\"><span class=\"mat_button\" style=\"cursor:pointer;\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1616.png\" border=\"0\" align=\"absmiddle\"> " . JTEXT::_('COM_MATUKIO_DOWNLOAD_CSV_FILE') . "</span></a>"; } if ($this->art > 1) { $booklink = JRoute::_("index.php?option=com_matukio&view=editbooking&task=new&cid=" . $this->kurs->id); $knopfoben .= "<a title=\"" . JTEXT::_('COM_MATUKIO_BOOK') . "\" href=\"" . $booklink . "\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1132.png\" border=\"0\" align=\"absmiddle\"></a>"; $knopfunten .= " <a href=\"" . $booklink . "\"><span class=\"mat_button\" style=\"cursor:pointer;\"><img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "1116.png\" border=\"0\" align=\"absmiddle\"> " . JTEXT::_('COM_MATUKIO_BOOK') . "</span></a>"; } if (MatukioHelperSettings::getSettings('event_buttonposition', 2) == 0 or MatukioHelperSettings::getSettings('event_buttonposition', 2) == 2) { echo $knopfoben; } // MatukioHelperUtilsEvents::getEventlistHeaderEnd(); echo "<table class=\"table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\" border=\"0\" style=\"border-top: 1px solid #ccc\">" . "<tr><td class=\"sem_anzeige\">";
// Calendar if (MatukioHelperSettings::getSettings('frontend_usericsdownload', 1) > 0) { echo MatukioHelperUtilsEvents::getCalendarButton($this->event, "bootstrap"); } // Contact organizer if (MatukioHelperSettings::getSettings("sendmail_contact", 1)) { echo MatukioHelperUtilsEvents::getEmailWindow(MatukioHelperUtilsBasic::getComponentImagePath(), $this->event->id, 1, "bootstrap"); } // Invoice if (MatukioHelperSettings::getSettings("download_invoice", 1) && ($this->booking->status == 0 || $this->booking->status == 1) && $this->event->fees > 0) { $href = JURI::ROOT() . "index.php?option=com_matukio&view=printeventlist&format=raw&todo=invoice&cid=" . $this->booking->semid . "&uuid=" . $this->booking->uuid; echo " <a border=\"0\" href=\"" . $href . "\" ><span class=\"btn\" type=\"button\">" . JTEXT::_('COM_MATUKIO_DOWNLOAD_INVOICE_BUTTON') . "</span></a>"; } // Ticket if (MatukioHelperSettings::getSettings("download_ticket", 1) && ($this->booking->status == 0 || $this->booking->status == 1)) { $href = JURI::ROOT() . "index.php?option=com_matukio&view=printeventlist&format=raw&todo=ticket&cid=" . $this->booking->semid . "&uuid=" . $this->booking->uuid; echo " <a border=\"0\" href=\"" . $href . "\" ><span class=\"btn\" type=\"button\">" . JTEXT::_('COM_MATUKIO_DOWNLOAD_TICKET_BUTTON') . "</span></a>"; } // Certification if (MatukioHelperSettings::getSettings('frontend_certificatesystem', 0) > 0) { if ($this->booking->certificated == 1 and $this->event->nrbooked > 0) { echo MatukioHelperUtilsEvents::getPrintWindow(1, $this->event->sid, $this->booking->id, 'CERT', 'btn'); } } // Edit booking if (strtotime($this->event->booked) - time() >= MatukioHelperSettings::getSettings('booking_stornotage', 1) * 24 * 60 * 60 && MatukioHelperSettings::getSettings('booking_edit', 1) == 1 && $this->booking->paid == 0 && ($this->booking->status == 0 || $this->booking->status == 1)) { $editbookinglink = JRoute::_("index.php?option=com_matukio&view=bookevent&cid=" . $this->booking->semid . "&uuid=" . $this->booking->uuid); if (MatukioHelperSettings::getSettings('oldbookingform', 0) == 1) { $editbookinglink = JRoute::_(MatukioHelperRoute::getEventRoute($this->event->id, $this->event->catid, 1, $this->booking->id, $this->booking->uuid), false); } echo " <a border=\"0\" href=\"" . $editbookinglink . "\" ><span class=\"btn btn-success\" type=\"button\">" . JTEXT::_('COM_MATUKIO_EDIT_YOUR_BOOKING') . "</span></a>";
/** * Gets the calendar button * * @param object $event - THe event * @param string $template - The template * * @return string */ public static function getCalendarButton($event, $template = "modern") { $config = JFactory::getConfig(); $_suffix = $config->get('sef_suffix'); if ($_suffix == 0) { // No .html suffix $icslink = JRoute::_("index.php?option=com_matukio&tmpl=component&view=ics&format=raw&cid=" . $event->id); } else { $icslink = JURI::ROOT() . "index.php?tmpl=component&option=com_matukio&view=ics&format=raw&cid=" . $event->id; } $btn_class = "mat_button"; if ($template == "bootstrap") { $btn_class = "btn"; } $img = "<img src=\"" . MatukioHelperUtilsBasic::getComponentImagePath() . "3316.png\" border=\"0\" align=\"absmiddle\"> "; if ($template == "bootstrap") { $img = ""; } return " <a title=\"" . JTEXT::_('COM_MATUKIO_DOWNLOAD_CALENDER_FILE') . "\" href=\"" . $icslink . "\" target=\"_BLANK\">" . "<span class=\"" . $btn_class . "\">" . $img . JTEXT::_('COM_MATUKIO_DOWNLOAD_CALENDER_FILE') . "</span></a> "; }
function GetAttachmentLink($folder,$filename,$name,$title = '', $rel = 'nofollow') { return self::GetHrefLink ( JURI::ROOT()."{$folder}/{$filename}", $name, $title, $rel ); }
<?php $jsonarr = json_encode($this->code_arr); if (JVERSION <= '3.0') { echo '<link href="plugins/payment/paymill/paymill/tmpl/paymill.css" rel="stylesheet">'; $urlme = JURI::base() . 'plugins/payment/paymill/paymill/tmpl/ajax_loader.gif'; } else { $urlme = JURI::ROOT() . 'plugins/payment/paymill/paymill/tmpl/ajax_loader.gif'; } ?> <style> .error { padding : 5px; margin : 5px; background-color: #F2DEDE; border-color: #EED3D7; color: #B94A48; } </style> <script type="text/javascript" src="https://bridge.paymill.com/"></script> <script type="text/javascript"> //var PAYMILL_PUBLIC_KEY = '89605609849e508bfa6522883ade2d06'; var PAYMILL_PUBLIC_KEY = '<?php echo $this->params->get('public_key'); ?> '; <?php $testmode = $this->params->get('payment_mode', '1'); if ($testmode == '0') {
/** * sem_f004() * @return mixed */ public static function getSitePath() { return JURI::ROOT(); }
function GetAttachmentLink($folder, $filename, $name, $title = '', $rel = 'nofollow') { return CKunenaLink::GetHrefLink(JURI::ROOT() . $folder . '/' . $filename, $name, $title, $rel); }
/** * @param string $folder * @param string $filename * @param string $name * @param string $title * @param string $rel * * @return string */ protected function _getAttachementLink($folder, $filename, $name, $title = '', $rel = 'nofollow') { $link = JURI::ROOT() . "{$folder}/{$filename}"; return '<a href="' . $link . '" title="' . $title . '" rel="' . $rel . '">' . $name . '</a>'; }
public static function parse_media($id, $layout_id) { $db = JFactory::getDBO(); $helperclass = new guruAdminHelper(); $sql = "SELECT * FROM #__guru_config LIMIT 1"; $db->setQuery($sql); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } $configs = $db->loadObject(); if (!isset($media)) { $media = ""; } $default_size = $configs->default_video_size; $default_width = ""; $default_height = ""; if (trim($default_size) != "") { $default_size = explode("x", $default_size); $default_width = $default_size["1"]; $default_height = $default_size["0"]; } if ($layout_id != 15) { $sql = "SELECT * FROM #__guru_media\r\n\t\t\t\t\t\tWHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); @($the_media->code = stripslashes($the_media->code)); } else { $sql = "SELECT * FROM #__guru_quiz\r\n\t\t\t\t\t\tWHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); $the_media->type = "quiz"; $the_media->code = ""; } $no_plugin_for_code = 0; $aheight = 0; $awidth = 0; $vheight = 0; $vwidth = 0; if (@$the_media->type == 'video') { if ($the_media->source == 'url' || $the_media->source == 'local') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $vheight = 300; $vwidth = 400; } elseif ($the_media->width != 0 && $the_media->height != 0 && $the_media->option_video_size == 1) { $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $vheight = $default_height; $vwidth = $default_width; } } elseif ($the_media->source == 'code') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vwidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $vheight = 300; $vwidth = 400; } } else { $vheight = 300; $vwidth = 400; } } elseif (($the_media->width != 0 || $the_media->height != 0) && $the_media->option_video_size == 1) { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $the_media->width . '"'; $the_media->code = preg_replace('#name="width" value="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $the_media->height . '"'; $the_media->code = preg_replace('#name="height" value="[0-9]+"#', $replace_with, $the_media->code); $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $replace_with = 'width="' . $default_width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $default_height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="width"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="height"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('/name="width" value="[0-9]+"/', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('/name="height" value="[0-9]+"/', $replace_with, $the_media->code); $vheight = $default_height; $vwidth = $default_width; } } } elseif (@$the_media->type == 'audio') { if ($the_media->source == 'url' || $the_media->source == 'local') { if ($the_media->width == 0 || $the_media->height == 0) { $aheight = 20; $awidth = 300; } else { $aheight = $the_media->height; $awidth = $the_media->width; } } elseif ($the_media->source == 'code') { if ($the_media->width == 0 || $the_media->height == 0) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $awidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $aheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $aheight = 20; $awidth = 300; } } else { $aheight = 20; $awidth = 300; } } else { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $aheight = $the_media->height; $awidth = $the_media->width; } } } $parts = explode(".", @$the_media->local); $extension = strtolower($parts[count($parts) - 1]); if (@$the_media->type == 'video' || @$the_media->type == 'audio') { if (@$the_media->type == 'video' && $extension == "avi") { $media = '<object width="' . $vwidth . '" height="' . $vheight . '" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="MediaPlayer1"> <param value="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="fileName"> <param value="true" name="animationatStart"> <param value="true" name="transparentatStart"> <param value="true" name="autoStart"> <param value="true" name="showControls"> <param value="10" name="Volume"> <param value="false" name="autoplay"> <embed width="' . $vwidth . '" height="' . $vheight . '" type="video/x-msvideo" src="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="plugin"> </object>'; /*$media = '<object id="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" width="'.$vwidth.'" height="'.$vheight.'"> <param name="fileName" value="'.JURI::root().$configs->videoin."/".$the_media->local.'"> <param name="animationatStart" value="true"> <param name="transparentatStart" value="true"> <param name="autoStart" value="true"> <param name="showControls" value="true"> <param name="Volume" value="10"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'.JURI::root().$configs->videoin."/".$the_media->local.'" name="MediaPlayer1" width="'.$vwidth.'" height="'.$vheight.'" autostart="1" showcontrols="1" volume="10"> </object>';*/ } elseif ($no_plugin_for_code == 0) { if ($the_media->type == "video" && $the_media->source == "url") { require_once JPATH_ROOT . '/components/com_guru/helpers/videos/helper.php'; $parsedVideoLink = parse_url($the_media->url); preg_match('/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i', $parsedVideoLink['host'], $matches); $domain = $matches['domain']; if (!empty($domain)) { $provider = explode('.', $domain); $providerName = JString::strtolower($provider[0]); if ($providerName == "youtu") { $providerName = "youtube"; } $libraryPath = JPATH_ROOT . '/components/com_guru/helpers/videos' . '/' . $providerName . '.php'; require_once $libraryPath; $className = 'PTableVideo' . JString::ucfirst($providerName); $videoObj = new $className(); $videoObj->init($the_media->url); $video_id = $videoObj->getId(); $videoPlayer = $videoObj->getViewHTML($video_id, $vwidth, $vheight); $media = $videoPlayer; } } else { $media = $helperclass->create_media_using_plugin($the_media, $configs, $awidth, $aheight, $vwidth, $vheight); } } } if (@$the_media->type == 'docs') { $the_base_link = explode('administrator/', $_SERVER['HTTP_REFERER']); $the_base_link = $the_base_link[0]; $media = JText::_('GURU_NO_PREVIEW'); //$media = JText::_("GURU_TASKS"); if ($the_media->source == 'local' && (substr($the_media->local, strlen($the_media->local) - 3, 3) == 'txt' || substr($the_media->local, strlen($the_media->local) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_base_link . '/' . $configs->docsin . '/' . $the_media->local . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } elseif ($the_media->source == 'url' && (substr($the_media->url, strlen($the_media->url) - 3, 3) == 'txt' || substr($the_media->url, strlen($the_media->url) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if ($the_media->source == 'local' && $the_media->width == 1) { $media = '<br /><a href="' . $the_base_link . $configs->docsin . '/' . $the_media->local . '" target="_blank">' . $the_media->name . '</a>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if ($the_media->source == 'url' && $the_media->width == 0) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="100%" height="600" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; } if ($the_media->source == 'url' && $the_media->width == 1) { $media = '<a href="' . $the_media->url . '" target="_blank">' . $the_media->name . '</a>'; } } if (@$the_media->type == 'url') { $src = $the_media->url; $media = '<a href="' . $src . '" target="_blank">' . $src . '</a>'; } if (@$the_media->type == 'Article') { $media = self::getArticleById($the_media->code); } if (@$the_media->type == 'image') { $img_size = @getimagesize(JPATH_SITE . DS . $configs->imagesin . DS . 'media' . DS . 'thumbs' . $the_media->local); //echo "~~~~".var_dump($img_size)."~~~~"; $img_width = $img_size[0]; $img_height = $img_size[1]; if ($img_width > 0 && $img_height > 0) { $thumb_width = 0; $thumb_height = 0; if ($the_media->width > 0) { $thumb_width = $the_media->width; $thumb_height = $img_height / ($img_width / $the_media->width); } elseif ($the_media->height > 0) { $thumb_height = $the_media->height; $thumb_width = $img_width / ($img_height / $the_media->height); } else { $thumb_height = 200; $thumb_width = $img_width / ($img_height / 200); } $media = '<img width="' . $thumb_width . '" height="' . $thumb_height . '" src="' . JURI::root() . DS . $configs->imagesin . '/media/thumbs' . $the_media->local . '" />'; } if (!isset($media)) { $media = NULL; } } if (@$the_media->type == 'quiz') { $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . "components/com_guru/css/quiz.css"); $media = ''; $q = "SELECT * FROM #__guru_quiz WHERE id = " . $the_media->id; $db->setQuery($q); $result_quiz = $db->loadObject(); $media .= '<span class="guru_quiz_title">' . $result_quiz->name . '</span>'; $media .= '<span class="guru_quiz_description">' . $result_quiz->description . '</span>'; if ($result_quiz->is_final == 1) { $sql = "SELECT \tquizzes_ids FROM #__guru_quizzes_final WHERE qid=" . $the_media->id; $db->setQuery($sql); $db->query(); $result = $db->loadResult(); $result_qids = explode(",", trim($result, ",")); if (count($result_qids) || ($result_qids["0"] = "")) { $result_qids["0"] = 0; } $q = "SELECT * FROM #__guru_questions_v3 WHERE qid IN (" . implode(",", $result_qids) . ") and published=1 "; } else { $q = "SELECT * FROM #__guru_questions_v3 WHERE qid = " . $the_media->id . " and published=1"; } $db->setQuery($q); $quiz_questions = $db->loadObjectList(); $media = $media . '<div id="the_quiz">'; $question_number = 1; for ($i = 0; $i < count($quiz_questions); $i++) { $question_answers_number = 0; $media_associated_question = json_decode($quiz_questions[$i]->media_ids); $media_content = ""; $result_media = array(); $q = "SELECT * FROM #__guru_question_answers WHERE question_id = " . intval($quiz_questions[$i]->id) . " ORDER BY id"; $db->setQuery($q); $question_answers = $db->loadObjectList(); for ($j = 0; $j < count($media_associated_question); $j++) { @($media_that_needs_to_be_sent = self::getMediaFromId($media_associated_question[$j])); if (isset($media_that_needs_to_be_sent) && count($media_that_needs_to_be_sent) > 0) { $result_media[] = $helperclass->create_media_using_plugin($media_that_needs_to_be_sent["0"], $configs, '', '', '100px', 100); } } $media .= '<div style="width:100%; clear:both;">'; $media .= ' <div style="width:50%; float:left;">'; $media .= $quiz_questions[$i]->question_content . "<br/>" . implode("", $result_media); $media .= ' </div>'; $media .= '<div style="width:50%; float:left;">'; if ($quiz_questions[$i]->type == "true_false") { $media .= ' <div> <div class="pull-left"> <input type="radio" name="truefs_ans" value="0" /> <span class="lbl"></span> </div> <div class="pull-left"> ' . JText::_("GURU_QUESTION_OPTION_TRUE") . ' </div> <div class="pull-left"> <input type="radio" name="truefs_ans" value="1" /> <span class="lbl"></span> </div> <div class="pull-left"> ' . JText::_("GURU_QUESTION_OPTION_FALSE") . ' </div> </div>'; } elseif ($quiz_questions[$i]->type == "single") { if (isset($question_answers) && count($question_answers) > 0) { foreach ($question_answers as $question_answer) { $media_associated_answers = json_decode($question_answer->media_ids); $media_content = ""; $result_media_answers = array(); if (isset($media_associated_answers) && count($media_associated_answers) > 0) { foreach ($media_associated_answers as $media_key => $answer_media_id) { $media_that_needs_to_be_sent = self::getMediaFromId($answer_media_id); if (isset($media_that_needs_to_be_sent) && count($media_that_needs_to_be_sent) > 0) { if ($media_that_needs_to_be_sent["0"]->type == "text") { $result_media_answers[] = self::parse_txt($media_that_needs_to_be_sent["0"]->id); } else { $result_media_answers[] = self::parse_media($media_that_needs_to_be_sent["0"]->id, 0); } } } } $option_value = '<input type="radio" id="ans' . $question_answer->id . '" name="answers_single" value="' . $question_answer->id . '"/><span class="lbl"></span> ' . $question_answer->answer_content_text . '<br/>' . implode("<br/><br/>", $result_media_answers) . "<br/>"; $media .= $option_value; } } } elseif ($quiz_questions[$i]->type == "multiple") { if (isset($question_answers) && count($question_answers) > 0) { foreach ($question_answers as $question_answer) { $media_associated_answers = json_decode($question_answer->media_ids); $media_content = ""; $result_media_answers = array(); if (isset($media_associated_answers) && count($media_associated_answers) > 0) { foreach ($media_associated_answers as $media_key => $answer_media_id) { $media_that_needs_to_be_sent = self::getMediaFromId($answer_media_id); if (isset($media_that_needs_to_be_sent) && count($media_that_needs_to_be_sent) > 0) { if ($media_that_needs_to_be_sent["0"]->type == "text") { $result_media_answers[] = self::parse_txt($media_that_needs_to_be_sent["0"]->id); } else { $result_media_answers[] = self::parse_media($media_that_needs_to_be_sent["0"]->id, 0); } } } } $option_value = '<input type="checkbox" value="' . $question_answer->id . '"/> ' . $question_answer->answer_content_text . '<br/>' . implode("", $result_media_answers) . "<br/>"; $media .= $option_value; } } } $media .= '</div>'; $media .= '</div>'; } $media = $media . '<input type="hidden" value="' . ($question_number - 1) . '" name="question_number" id="question_number" />'; $media = $media . '<input type="hidden" value="' . $result_quiz->name . '" id="quize_name" name="quize_name"/>'; //$media = $media.'<br /><div align="left" style="clear:both;"><input type="submit" class ="btn" value="Submit" onclick="get_quiz_result()" /></div>'; $media = $media . '</div>'; } if (@$the_media->type == "file") { $media = '<a target="_blank" href="' . JURI::ROOT() . $configs->filesin . '/' . $the_media->local . '">' . $the_media->name . '</a><br/><br/>' . $the_media->instructions; } return stripslashes($media); }
/** * Create the css properties * @param JRegistry $params * @param string $prefix the xml field prefix * * @return Array */ static function createCss($menuID, $params, $prefix = 'menu', $important = false, $itemid = '', $use_svggradient = true) { $css = array(); $important = $important == true ? ' !important' : ''; $csspaddingtop = $params->get($prefix . 'paddingtop') != '' ? 'padding-top: ' . self::testUnit($params->get($prefix . 'paddingtop', '0')) . $important . ';' : ''; $csspaddingright = $params->get($prefix . 'paddingright') != '' ? 'padding-right: ' . self::testUnit($params->get($prefix . 'paddingright', '0')) . $important . ';' : ''; $csspaddingbottom = $params->get($prefix . 'paddingbottom') != '' ? 'padding-bottom: ' . self::testUnit($params->get($prefix . 'paddingbottom', '0')) . $important . ';' : ''; $csspaddingleft = $params->get($prefix . 'paddingleft') != '' ? 'padding-left: ' . self::testUnit($params->get($prefix . 'paddingleft', '0')) . $important . ';' : ''; $css['padding'] = $csspaddingtop . $csspaddingright . $csspaddingbottom . $csspaddingleft; $cssmargintop = $params->get($prefix . 'margintop') != '' ? 'margin-top: ' . self::testUnit($params->get($prefix . 'margintop', '0')) . $important . ';' : ''; $cssmarginright = $params->get($prefix . 'marginright') != '' ? 'margin-right: ' . self::testUnit($params->get($prefix . 'marginright', '0')) . $important . ';' : ''; $cssmarginbottom = $params->get($prefix . 'marginbottom') != '' ? 'margin-bottom: ' . self::testUnit($params->get($prefix . 'marginbottom', '0')) . $important . ';' : ''; $cssmarginleft = $params->get($prefix . 'marginleft') != '' ? 'margin-left: ' . self::testUnit($params->get($prefix . 'marginleft', '0')) . $important . ';' : ''; $css['margin'] = $cssmargintop . $cssmarginright . $cssmarginbottom . $cssmarginleft; $bgcolor1 = $params->get($prefix . 'bgcolor1') && $params->get($prefix . 'bgopacity') !== null && $params->get($prefix . 'bgopacity') !== '' ? self::hex2RGB($params->get($prefix . 'bgcolor1'), $params->get($prefix . 'bgopacity')) : $params->get($prefix . 'bgcolor1'); $css['background'] = $params->get($prefix . 'bgcolor1') ? 'background: ' . $bgcolor1 . $important . ';' : ''; $css['background'] .= $params->get($prefix . 'bgcolor1') ? 'background-color: ' . $bgcolor1 . $important . ';' : ''; $css['background'] .= $params->get($prefix . 'bgimage') ? 'background-image: url("' . JURI::ROOT() . $params->get($prefix . 'bgimage') . '")' . $important . ';' : ''; $css['background'] .= $params->get($prefix . 'bgimage') ? 'background-repeat: ' . $params->get($prefix . 'bgimagerepeat') . $important . ';' : ''; $css['background'] .= $params->get($prefix . 'bgimage') ? 'background-position: ' . $params->get($prefix . 'bgpositionx') . ' ' . $params->get($prefix . 'bgpositiony') . $important . ';' : ''; $bgcolor2 = $params->get($prefix . 'bgcolor2') && $params->get($prefix . 'bgopacity') && $params->get($prefix . 'bgopacity') !== '' ? self::hex2RGB($params->get($prefix . 'bgcolor2'), $params->get($prefix . 'bgopacity')) : $params->get($prefix . 'bgcolor2'); // manage gradient svg for ie9 $svggradient = ''; if ($use_svggradient) { $svggradientfile = ''; if ($css['background'] and $params->get($prefix . 'bgcolor2')) { $svggradientfile = self::createSvgGradient($menuID, $prefix . $itemid, $params->get($prefix . 'bgcolor1', ''), $params->get($prefix . 'bgcolor2', '')); } $svggradient = $svggradientfile ? "background-image: url(\"" . $svggradientfile . "\")" . $important . ";" : ""; } $css['gradient'] = ($css['background'] and $params->get($prefix . 'bgcolor2')) ? $svggradient . "background: -moz-linear-gradient(top, " . $bgcolor1 . " 0%, " . $bgcolor2 . " 100%)" . $important . ";" . "background: -webkit-gradient(linear, left top, left bottom, color-stop(0%," . $bgcolor1 . "), color-stop(100%," . $bgcolor2 . "))" . $important . "; " . "background: -webkit-linear-gradient(top, " . $bgcolor1 . " 0%," . $bgcolor2 . " 100%)" . $important . ";" . "background: -o-linear-gradient(top, " . $bgcolor1 . " 0%," . $bgcolor2 . " 100%)" . $important . ";" . "background: -ms-linear-gradient(top, " . $bgcolor1 . " 0%," . $bgcolor2 . " 100%)" . $important . ";" . "background: linear-gradient(top, " . $bgcolor1 . " 0%," . $bgcolor2 . " 100%)" . $important . "; " : ''; // . "filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='" . $params->get($prefix . 'bgcolor1', '#f0f0f0') . "', endColorstr='" . $params->get($prefix . 'bgcolor2', '#e3e3e3') . "',GradientType=0 );" : ''; $css['borderradius'] = $params->get($prefix . 'roundedcornerstl', '') != '' || $params->get($prefix . 'roundedcornerstr', '') != '' || $params->get($prefix . 'roundedcornersbr', '') != '' || $params->get($prefix . 'roundedcornersbl', '') != '' ? '-moz-border-radius: ' . self::testUnit($params->get($prefix . 'roundedcornerstl', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornerstr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbl', '0')) . $important . ';' . '-webkit-border-radius: ' . self::testUnit($params->get($prefix . 'roundedcornerstl', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornerstr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbl', '0')) . $important . ';' . 'border-radius: ' . self::testUnit($params->get($prefix . 'roundedcornerstl', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornerstr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbr', '0')) . ' ' . self::testUnit($params->get($prefix . 'roundedcornersbl', '0')) . $important . ';' : ''; $shadowinset = $params->get($prefix . 'shadowinset', 0) ? 'inset ' : ''; $css['shadow'] = ($params->get($prefix . 'shadowcolor') and $params->get($prefix . 'shadowblur') != '') ? '-moz-box-shadow: ' . $shadowinset . self::testUnit($params->get($prefix . 'shadowoffsetx', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowoffsety', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowblur', '')) . ' ' . self::testUnit($params->get($prefix . 'shadowspread', '0')) . ' ' . $params->get($prefix . 'shadowcolor', '') . $important . ';' . '-webkit-box-shadow: ' . $shadowinset . self::testUnit($params->get($prefix . 'shadowoffsetx', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowoffsety', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowblur', '')) . ' ' . self::testUnit($params->get($prefix . 'shadowspread', '0')) . ' ' . $params->get($prefix . 'shadowcolor', '') . $important . ';' . 'box-shadow: ' . $shadowinset . self::testUnit($params->get($prefix . 'shadowoffsetx', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowoffsety', '0')) . ' ' . self::testUnit($params->get($prefix . 'shadowblur', '')) . ' ' . self::testUnit($params->get($prefix . 'shadowspread', '0')) . ' ' . $params->get($prefix . 'shadowcolor', '') . $important . ';' : ($params->get($prefix . 'useshadow') && $params->get($prefix . 'shadowblur') == '0' ? '-moz-box-shadow: none' . $important . ';' . '-webkit-box-shadow: none' . $important . ';' . 'box-shadow: none' . $important . ';' : ''); $borderstyle = $params->get($prefix . 'borderstyle', 'solid') ? $params->get($prefix . 'borderstyle', 'solid') : 'solid'; $css['border'] = ($params->get($prefix . 'bordertopwidth') == '0' ? 'border-top: none' . $important . ';' : (($params->get($prefix . 'bordertopwidth') != '' and $params->get($prefix . 'bordercolor')) ? 'border-top: ' . $params->get($prefix . 'bordercolor', '') . ' ' . self::testUnit($params->get($prefix . 'bordertopwidth', '')) . ' ' . $borderstyle . ' ' . $important . ';' : '')) . ($params->get($prefix . 'borderrightwidth') == '0' ? 'border-right: none' . $important . ';' : (($params->get($prefix . 'borderrightwidth') != '' and $params->get($prefix . 'bordercolor')) ? 'border-right: ' . $params->get($prefix . 'bordercolor', '') . ' ' . self::testUnit($params->get($prefix . 'borderrightwidth', '')) . ' ' . $borderstyle . ' ' . $important . ';' : '')) . ($params->get($prefix . 'borderbottomwidth') == '0' ? 'border-bottom: none' . $important . ';' : (($params->get($prefix . 'borderbottomwidth') != '' and $params->get($prefix . 'bordercolor')) ? 'border-bottom: ' . $params->get($prefix . 'bordercolor', '') . ' ' . self::testUnit($params->get($prefix . 'borderbottomwidth', '')) . ' ' . $borderstyle . ' ' . $important . ';' : '')) . ($params->get($prefix . 'borderleftwidth') == '0' ? 'border-left: none' . $important . ';' : (($params->get($prefix . 'borderleftwidth') != '' and $params->get($prefix . 'bordercolor')) ? 'border-left: ' . $params->get($prefix . 'bordercolor', '') . ' ' . self::testUnit($params->get($prefix . 'borderleftwidth', '')) . ' ' . $borderstyle . ' ' . $important . ';' : '')); $css['fontsize'] = $params->get($prefix . 'fontsize') != '' ? 'font-size: ' . self::testUnit($params->get($prefix . 'fontsize')) . $important . ';' : ''; $css['fontcolor'] = $params->get($prefix . 'fontcolor') != '' ? 'color: ' . $params->get($prefix . 'fontcolor') . $important . ';' : ''; $css['fontweight'] = $params->get($prefix . 'fontweight') == 'bold' ? 'font-weight: ' . $params->get($prefix . 'fontweight') . $important . ';' : ''; /* $css['fontcolorhover'] = ($params->get($prefix . 'usefont') AND $params->get($prefix . 'fontcolorhover')) ? 'color: ' . $params->get($prefix . 'fontcolorhover') . ';' : ''; */ $css['descfontsize'] = $params->get($prefix . 'descfontsize') != '' ? 'font-size: ' . self::testUnit($params->get($prefix . 'descfontsize')) . $important . ';' : ''; $css['descfontcolor'] = $params->get($prefix . 'descfontcolor') != '' ? 'color: ' . $params->get($prefix . 'descfontcolor') . $important . ';' : ''; $textshadowoffsetx = $params->get($prefix . 'textshadowoffsetx', '0') == '' ? '0px' : self::testUnit($params->get($prefix . 'textshadowoffsetx', '0')); $textshadowoffsety = $params->get($prefix . 'textshadowoffsety', '0') == '' ? '0px' : self::testUnit($params->get($prefix . 'textshadowoffsety', '0')); $css['textshadow'] = ($params->get($prefix . 'textshadowcolor') and $params->get($prefix . 'textshadowblur')) ? 'text-shadow: ' . $textshadowoffsetx . ' ' . $textshadowoffsety . ' ' . self::testUnit($params->get($prefix . 'textshadowblur', '')) . ' ' . $params->get($prefix . 'textshadowcolor', '') . $important . ';' : ($params->get($prefix . 'textshadowblur') == '0' ? 'text-shadow: none' . $important . ';' : ''); $css['text-align'] = $params->get($prefix . 'textalign') ? 'text-align: ' . $params->get($prefix . 'textalign') . $important . ';' : ''; ''; $css['text-transform'] = $params->get($prefix . 'texttransform') && $params->get($prefix . 'texttransform') != 'default' ? 'text-transform: ' . $params->get($prefix . 'texttransform') . $important . ';' : ''; ''; $css['text-indent'] = $params->get($prefix . 'textindent') && $params->get($prefix . 'textindent') != 'default' ? 'text-indent: ' . self::testUnit($params->get($prefix . 'textindent')) . $important . ';' : ''; ''; $css['line-height'] = $params->get($prefix . 'lineheight') && $params->get($prefix . 'lineheight') != 'default' ? 'line-height: ' . self::testUnit($params->get($prefix . 'lineheight')) . $important . ';' : ''; ''; $css['height'] = $params->get($prefix . 'height') && $params->get($prefix . 'height') != '' ? 'height: ' . self::testUnit($params->get($prefix . 'height')) . $important . ';' : ''; ''; $css['width'] = $params->get($prefix . 'width') && $params->get($prefix . 'width') != '' ? 'width: ' . self::testUnit($params->get($prefix . 'width')) . $important . ';' : ''; ''; self::retrocompatibility_beforev8($css, $params, $prefix); return $css; }
public function renderImageList($params, $item, $stit = '', $ftit = '', $directory = 'com_users', $filename = 'users', $section = 'categories', $fieldname = 'image', $watermark = 0, $imagelink = '', $clicklink = '') { $o = ''; if (is_array($item)) { $imgobject = $item[$fieldname]; } else { $imgobject = $item->{$fieldname}; } if ($imgobject) { if ($imagelink) { $imagefile = $imagelink; $imagedisp = $imagelink; $exists = KissGeneralHelper::url_exists($imagefile); } else { $img_base = basename($imgobject); $imagefile = JPATH_ROOT . DS . "media" . DS . $filename . DS . "images" . DS . $section . DS . $imgobject; $imagedisp = JRoute::_(str_replace(JPATH_ROOT . DS, JURI::ROOT(), $imagefile)); $imagelink = JRoute::_(str_replace(JPATH_ROOT . DS, JURI::ROOT(), $imagefile)); $exists = file_exists($imagefile); } if ($exists) { $img_base = basename($item->{$fieldname}); if ($watermark) { if (self::getWatermarkImage($item, $directory, $filename)) { $path_parts = pathinfo($item->{$fieldname}); $file_name = $path_parts['filename']; $file_ext = $path_parts['extension']; $img_base = 'thumbnails' . DS . 'stamp_' . $file_name . '.' . $file_ext; } } $width = $params->get('catlist_img_preview_size', 80); $imagedata = getimagesize($imagefile); $width1 = $imagedata[0] + 20 < $params->get('img_maxwidth', 600) ? $imagedata[0] + 20 : $params->get('img_maxwidth', 600); $height1 = $imagedata[1] + 20 < $params->get('img_maxheight', 400) ? $imagedata[1] + 20 : $params->get('img_maxheight', 400); $lbsize = $width1 < 300 ? '-small' : '-large'; // Show image or edit ad upon image click switch ($params->get('behavior_img_click', 1)) { case 0: $o .= "<img name=\"compimg\" class=\"compimg\" width=\"{$width}\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; break; case 1: default: if (version_compare(JVERSION, '3.0', 'ge')) { if (!$params->get('save_delay', 0)) { $simg = "<div><img src=\\'{$imagelink}\\' width=\\'{$width1}\\' /></div><div>{$ftit}</div>"; $o .= '<a href=\'#\' data-toggle=\'modal\' data-target=\'#lightbox' . $lbsize . '\' onclick="javascript:document.getElementById(\'lightboxbody' . $lbsize . '\').innerHTML=\'' . $simg . '\';document.getElementById(\'modalTitle' . $lbsize . '\').innerHTML=\'' . $stit . '\';" >'; $o .= "<img name=\"compimg\" title=\"" . JText::_('KISS_CONFIG_SHOWORIGINAL_LABEL') . "\" width=\"{$width}\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; } else { $o .= "<a class=\"modal\" href='{$imagelink}' rel=\"{handler: 'iframe', size: {x: {$width1}, y: {$height1}}}\">"; $o .= "<img name=\"compimg\" title=\"" . JText::_('KISS_CONFIG_SHOWORIGINAL_LABEL') . "\" class=\"compimg\" width=\"{$width}\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; } } else { if (version_compare(JVERSION, '2.5', 'ge')) { $o .= "<a class=\"modal\" href='{$imagelink}' rel=\"{handler: 'iframe', size: {x: {$width1}, y: {$height1}}}\">"; $o .= "<img name=\"compimg\" title=\"" . JText::_('KISS_CONFIG_SHOWORIGINAL_LABEL') . "\" class=\"compimg\" width=\"{$width}\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; } } $o .= "</a>"; break; case 2: $o .= "<a href='{$clicklink}'>"; $o .= "<img name=\"compimg\" title=\"" . JText::_('KISS_CONFIG_SHOWDETAILS_LABEL') . "\" class=\"compimg\" width=\"{$width}\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; $o .= "</a>"; break; } } else { $img_base = 'no_image.jpg'; $imagename = JPATH_ROOT . DS . "media" . DS . KISS_COMPONENT_FILE . DS . "images" . DS . $img_base; $imagedisp = JRoute::_(str_replace(JPATH_ROOT . DS, JURI::ROOT(), $imagename)); if (file_exists($imagename)) { $o .= "<img name=\"compimg\" class=\"compimg\" width=\"{$width}\" title=\"" . JText::_('KISS_GENERAL_NO_IMAGE_AVAILABLE') . "\" src=\"{$imagedisp}\" border=\"0\" valign=\"top\"/>"; } } } return $o; }
function _get($attachments) { $ret = array(); foreach ($attachments as $attachment) { // combine all images into one type $attachment->shorttype = $this->isImage($attachment->filetype) ? 'image' : $attachment->filetype; $attachment->shortname = CKunenaTools::shortenFileName($attachment->filename); switch (strtolower($attachment->shorttype)) { case 'image': // Check for thumbnail and if available, use for display if (file_exists(JPATH_ROOT . '/' . $attachment->folder . '/thumb/' . $attachment->filename)) { $thumb = $attachment->folder . '/thumb/' . $attachment->filename; $imgsize = ''; } else { $thumb = $attachment->folder . '/' . $attachment->filename; $imgsize = 'width="' . $this->_config->thumbwidth . 'px" height="' . $this->_config->thumbheight . 'px"'; } $img = '<img title="' . $this->escape($attachment->filename) . '" ' . $imgsize . ' src="' . JURI::ROOT() . $thumb . '" alt="' . $this->escape($attachment->filename) . '" />'; $attachment->thumblink = CKunenaLink::GetAttachmentLink($this->escape($attachment->folder), $this->escape($attachment->filename), $img, $this->escape($attachment->filename), $this->_config->lightbox ? 'lightbox[thumb' . intval($attachment->mesid) . ']' : ''); $img = '<img title="' . $this->escape($attachment->filename) . '" src="' . JURI::ROOT() . $this->escape($attachment->folder) . '/' . $this->escape($attachment->filename) . '" alt="' . $this->escape($attachment->filename) . '" />'; $attachment->imagelink = CKunenaLink::GetAttachmentLink($this->escape($attachment->folder), $this->escape($attachment->filename), $img, $this->escape($attachment->filename), $this->_config->lightbox ? 'lightbox[imagelink' . intval($attachment->mesid) . ']' : ''); $attachment->textLink = CKunenaLink::GetAttachmentLink($this->escape($attachment->folder), $this->escape($attachment->filename), $this->escape($attachment->shortname), $this->escape($attachment->filename), $this->_config->lightbox ? 'lightbox[simple' . $attachment->mesid . ']' . ' nofollow' : ' nofollow') . ' (' . number_format(intval($attachment->size) / 1024, 0, '', ',') . 'KB)'; break; default: // Filetype without thumbnail or icon support - use default file icon $img = '<img src="' . KUNENA_URLICONSPATH . 'attach_generic.png" alt="' . JText::_('COM_KUNENA_ATTACH') . '" />'; $attachment->thumblink = CKunenaLink::GetAttachmentLink($this->escape($attachment->folder), $this->escape($attachment->filename), $img, $this->escape($attachment->filename), 'nofollow'); $attachment->textLink = CKunenaLink::GetAttachmentLink($this->escape($attachment->folder), $this->escape($attachment->filename), $this->escape($attachment->shortname), $this->escape($attachment->filename), 'nofollow') . ' (' . number_format(intval($attachment->size) / 1024, 0, '', ',') . 'KB)'; } $attachment->disabled = false; if (!$this->_my->id) { if ($attachment->shorttype == 'image' && !$this->_config->showimgforguest) { $attachment->disabled = true; $attachment->textLink = JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEIMG'); } if ($attachment->shorttype != 'image' && !$this->_config->showfileforguest) { $attachment->disabled = true; $attachment->textLink = JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEFILE'); } if ($attachment->disabled) { $attachment->thumblink = '<img src="' . KUNENA_URLICONSPATH . 'attach_generic.png" alt="' . JText::_('COM_KUNENA_ATTACH') . '" />'; unset($attachment->imagelink); $attachment->size = 0; } } $this->_instances[$attachment->id] = $attachment; $ret[$attachment->mesid][$attachment->id] = $attachment; } return $ret; }
function parse_media($id, $layout_id) { $db = JFactory::getDBO(); $sql = "SELECT * FROM #__guru_config LIMIT 1"; $db->setQuery($sql); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } $configs = $db->loadObject(); if (!isset($media)) { $media = ""; } $default_size = $configs->default_video_size; $default_width = ""; $default_height = ""; if (trim($default_size) != "") { $default_size = explode("x", $default_size); $default_width = $default_size["1"]; $default_height = $default_size["0"]; } if ($layout_id != 15) { $sql = "SELECT * FROM #__guru_media WHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); @($the_media->code = stripslashes($the_media->code)); } else { $sql = "SELECT * FROM #__guru_quiz\r\n\t\t\t\t\t\tWHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); $the_media->type = "quiz"; $the_media->code = ""; } $no_plugin_for_code = 0; $aheight = 0; $awidth = 0; $vheight = 0; $vwidth = 0; if (@$the_media->type == 'video') { if ($the_media->source == 'url' || $the_media->source == 'local') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $vheight = 300; $vwidth = 400; } elseif ($the_media->width != 0 && $the_media->height != 0 && $the_media->option_video_size == 1) { $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $vheight = $default_height; $vwidth = $default_width; } } elseif ($the_media->source == 'code') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vwidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $vheight = 300; $vwidth = 400; } } else { $vheight = 300; $vwidth = 400; } } elseif (($the_media->width != 0 || $the_media->height != 0) && $the_media->option_video_size == 1) { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $the_media->width . '"'; $the_media->code = preg_replace('#name="width" value="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $the_media->height . '"'; $the_media->code = preg_replace('#name="height" value="[0-9]+"#', $replace_with, $the_media->code); $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $replace_with = 'width="' . $default_width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $default_height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="width"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="height"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('/name="width" value="[0-9]+"/', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('/name="height" value="[0-9]+"/', $replace_with, $the_media->code); $vheight = $default_height; $vwidth = $default_width; } } } elseif (@$the_media->type == 'audio') { if ($the_media->source == 'url' || $the_media->source == 'local') { if ($the_media->width == 0 || $the_media->height == 0) { $aheight = 20; $awidth = 300; } else { $aheight = $the_media->height; $awidth = $the_media->width; } } elseif ($the_media->source == 'code') { if ($the_media->width == 0 || $the_media->height == 0) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $awidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $aheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $aheight = 20; $awidth = 300; } } else { $aheight = 20; $awidth = 300; } } else { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $aheight = $the_media->height; $awidth = $the_media->width; } } } $parts = explode(".", @$the_media->local); $extension = strtolower($parts[count($parts) - 1]); if (@$the_media->type == 'video' || @$the_media->type == 'audio') { if ($the_media->type == 'video' && $extension == "avi") { $media = '<object width="' . $vwidth . '" height="' . $vheight . '" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="MediaPlayer1"> <param value="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="fileName"> <param value="true" name="animationatStart"> <param value="true" name="transparentatStart"> <param value="true" name="autoStart"> <param value="true" name="showControls"> <param value="10" name="Volume"> <param value="false" name="autoplay"> <embed width="' . $vwidth . '" height="' . $vheight . '" type="video/x-msvideo" src="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="plugin"> </object>'; } elseif ($no_plugin_for_code == 0) { $helper = new guruHelper(); $media = $helper->create_media_using_plugin($the_media, $configs, $awidth, $aheight, $vwidth, $vheight); } } if (@$the_media->type == 'docs') { $the_base_link = JURI::root(); $media = JText::_('GURU_NO_PREVIEW'); //$media = JText::_("GURU_TASKS"); if ($the_media->source == 'local' && (substr($the_media->local, strlen($the_media->local) - 3, 3) == 'txt' || substr($the_media->local, strlen($the_media->local) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_base_link . '/' . $configs->docsin . '/' . $the_media->local . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } elseif (@$the_media->source == 'url' && (substr($the_media->url, strlen($the_media->url) - 3, 3) == 'txt' || substr($the_media->url, strlen($the_media->url) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if (@$the_media->source == 'local' && $the_media->width == 1) { $media = '<br /><a href="' . $the_base_link . $configs->docsin . '/' . $the_media->local . '" target="_blank">' . $the_media->name . '</a>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if ($the_media->source == 'url' && $the_media->width == 0) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="100%" height="600" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; } if (@$the_media->source == 'url' && $the_media->width == 1) { $media = '<a href="' . $the_media->url . '" target="_blank">' . $the_media->name . '</a>'; } } if (@$the_media->type == 'url') { $src = $the_media->url; $media = '<a href="' . $src . '" target="_blank">' . $src . '</a>'; } if (@$the_media->type == 'Article') { $media = self::getArticleById($the_media->code); } if (@$the_media->type == 'image') { $img_size = @getimagesize(JPATH_SITE . DS . $configs->imagesin . DS . 'media' . DS . 'thumbs' . $the_media->local); //echo "~~~~".var_dump($img_size)."~~~~"; $img_width = $img_size[0]; $img_height = $img_size[1]; if ($img_width > 0 && $img_height > 0) { $thumb_width = 0; $thumb_height = 0; if ($the_media->width > 0) { $thumb_width = $the_media->width; $thumb_height = $img_height / ($img_width / $the_media->width); } elseif ($the_media->height > 0) { $thumb_height = $the_media->height; $thumb_width = $img_width / ($img_height / $the_media->height); } else { $thumb_height = 200; $thumb_width = $img_width / ($img_height / 200); } $media = '<img width="' . $thumb_width . '" height="' . $thumb_height . '" src="' . JURI::root() . DS . $configs->imagesin . '/media/thumbs' . $the_media->local . '" />'; } if (!isset($media)) { $media = NULL; } } if (@$the_media->type == 'quiz') { $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . "components/com_guru/css/quiz.css"); include_once JPATH_SITE . DS . "components" . DS . "com_guru" . DS . "models" . DS . "gurutask.php"; $quiz_content = guruModelguruTask::parse_media(intval($the_media->id), 12); $media = $quiz_content; } if (@$the_media->type == "file") { $media = '<a target="_blank" href="' . JURI::ROOT() . $configs->filesin . '/' . $the_media->local . '">' . $the_media->name . '</a><br/><br/>' . $the_media->instructions; } return stripslashes($media); }
public static function parse_media($id, $layout_id) { $db = JFactory::getDBO(); $helperclass = new guruAdminHelper(); $sql = "SELECT * FROM #__guru_config LIMIT 1"; $db->setQuery($sql); if (!$db->query()) { $this->setError($db->getErrorMsg()); return false; } $configs = $db->loadObject(); if (!isset($media)) { $media = ""; } $default_size = $configs->default_video_size; $default_width = ""; $default_height = ""; if (trim($default_size) != "") { $default_size = explode("x", $default_size); $default_width = $default_size["1"]; $default_height = $default_size["0"]; } if ($layout_id != 15) { $sql = "SELECT * FROM #__guru_media\r\n\t\t\t\t\t\tWHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); $the_media->code = stripslashes($the_media->code); } else { $sql = "SELECT * FROM #__guru_quiz\r\n\t\t\t\t\t\tWHERE id = " . $id; $db->setQuery($sql); $db->query(); $the_media = $db->loadObject(); $the_media->type = "quiz"; $the_media->code = ""; } $no_plugin_for_code = 0; $aheight = 0; $awidth = 0; $vheight = 0; $vwidth = 0; if ($the_media->type == 'video') { if ($the_media->source == 'url' || $the_media->source == 'local') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $vheight = 300; $vwidth = 400; } elseif ($the_media->width != 0 && $the_media->height != 0 && $the_media->option_video_size == 1) { $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $vheight = $default_height; $vwidth = $default_width; } } elseif ($the_media->source == 'code') { if (($the_media->width == 0 || $the_media->height == 0) && $the_media->option_video_size == 1) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vwidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $vheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $vheight = 300; $vwidth = 400; } } else { $vheight = 300; $vwidth = 400; } } elseif (($the_media->width != 0 || $the_media->height != 0) && $the_media->option_video_size == 1) { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $the_media->width . '"'; $the_media->code = preg_replace('#name="width" value="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $the_media->height . '"'; $the_media->code = preg_replace('#name="height" value="[0-9]+"#', $replace_with, $the_media->code); $vheight = $the_media->height; $vwidth = $the_media->width; } elseif ($the_media->option_video_size == 0) { $replace_with = 'width="' . $default_width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $default_height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="width"#', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('#value="[0-9]+" name="height"#', $replace_with, $the_media->code); $replace_with = 'name="width" value="' . $default_width . '"'; $the_media->code = preg_replace('/name="width" value="[0-9]+"/', $replace_with, $the_media->code); $replace_with = 'name="height" value="' . $default_height . '"'; $the_media->code = preg_replace('/name="height" value="[0-9]+"/', $replace_with, $the_media->code); $vheight = $default_height; $vwidth = $default_width; } } } elseif ($the_media->type == 'audio') { if ($the_media->source == 'url' || $the_media->source == 'local') { if ($the_media->width == 0 || $the_media->height == 0) { $aheight = 20; $awidth = 300; } else { $aheight = $the_media->height; $awidth = $the_media->width; } } elseif ($the_media->source == 'code') { if ($the_media->width == 0 || $the_media->height == 0) { $begin_tag = strpos($the_media->code, 'width="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 7, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $awidth = substr($remaining_code, 0, $end_tag); $begin_tag = strpos($the_media->code, 'height="'); if ($begin_tag !== false) { $remaining_code = substr($the_media->code, $begin_tag + 8, strlen($the_media->code)); $end_tag = strpos($remaining_code, '"'); $aheight = substr($remaining_code, 0, $end_tag); $no_plugin_for_code = 1; } else { $aheight = 20; $awidth = 300; } } else { $aheight = 20; $awidth = 300; } } else { $replace_with = 'width="' . $the_media->width . '"'; $the_media->code = preg_replace('#width="[0-9]+"#', $replace_with, $the_media->code); $replace_with = 'height="' . $the_media->height . '"'; $the_media->code = preg_replace('#height="[0-9]+"#', $replace_with, $the_media->code); $aheight = $the_media->height; $awidth = $the_media->width; } } } $parts = explode(".", @$the_media->local); $extension = strtolower($parts[count($parts) - 1]); if ($the_media->type == 'video' || $the_media->type == 'audio') { if ($the_media->type == 'video' && $extension == "avi") { $media = '<object width="' . $vwidth . '" height="' . $vheight . '" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="MediaPlayer1"> <param value="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="fileName"> <param value="true" name="animationatStart"> <param value="true" name="transparentatStart"> <param value="true" name="autoStart"> <param value="true" name="showControls"> <param value="10" name="Volume"> <param value="false" name="autoplay"> <embed width="' . $vwidth . '" height="' . $vheight . '" type="video/x-msvideo" src="' . JURI::root() . $configs->videoin . "/" . $the_media->local . '" name="plugin"> </object>'; /*$media = '<object id="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" width="'.$vwidth.'" height="'.$vheight.'"> <param name="fileName" value="'.JURI::root().$configs->videoin."/".$the_media->local.'"> <param name="animationatStart" value="true"> <param name="transparentatStart" value="true"> <param name="autoStart" value="true"> <param name="showControls" value="true"> <param name="Volume" value="10"> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'.JURI::root().$configs->videoin."/".$the_media->local.'" name="MediaPlayer1" width="'.$vwidth.'" height="'.$vheight.'" autostart="1" showcontrols="1" volume="10"> </object>';*/ } elseif ($no_plugin_for_code == 0) { if ($the_media->type == "video" && $the_media->source == "url") { require_once JPATH_ROOT . '/components/com_guru/helpers/videos/helper.php'; $parsedVideoLink = parse_url($the_media->url); preg_match('/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i', $parsedVideoLink['host'], $matches); $domain = $matches['domain']; if (!empty($domain)) { $provider = explode('.', $domain); $providerName = JString::strtolower($provider[0]); $libraryPath = JPATH_ROOT . '/components/com_guru/helpers/videos' . '/' . $providerName . '.php'; require_once $libraryPath; $className = 'PTableVideo' . JString::ucfirst($providerName); $videoObj = new $className(); $videoObj->init($the_media->url); $video_id = $videoObj->getId(); $videoPlayer = $videoObj->getViewHTML($video_id, $vwidth, $vheight); $media = $videoPlayer; } } else { $media = $helperclass->create_media_using_plugin($the_media, $configs, $awidth, $aheight, $vwidth, $vheight); } } } if ($the_media->type == 'docs') { $the_base_link = explode('administrator/', $_SERVER['HTTP_REFERER']); $the_base_link = $the_base_link[0]; $media = JText::_('GURU_NO_PREVIEW'); //$media = JText::_("GURU_TASKS"); if ($the_media->source == 'local' && (substr($the_media->local, strlen($the_media->local) - 3, 3) == 'txt' || substr($the_media->local, strlen($the_media->local) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_base_link . '/' . $configs->docsin . '/' . $the_media->local . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } elseif ($the_media->source == 'url' && (substr($the_media->url, strlen($the_media->url) - 3, 3) == 'txt' || substr($the_media->url, strlen($the_media->url) - 3, 3) == 'pdf') && $the_media->width > 1) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="' . $the_media->width . '" height="' . $the_media->height . '" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if ($the_media->source == 'local' && $the_media->width == 1) { $media = '<br /><a href="' . $the_base_link . $configs->docsin . '/' . $the_media->local . '" target="_blank">' . $the_media->name . '</a>'; return stripslashes($media . '<div style="text-align:center"><i>' . $the_media->instructions . '</i></div>'); } if ($the_media->source == 'url' && $the_media->width == 0) { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="100%" height="600" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; } if ($the_media->source == 'url' && $the_media->width == 1) { $media = '<a href="' . $the_media->url . '" target="_blank">' . $the_media->name . '</a>'; } } if ($the_media->type == 'url') { $src = $the_media->url; $media = '<a href="' . $src . '" target="_blank">' . $src . '</a>'; } if ($the_media->type == 'Article') { $media = self::getArticleById($the_media->code); } if ($the_media->type == 'image') { $img_size = @getimagesize(JPATH_SITE . DS . $configs->imagesin . DS . 'media' . DS . 'thumbs' . $the_media->local); //echo "~~~~".var_dump($img_size)."~~~~"; $img_width = $img_size[0]; $img_height = $img_size[1]; if ($img_width > 0 && $img_height > 0) { $thumb_width = 0; $thumb_height = 0; if ($the_media->width > 0) { $thumb_width = $the_media->width; $thumb_height = $img_height / ($img_width / $the_media->width); } elseif ($the_media->height > 0) { $thumb_height = $the_media->height; $thumb_width = $img_width / ($img_height / $the_media->height); } else { $thumb_height = 200; $thumb_width = $img_width / ($img_height / 200); } $media = '<img width="' . $thumb_width . '" height="' . $thumb_height . '" src="' . JURI::root() . DS . $configs->imagesin . '/media/thumbs' . $the_media->local . '" />'; } if (!isset($media)) { $media = NULL; } } if ($the_media->type == 'quiz') { $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root() . "components/com_guru/css/quiz.css"); $media = ''; $q = "SELECT * FROM #__guru_quiz WHERE id = " . $the_media->id; $db->setQuery($q); $result_quiz = $db->loadObject(); $media .= '<span class="guru_quiz_title">' . $result_quiz->name . '</span>'; $media .= '<span class="guru_quiz_description">' . $result_quiz->description . '</span>'; if ($result_quiz->is_final == 1) { $sql = "SELECT \tquizzes_ids FROM #__guru_quizzes_final WHERE qid=" . $the_media->id; $db->setQuery($sql); $db->query(); $result = $db->loadResult(); $result_qids = explode(",", trim($result, ",")); if (count($result_qids) || ($result_qids["0"] = "")) { $result_qids["0"] = 0; } $q = "SELECT * FROM #__guru_questions WHERE qid IN (" . implode(",", $result_qids) . ") and published=1"; } else { $q = "SELECT * FROM #__guru_questions WHERE qid = " . $the_media->id . " and published=1"; } $db->setQuery($q); $quiz_questions = $db->loadObjectList(); $question_number = 1; foreach ($quiz_questions as $one_question) { $question_answers_number = 0; $media .= '<div id="the_quiz">'; $media .= '<ul class="guru_list">'; $media .= '<li class="question">' . $question_number . '. ' . $one_question->text . '</li>'; if ($one_question->a1 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a1)) . '\')" type="checkbox" value="1a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a1 . '</li>'; $question_answers_number++; } if ($one_question->a2 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a2)) . '\')" type="checkbox" value="2a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a2 . '</li>'; $question_answers_number++; } if ($one_question->a3 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a3)) . '\')" type="checkbox" value="3a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a3 . '</li>'; $question_answers_number++; } if ($one_question->a4 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a4)) . '\')" type="checkbox" value="4a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a4 . '</li>'; $question_answers_number++; } if ($one_question->a5 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a5)) . '\')" type="checkbox" value="5a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a5 . '</li>'; $question_answers_number++; } if ($one_question->a6 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a6)) . '\')" type="checkbox" value="6a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a6 . '</li>'; $question_answers_number++; } if ($one_question->a7 != '') { $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a7)) . '\')" type="checkbox" value="7a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a7 . '</li>'; $question_answers_number++; } if ($one_question->a8 != '') { $question_answers_number++; $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a8)) . '\')" type="checkbox" value="8a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a8 . '</li>'; } if ($one_question->a9 != '') { $question_answers_number++; $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a9)) . '\')" type="checkbox" value="9a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a9 . '</li>'; } if ($one_question->a10 != '') { $question_answers_number++; $media .= '<li class="answer"><input onclick="javascrit:setQuestionValue(' . $question_number . ', \'' . trim(str_replace("'", "´", $one_question->a10)) . '\')" type="checkbox" value="10a' . $question_number . '" name="q' . $question_number . '"> ' . $one_question->a10 . '</li>'; } $media = $media . '</ul>'; $media = $media . '</div>'; $the_first_answer = explode(',', $one_question->answers); $the_first_answer = $the_first_answer[0]; $the_first_answer = str_replace('a', '', $the_first_answer); if (intval($the_first_answer) == 1) { $the_right_answer = $one_question->a1; } if (intval($the_first_answer) == 2) { $the_right_answer = $one_question->a2; } if (intval($the_first_answer) == 3) { $the_right_answer = $one_question->a3; } if (intval($the_first_answer) == 4) { $the_right_answer = $one_question->a4; } if (intval($the_first_answer) == 5) { $the_right_answer = $one_question->a5; } if (intval($the_first_answer) == 6) { $the_right_answer = $one_question->a6; } if (intval($the_first_answer) == 7) { $the_right_answer = $one_question->a7; } if (intval($the_first_answer) == 8) { $the_right_answer = $one_question->a8; } if (intval($the_first_answer) == 9) { $the_right_answer = $one_question->a9; } if (intval($the_first_answer) == 10) { $the_right_answer = $one_question->a10; } $all_answers = array(); if (trim($one_question->a1) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a1)); } if (trim($one_question->a2) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a2)); } if (trim($one_question->a3) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a3)); } if (trim($one_question->a4) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a4)); } if (trim($one_question->a5) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a5)); } if (trim($one_question->a6) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a6)); } if (trim($one_question->a7) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a7)); } if (trim($one_question->a8) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a8)); } if (trim($one_question->a9) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a9)); } if (trim($one_question->a10) != "") { $all_answers[] = trim(str_replace("'", "´", $one_question->a10)); } $all_answers = implode(",", $all_answers); $media = $media . '<input type="hidden" value="' . $all_answers . '" name="all_answers' . $question_number . '" id="all_answers' . $question_number . '" />'; $media = $media . '<input type="hidden" value="" name="question_answergived' . $question_number . '" id="question_answergived' . $question_number . '" />'; $media = $media . '<input type="hidden" value="' . $the_right_answer . '" name="question_answerright' . $question_number . '" id="question_answerright' . $question_number . '" />'; $media = $media . '<input type="hidden" value="' . str_replace("'", "´", $one_question->text) . '" name="the_question' . $question_number . '" id="the_question' . $question_number . '" />'; $question_number++; } $media = $media . '<input type="hidden" value="' . ($question_number - 1) . '" name="question_number" id="question_number" />'; $media = $media . '<input type="hidden" value="' . $result_quiz->name . '" id="quize_name" name="quize_name"/>'; $media = $media . '<br /><div align="left" style="padding-left:30px;"><input type="submit" class = "btn" value="' . JText::_("GURU_SUBMIT") . '" onclick="get_quiz_result()" /></div>'; $media = str_replace('type="submit"', 'type="button"', $media); $media = str_replace("type='submit'", "type='button'", $media); } if ($the_media->type == "file") { $media = '<a target="_blank" href="' . JURI::ROOT() . $configs->filesin . '/' . $the_media->local . '">' . $the_media->name . '</a><br/><br/>' . $the_media->instructions; } return stripslashes($media); }
$media = '<a href="' . $src . '" target="_blank">' . $src . '</a>'; } else { $media = '<div class="contentpane"> <iframe id="blockrandom" name="iframe" src="' . $the_media->url . '" width="100%" scrolling="auto" align="top" frameborder="2" class="wrapper"> This option will not work correctly. Unfortunately, your browser does not support inline frames.</iframe> </div>'; } } if ($the_media->type == 'image') { $media = "<img src='" . JURI::root() . $configs->imagesin . "/media/thumbs" . $the_media->local . "' />"; } if (@$the_media->type == "file") { $media = '<a target="_blank" href="' . JURI::ROOT() . $configs->filesin . '/' . $the_media->local . '">' . $the_media->name . '</a><br/><br/>' . $the_media->instructions; } if ($the_media->type == 'Article') { $code = "SELECT `introtext` , `fulltext` FROM `#__content` WHERE `id`=" . $the_media->code; $database->setQuery($code); $result = $database->loadAssocList(); $the_media = $result[0]["introtext"] . $result[0]["fulltext"]; $url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = "http://" . substr($url, 0, strpos($url, "components")); $pattern = '/src="([^"]*)"/'; preg_match($pattern, $the_media, $matches); $src = @$matches[1]; if (count($src) > 0) { for ($i = 0; $i < count($src); $i++) { $src1 = $url . $src; $media = str_replace($src, $src1, $the_media);
jimport('joomla.html.parameter'); JHtml::_('behavior.keepalive'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHTML::_('behavior.calendar'); $app = JFactory::getApplication(); JPluginHelper::importPlugin('user'); $plugin = JPluginHelper::getPlugin('user', 'profile'); $pluginParams = new JRegistry(); $pluginParams->loadString($plugin->params); @($params1 = new JRegistry($plugin1->params)); $data = $params1->get('public_key'); $lang =& JFactory::getLanguage(); $extension = 'com_users'; $base_dir = JPATH_SITE; $app->setUserState('base_url', JURI::ROOT()); $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload); $document =& JFactory::getDocument(); $url = JURI::root() . 'modules/mod_s5_register/'; $document->addCustomTag('<link rel="stylesheet" href="' . $url . 'css/s5_register.css" type="text/css" />'); //if($modules_params->get('captcha')==1) { // $document->addScript($url.'captcha/CaptchaSecurityImages.php'); //} jimport('joomla.application.component.helper'); $content_params =& JComponentHelper::getParams('com_users'); $allres = $content_params->get('allowUserRegistration'); if ($allres == 0) { echo JTEXT::_('MOD_REGISTER_PLUGIN_ALERT'); } else { $version = new JVersion();
protected function generate() { require_once KPATH_SITE . '/lib/kunena.link.class.php'; if (!isset($this->_shorttype)) { $this->_shorttype = $this->isImage($this->filetype) ? 'image' : $this->filetype; $this->_shortname = KunenaForumMessageAttachmentHelper::shortenFileName($this->filename); $config = KunenaFactory::getConfig(); $this->_imagelink = null; $template = KunenaFactory::getTemplate(); switch (strtolower($this->_shorttype)) { case 'image': // Check for thumbnail and if available, use for display if (file_exists(JPATH_ROOT . '/' . $this->folder . '/thumb/' . $this->filename)) { $thumb = $this->folder . '/thumb/' . $this->filename; $imgsize = ''; } else { $thumb = $this->folder . '/' . $this->filename; $imgsize = 'width="' . $config->thumbwidth . 'px" height="' . $config->thumbheight . 'px"'; } $img = '<img title="' . $this->escape($this->filename) . '" ' . $imgsize . ' src="' . JURI::ROOT() . $thumb . '" alt="' . $this->escape($this->filename) . '" />'; $this->_thumblink = CKunenaLink::GetAttachmentLink($this->escape($this->folder), $this->escape($this->filename), $img, $this->escape($this->filename), $config->lightbox ? 'lightbox[thumb' . intval($this->mesid) . ']' : ''); $img = '<img title="' . $this->escape($this->filename) . '" src="' . JURI::ROOT() . $this->escape($this->folder) . '/' . $this->escape($this->filename) . '" alt="' . $this->escape($this->filename) . '" />'; $this->_imagelink = CKunenaLink::GetAttachmentLink($this->escape($this->folder), $this->escape($this->filename), $img, $this->escape($this->filename), $config->lightbox ? 'lightbox[imagelink' . intval($this->mesid) . ']' : ''); $this->_textLink = CKunenaLink::GetAttachmentLink($this->escape($this->folder), $this->escape($this->filename), $this->escape($this->_shortname), $this->escape($this->filename), $config->lightbox ? 'lightbox[simple' . $this->mesid . ']' . ' nofollow' : ' nofollow') . ' (' . number_format(intval($this->size) / 1024, 0, '', ',') . 'KB)'; break; default: // Filetype without thumbnail or icon support - use default file icon $img = '<img src="' . JURI::root() . 'media/kunena/images/attach_generic.png" alt="' . JText::_('COM_KUNENA_ATTACH') . '" />'; $this->_thumblink = CKunenaLink::GetAttachmentLink($this->escape($this->folder), $this->escape($this->filename), $img, $this->escape($this->filename), 'nofollow'); $this->_textLink = CKunenaLink::GetAttachmentLink($this->escape($this->folder), $this->escape($this->filename), $this->escape($this->_shortname), $this->escape($this->filename), 'nofollow') . ' (' . number_format(intval($this->size) / 1024, 0, '', ',') . 'KB)'; } $this->_disabled = false; if (!KunenaUserHelper::getMyself()->exists()) { if ($this->_shorttype == 'image' && !$config->showimgforguest) { $this->_disabled = true; $this->_textLink = JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEIMG'); } if ($this->_shorttype != 'image' && !$config->showfileforguest) { $this->_disabled = true; $this->_textLink = JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEFILE'); } if ($this->_disabled) { $this->_thumblink = '<img src="' . JURI::root() . 'media/kunena/images/attach_generic.png" alt="' . JText::_('COM_KUNENA_ATTACH') . '" />'; $this->_imagelink = null; $this->size = 0; } } } }
/** * load the css properties for the module * @param JRegistry $params * @param string $menuID the module ID * * @return void */ static function injectModuleCss($params, $menuID) { $document = JFactory::getDocument(); // set the prefixes for all xml fieldset $prefixes = array('menustyles', 'level1itemnormalstyles', 'level1itemhoverstyles', 'level1itemactivestyles', 'level2menustyles', 'level2itemnormalstyles', 'level2itemhoverstyles', 'level2itemactivestyles', 'headingstyles'); $css = new stdClass(); $csstoinject = ''; $important = false; foreach ($prefixes as $prefix) { $param = $params->get($prefix, '[]'); $objs = json_decode(str_replace("|qq|", "\"", $param)); //var_dump($objs); if (!$objs) { continue; } $fields = new CkCssParams(); foreach ($objs as $obj) { $fieldid = str_replace($prefix . "_", "", $obj->id); $fields->{$fieldid} = isset($obj->value) ? $obj->value : null; } if ($prefix == 'headingstyles') { $important = true; } $css->{$prefix} = modMaximenuckHelper::createCss($menuID, $fields, $prefix, $important); // global options if ($prefix == 'menustyles') { // load the google font $gfont = $fields->get('menustylestextgfont', 'Droid Sans'); if ($gfont != '0' && $fields->get('menustylesusefont')) { $gfonturl = str_replace(" ", "+", $gfont); $document->addStylesheet('http://fonts.googleapis.com/css?family=' . $gfonturl); $document->addStyleDeclaration("div#" . $menuID . " li > a, div#" . $menuID . " li > span { font-family: " . $gfont . ";}"); } // set the styles for the global menu $submenuwidth = $fields->get('menustylessubmenuwidth', ''); $submenuheight = $fields->get('menustylessubmenuheight', ''); $submenu1marginleft = $fields->get('menustylessubmenu1marginleft', ''); $submenu1margintop = $fields->get('menustylessubmenu1margintop', ''); $submenu2marginleft = $fields->get('menustylessubmenu2marginleft', ''); $submenu2margintop = $fields->get('menustylessubmenu2margintop', ''); $csstoinject = ''; if ($submenuwidth) { $csstoinject .= "\ndiv#" . $menuID . " div.maximenuck2 { width: " . self::testUnit($submenuwidth) . "; } "; } if ($submenuheight) { $csstoinject .= "\ndiv#" . $menuID . " div.floatck { height: " . self::testUnit($submenuheight) . "; } "; } if ($submenu1marginleft) { $csstoinject .= "\ndiv#" . $menuID . " div.floatck { margin-left: " . self::testUnit($submenu1marginleft) . "; } "; } if ($submenu1margintop) { $csstoinject .= "\ndiv#" . $menuID . " div.floatck { margin-top: " . self::testUnit($submenu1margintop) . "; } "; } if ($submenu2marginleft) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck div.floatck { margin-left: " . self::testUnit($submenu2marginleft) . "; } "; } if ($submenu2margintop) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck div.floatck { margin-top: " . self::testUnit($submenu2margintop) . "; } "; } } if ($prefix == 'level1itemnormalstyles') { $itemparentlevel1image = $fields->get('level1itemnormalstylesparentitemimage', ''); $itemparentlevel1paddingtop = $fields->get('level1itemnormalstylesparentitempaddingtop', ''); $itemparentlevel1paddingright = $fields->get('level1itemnormalstylesparentitempaddingright', ''); $itemparentlevel1paddingbottom = $fields->get('level1itemnormalstylesparentitempaddingbottom', ''); $itemparentlevel1paddingleft = $fields->get('level1itemnormalstylesparentitempaddingleft', ''); $itemparentlevel1background = $fields->get('level1itemnormalstylesparentitemimage') ? 'background-image: url("' . JURI::ROOT() . $fields->get('level1itemnormalstylesparentitemimage') . '") !important;' : ''; $itemparentlevel1background .= $fields->get('level1itemnormalstylesparentitemimage') ? 'background-repeat: ' . $fields->get('level1itemnormalstylesparentitemimagerepeat') . ' !important;' : ''; $itemparentlevel1background .= $fields->get('level1itemnormalstylesparentitemimage') ? 'background-position: ' . $fields->get('level1itemnormalstylesparentitemimagepositionx') . ' ' . $fields->get('level1itemnormalstylesparentitemimagepositiony') . ' !important;' : ''; if ($fields->get('level1itemnormalstylesuseparentitem') && ($itemparentlevel1image || $itemparentlevel1paddingtop || $itemparentlevel1paddingright || $itemparentlevel1paddingbottom || $itemparentlevel1paddingleft)) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent > span.separator { " . $itemparentlevel1background . " padding-top: " . self::testUnit($itemparentlevel1paddingtop) . " !important; padding-right: " . self::testUnit($itemparentlevel1paddingright) . " !important; padding-bottom: " . self::testUnit($itemparentlevel1paddingbottom) . " !important; padding-left: " . self::testUnit($itemparentlevel1paddingleft) . " !important; } "; } } if ($prefix == 'level2itemnormalstyles') { $itemparentlevel2image = $fields->get('level2itemnormalstylesparentitemimage', ''); $itemparentlevel2paddingtop = $fields->get('level2itemnormalstylesparentitempaddingtop', ''); $itemparentlevel2paddingright = $fields->get('level2itemnormalstylesparentitempaddingright', ''); $itemparentlevel2paddingbottom = $fields->get('level2itemnormalstylesparentitempaddingbottom', ''); $itemparentlevel2paddingleft = $fields->get('level2itemnormalstylesparentitempaddingleft', ''); $itemparentlevel2background = $fields->get('level2itemnormalstylesparentitemimage') ? 'background-image: url("' . JURI::ROOT() . $fields->get('level2itemnormalstylesparentitemimage') . '") !important;' : ''; $itemparentlevel2background .= $fields->get('level2itemnormalstylesparentitemimage') ? 'background-repeat: ' . $fields->get('level2itemnormalstylesparentitemimagerepeat') . ' !important;' : ''; $itemparentlevel2background .= $fields->get('level2itemnormalstylesparentitemimage') ? 'background-position: ' . $fields->get('level2itemnormalstylesparentitemimagepositionx') . ' ' . $fields->get('level2itemnormalstylesparentitemimagepositiony') . ' !important;' : ''; if ($fields->get('level2itemnormalstylesuseparentitem') && ($itemparentlevel2image || $itemparentlevel2paddingtop || $itemparentlevel2paddingright || $itemparentlevel2paddingbottom || $itemparentlevel2paddingleft)) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent > span.separator, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent:hover > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent:hover > span.separator,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.parent > a, div#" . $menuID . " .maxipushdownck li.maximenuck.parent > span.separator, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > a, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > span.separator { " . $itemparentlevel2background . " padding-top: " . self::testUnit($itemparentlevel2paddingtop) . " !important; padding-right: " . self::testUnit($itemparentlevel2paddingright) . " !important; padding-bottom: " . self::testUnit($itemparentlevel2paddingbottom) . " !important; padding-left: " . self::testUnit($itemparentlevel2paddingleft) . " !important; } "; } } } // root styles if (isset($css->menustyles)) { if ($css->menustyles['padding'] || $css->menustyles['margin'] || $css->menustyles['background'] || $css->menustyles['gradient'] || $css->menustyles['borderradius'] || $css->menustyles['shadow'] || $css->menustyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck { " . $css->menustyles['padding'] . $css->menustyles['margin'] . $css->menustyles['background'] . $css->menustyles['gradient'] . $css->menustyles['borderradius'] . $css->menustyles['shadow'] . $css->menustyles['border'] . " } "; } if ($css->menustyles['fontcolor'] || $css->menustyles['fontsize'] || $css->menustyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->menustyles['fontcolor'] . $css->menustyles['fontsize'] . $css->menustyles['textshadow'] . " } "; } if ($css->menustyles['descfontcolor'] || $css->menustyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->menustyles['descfontcolor'] . $css->menustyles['descfontsize'] . " } "; } } // level1 normal items styles if (isset($css->level1itemnormalstyles)) { if ($css->level1itemnormalstyles['padding'] || $css->level1itemnormalstyles['margin'] || $css->level1itemnormalstyles['background'] || $css->level1itemnormalstyles['gradient'] || $css->level1itemnormalstyles['borderradius'] || $css->level1itemnormalstyles['shadow'] || $css->level1itemnormalstyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent { " . $css->level1itemnormalstyles['padding'] . $css->level1itemnormalstyles['margin'] . $css->level1itemnormalstyles['background'] . $css->level1itemnormalstyles['gradient'] . $css->level1itemnormalstyles['borderradius'] . $css->level1itemnormalstyles['shadow'] . $css->level1itemnormalstyles['border'] . " } "; } if ($css->level1itemnormalstyles['fontcolor'] || $css->level1itemnormalstyles['fontsize'] || $css->level1itemnormalstyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 > span.separator span.titreck { " . $css->level1itemnormalstyles['fontcolor'] . $css->level1itemnormalstyles['fontsize'] . $css->level1itemnormalstyles['fontweight'] . $css->level1itemnormalstyles['textshadow'] . " } "; } if ($css->level1itemnormalstyles['descfontcolor'] || $css->level1itemnormalstyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 > span.separator span.descck { " . $css->level1itemnormalstyles['descfontcolor'] . $css->level1itemnormalstyles['descfontsize'] . " } "; } } // level1 hover items styles if (isset($css->level1itemhoverstyles)) { if ($css->level1itemhoverstyles['padding'] || $css->level1itemhoverstyles['margin'] || $css->level1itemhoverstyles['background'] || $css->level1itemhoverstyles['gradient'] || $css->level1itemhoverstyles['borderradius'] || $css->level1itemhoverstyles['shadow'] || $css->level1itemhoverstyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent:hover { " . $css->level1itemhoverstyles['padding'] . $css->level1itemhoverstyles['margin'] . $css->level1itemhoverstyles['background'] . $css->level1itemhoverstyles['gradient'] . $css->level1itemhoverstyles['borderradius'] . $css->level1itemhoverstyles['shadow'] . $css->level1itemhoverstyles['border'] . " } "; } if ($css->level1itemhoverstyles['fontcolor'] || $css->level1itemhoverstyles['fontsize'] || $css->level1itemhoverstyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > span.separator span.titreck { " . $css->level1itemhoverstyles['fontcolor'] . $css->level1itemhoverstyles['fontsize'] . $css->level1itemhoverstyles['fontweight'] . $css->level1itemhoverstyles['textshadow'] . " } "; } if ($css->level1itemhoverstyles['descfontcolor'] || $css->level1itemhoverstyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > span.separator span.descck { " . $css->level1itemhoverstyles['descfontcolor'] . $css->level1itemhoverstyles['descfontsize'] . " } "; } } // level1 active items styles if (isset($css->level1itemactivestyles)) { if ($css->level1itemactivestyles['padding'] || $css->level1itemactivestyles['margin'] || $css->level1itemactivestyles['background'] || $css->level1itemactivestyles['gradient'] || $css->level1itemactivestyles['borderradius'] || $css->level1itemactivestyles['shadow'] || $css->level1itemactivestyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active { " . $css->level1itemactivestyles['padding'] . $css->level1itemactivestyles['margin'] . $css->level1itemactivestyles['background'] . $css->level1itemactivestyles['gradient'] . $css->level1itemactivestyles['borderradius'] . $css->level1itemactivestyles['shadow'] . $css->level1itemactivestyles['border'] . " } "; } if ($css->level1itemactivestyles['fontcolor'] || $css->level1itemactivestyles['fontsize'] || $css->level1itemactivestyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > span.separator span.titreck { " . $css->level1itemactivestyles['fontcolor'] . $css->level1itemactivestyles['fontsize'] . $css->level1itemactivestyles['fontweight'] . $css->level1itemactivestyles['textshadow'] . " } "; } if ($css->level1itemactivestyles['descfontcolor'] || $css->level1itemactivestyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > span.separator span.descck { " . $css->level1itemactivestyles['descfontcolor'] . $css->level1itemactivestyles['descfontsize'] . " } "; } } // submenu styles if (isset($css->level2menustyles)) { if ($css->level2menustyles['padding'] || $css->level2menustyles['margin'] || $css->level2menustyles['background'] || $css->level2menustyles['gradient'] || $css->level2menustyles['borderradius'] || $css->level2menustyles['shadow'] || $css->level2menustyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck,\ndiv#" . $menuID . " .maxipushdownck div.floatck { " . $css->level2menustyles['padding'] . $css->level2menustyles['margin'] . $css->level2menustyles['background'] . $css->level2menustyles['gradient'] . $css->level2menustyles['borderradius'] . $css->level2menustyles['shadow'] . $css->level2menustyles['border'] . " } "; } } // level2 normal items styles if (isset($css->level2itemnormalstyles)) { if ($css->level2itemnormalstyles['padding'] || $css->level2itemnormalstyles['margin'] || $css->level2itemnormalstyles['background'] || $css->level2itemnormalstyles['gradient'] || $css->level2itemnormalstyles['borderradius'] || $css->level2itemnormalstyles['shadow'] || $css->level2itemnormalstyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck { " . $css->level2itemnormalstyles['padding'] . $css->level2itemnormalstyles['margin'] . $css->level2itemnormalstyles['background'] . $css->level2itemnormalstyles['gradient'] . $css->level2itemnormalstyles['borderradius'] . $css->level2itemnormalstyles['shadow'] . $css->level2itemnormalstyles['border'] . " } "; } if ($css->level2itemnormalstyles['fontcolor'] || $css->level2itemnormalstyles['fontsize'] || $css->level2itemnormalstyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->level2itemnormalstyles['fontcolor'] . $css->level2itemnormalstyles['fontsize'] . $css->level2itemnormalstyles['fontweight'] . $css->level2itemnormalstyles['textshadow'] . " } "; } if ($css->level2itemnormalstyles['descfontcolor'] || $css->level2itemnormalstyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->level2itemnormalstyles['descfontcolor'] . $css->level2itemnormalstyles['descfontsize'] . " } "; } } // level2 hover items styles if (isset($css->level2itemhoverstyles)) { if ($css->level2itemhoverstyles['padding'] || $css->level2itemhoverstyles['margin'] || $css->level2itemhoverstyles['background'] || $css->level2itemhoverstyles['gradient'] || $css->level2itemhoverstyles['borderradius'] || $css->level2itemhoverstyles['shadow'] || $css->level2itemhoverstyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover { " . $css->level2itemhoverstyles['padding'] . $css->level2itemhoverstyles['margin'] . $css->level2itemhoverstyles['background'] . $css->level2itemhoverstyles['gradient'] . $css->level2itemhoverstyles['borderradius'] . $css->level2itemhoverstyles['shadow'] . $css->level2itemhoverstyles['border'] . " } "; } if ($css->level2itemhoverstyles['fontcolor'] || $css->level2itemhoverstyles['fontsize'] || $css->level2itemhoverstyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.titreck { " . $css->level2itemhoverstyles['fontcolor'] . $css->level2itemhoverstyles['fontsize'] . $css->level2itemhoverstyles['fontweight'] . $css->level2itemhoverstyles['textshadow'] . " } "; } if ($css->level2itemhoverstyles['descfontcolor'] || $css->level2itemhoverstyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.descck { " . $css->level2itemhoverstyles['descfontcolor'] . $css->level2itemhoverstyles['descfontsize'] . " } "; } } // level2 active items styles if (isset($css->level2itemactivestyles)) { if ($css->level2itemactivestyles['padding'] || $css->level2itemactivestyles['margin'] || $css->level2itemactivestyles['background'] || $css->level2itemactivestyles['gradient'] || $css->level2itemactivestyles['borderradius'] || $css->level2itemactivestyles['shadow'] || $css->level2itemactivestyles['border']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active { " . $css->level2itemactivestyles['padding'] . $css->level2itemactivestyles['margin'] . $css->level2itemactivestyles['background'] . $css->level2itemactivestyles['gradient'] . $css->level2itemactivestyles['borderradius'] . $css->level2itemactivestyles['shadow'] . $css->level2itemactivestyles['border'] . " } "; } if ($css->level2itemactivestyles['fontcolor'] || $css->level2itemactivestyles['fontsize'] || $css->level2itemactivestyles['textshadow']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.titreck { " . $css->level2itemactivestyles['fontcolor'] . $css->level2itemactivestyles['fontsize'] . $css->level2itemactivestyles['fontweight'] . $css->level2itemactivestyles['textshadow'] . " } "; } if ($css->level2itemactivestyles['descfontcolor'] || $css->level2itemactivestyles['descfontsize']) { $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.descck { " . $css->level2itemactivestyles['descfontcolor'] . $css->level2itemactivestyles['descfontsize'] . " } "; } } // level1 normal items styles if (isset($css->headingstyles)) { $headingclass = '.separator'; $padding = $css->headingstyles['padding'] ? trim($css->headingstyles['padding'], ";") . ";" : ''; $margin = $css->headingstyles['margin'] ? trim($css->headingstyles['margin'], ";") . ";" : ''; $background = $css->headingstyles['background'] ? trim($css->headingstyles['background'], ";") . ";" : ''; $gradient = $css->headingstyles['gradient'] ? trim($css->headingstyles['gradient'], ";") . ";" : ''; $borderradius = $css->headingstyles['borderradius'] ? trim($css->headingstyles['borderradius'], ";") . ";" : ''; $shadow = $css->headingstyles['shadow'] ? trim($css->headingstyles['shadow'], ";") . ";" : ''; $border = $css->headingstyles['border'] ? trim($css->headingstyles['border'], ";") . ";" : ''; $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . ",\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " { " . $padding . $margin . $background . $gradient . $borderradius . $shadow . $border . " } "; $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck { " . $css->headingstyles['fontcolor'] . $css->headingstyles['fontsize'] . $css->headingstyles['fontweight'] . $css->headingstyles['textshadow'] . " } "; $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck{ " . $css->headingstyles['descfontcolor'] . $css->headingstyles['descfontsize'] . " } "; } if ($csstoinject) { $document->addStyleDeclaration($csstoinject); } }
static function createCss($menuID, $params, $prefix = 'menu', $important = false, $itemid = '') { $css = array(); $css['padding'] = ($params->get($prefix . 'padding') and $params->get($prefix . 'usemargin')) ? 'padding: ' . $params->get($prefix . 'padding', '0') . 'px;' : ''; $css['margin'] = ($params->get($prefix . 'margin') and $params->get($prefix . 'usemargin')) ? 'margin: ' . $params->get($prefix . 'margin', '0') . 'px;' : ''; $bgcolor1 = $params->get($prefix . 'bgcolor1') && $params->get($prefix . 'bgopacity') ? self::hex2RGB($params->get($prefix . 'bgcolor1'), $params->get($prefix . 'bgopacity')) : $params->get($prefix . 'bgcolor1'); $css['background'] = ($params->get($prefix . 'bgcolor1') and $params->get($prefix . 'usebackground')) ? 'background: ' . $bgcolor1 . $important . ';' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-image: url("' . JURI::ROOT() . $params->get($prefix . 'bgimage') . '")' . $important . ';' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-repeat: ' . $params->get($prefix . 'bgimagerepeat') . $important . ';' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-position: ' . $params->get($prefix . 'bgpositionx') . ' ' . $params->get($prefix . 'bgpositiony') . $important . ';' : ''; // manage gradient svg for ie9 $svggradientfile = ''; if ($css['background'] and $params->get($prefix . 'bgcolor2') and $params->get($prefix . 'usegradient')) { $svggradientfile = self::createSvgGradient($menuID, $prefix . $itemid, $params->get($prefix . 'bgcolor1', '#f0f0f0'), $params->get($prefix . 'bgcolor2', '#e3e3e3')); } $svggradient = $svggradientfile ? "background-image: url(\"" . $svggradientfile . "\")" . $important . ";" : ""; $css['gradient'] = ($css['background'] and $params->get($prefix . 'bgcolor2') and $params->get($prefix . 'usegradient')) ? $svggradient . "background: -moz-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%, " . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%)" . $important . ";" . "background: -webkit-gradient(linear, left top, left bottom, color-stop(0%," . $params->get($prefix . 'bgcolor1', '#f0f0f0') . "), color-stop(100%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . "))" . $important . "; " . "background: -webkit-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%)" . $important . ";" . "background: -o-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%)" . $important . ";" . "background: -ms-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%)" . $important . ";" . "background: linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%)" . $important . "; " : ''; $css['borderradius'] = $params->get($prefix . 'useroundedcorners') ? '-moz-border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' . '-webkit-border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' . 'border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' : ''; $shadowinset = $params->get($prefix . 'shadowinset', 0) ? 'inset ' : ''; $css['shadow'] = ($params->get($prefix . 'shadowcolor') and $params->get($prefix . 'shadowblur') and $params->get($prefix . 'useshadow')) ? '-moz-box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' . '-webkit-box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' . 'box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' : ''; $css['border'] = ($params->get($prefix . 'bordercolor') and $params->get($prefix . 'borderwidth') and $params->get($prefix . 'useborders')) ? 'border: ' . $params->get($prefix . 'bordercolor', '#efefef') . ' ' . $params->get($prefix . 'borderwidth', '1') . 'px solid;' : ''; $css['fontsize'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontsize')) ? 'font-size: ' . $params->get($prefix . 'fontsize') . ';' : ''; $css['fontcolor'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontcolor')) ? 'color: ' . $params->get($prefix . 'fontcolor') . ';' : ''; $css['fontcolorhover'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontcolorhover')) ? 'color: ' . $params->get($prefix . 'fontcolorhover') . ';' : ''; $css['descfontsize'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'descfontsize')) ? 'font-size: ' . $params->get($prefix . 'descfontsize') . ';' : ''; $css['descfontcolor'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'descfontcolor')) ? 'color: ' . $params->get($prefix . 'descfontcolor') . ';' : ''; return $css; }
function create_media_using_plugin($main_media, $configs, $aheight, $awidth, $vheight, $vwidth) { $the_base_link = explode('administrator/', $_SERVER['HTTP_REFERER']); $the_base_link = $the_base_link[0]; //$the_base_link = ""; $database = JFactory::getDBO(); if ($main_media->type == 'video') { if ($main_media->source == 'code') { $media = $main_media->code; } if ($main_media->source == 'url') { //$position_watch = strpos($main_media->url, 'www.youtube.com/watch'); if (strpos($main_media->url, 'www.youtube.com/watch') !== false) { // youtube link - begin $link_array = explode('=', $main_media->url); $link_ = $link_array[1]; $media = '{youtube}' . $link_ . '{/youtube}'; } elseif (strpos($main_media->url, 'www.123video.nl') !== false) { // 123video.nl link - begin $link_array = explode('=', $main_media->url); $link_ = $link_array[1]; $media = '{123video}' . $link_ . '{/123video}'; } elseif (strpos($main_media->url, 'www.aniboom.com') !== false) { // aniboom.com link - begin $begin_tag = strpos($main_media->url, 'video'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{aniboom}' . $link_ . '{/aniboom}'; } elseif (strpos($main_media->url, 'www.badjojo.com') !== false) { // badjojo.com [adult] link - begin $link_array = explode('=', $main_media->url); $link_ = $link_array[1]; $media = '{badjojo}' . $link_ . '{/badjojo}'; //echo $media; } elseif (strpos($main_media->url, 'www.brightcove.tv') !== false) { // brightcove.tv link - begin $begin_tag = strpos($main_media->url, 'title='); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '&'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{brightcove}' . $link_ . '{/brightcove}'; } elseif (strpos($main_media->url, 'www.collegehumor.com') !== false) { // collegehumor.com link - begin $link_array = explode(':', $main_media->url); $link_ = $link_array[2]; $media = '{collegehumor}' . $link_ . '{/collegehumor}'; } elseif (strpos($main_media->url, 'current.com') !== false) { // current.com link - begin $begin_tag = strpos($main_media->url, 'items/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '_'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{current}' . $link_ . '{/current}'; } elseif (strpos($main_media->url, 'dailymotion.com') !== false) { // dailymotion.com link - begin $begin_tag = strpos($main_media->url, 'video/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '_'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{dailymotion}' . $link_ . '{/dailymotion}'; } elseif (strpos($main_media->url, 'espn') !== false) { // video.espn.com link - begin $begin_tag = strpos($main_media->url, 'videoId='); $remaining_link = substr($main_media->url, $begin_tag + 8, strlen($main_media->url)); $end_tag = strpos($remaining_link, '&'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{espn}' . $link_ . '{/espn}'; } elseif (strpos($main_media->url, 'eyespot.com') !== false) { // eyespot.com link - begin $link_array = explode('r=', $main_media->url); $link_ = $link_array[1]; $media = '{eyespot}' . $link_ . '{/eyespot}'; } elseif (strpos($main_media->url, 'flurl.com') !== false) { // flurl.com link - begin $begin_tag = strpos($main_media->url, 'video/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '_'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{flurl}' . $link_ . '{/flurl}'; } elseif (strpos($main_media->url, 'funnyordie.com') !== false) { // funnyordie.com link - begin $link_array = explode('videos/', $main_media->url); $link_ = $link_array[1]; $media = '{funnyordie}' . $link_ . '{/funnyordie}'; } elseif (strpos($main_media->url, 'gametrailers.com') !== false) { // gametrailers.com link - begin $begin_tag = strpos($main_media->url, 'player/'); $remaining_link = substr($main_media->url, $begin_tag + 7, strlen($main_media->url)); $end_tag = strpos($remaining_link, '.'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{gametrailers}' . $link_ . '{/gametrailers}'; } elseif (strpos($main_media->url, 'godtube.com') !== false) { // godtube.com link - begin $link_array = explode('viewkey=', $main_media->url); $link_ = $link_array[1]; $media = '{godtube}' . $link_ . '{/godtube}'; } elseif (strpos($main_media->url, 'gofish.com') !== false) { // gofish.com link - begin $link_array = explode('gfid=', $main_media->url); $link_ = $link_array[1]; $media = '{gofish}' . $link_ . '{/gofish}'; } elseif (strpos($main_media->url, 'google.com') !== false) { // Google Video link - begin $link_array = explode('docid=', $main_media->url); $link_ = $link_array[1]; $media = '{google}' . $link_ . '{/google}'; } elseif (strpos($main_media->url, 'guba.com') !== false) { // guba.com link - begin $link_array = explode('watch/', $main_media->url); $link_ = $link_array[1]; $media = '{guba}' . $link_ . '{/guba}'; } elseif (strpos($main_media->url, 'hook.tv') !== false) { // hook.tv link - begin $link_array = explode('key=', $main_media->url); $link_ = $link_array[1]; $media = '{hook}' . $link_ . '{/hook}'; } elseif (strpos($main_media->url, 'jumpcut.com') !== false) { // jumpcut.com link - begin $link_array = explode('id=', $main_media->url); $link_ = $link_array[1]; $media = '{jumpcut}' . $link_ . '{/jumpcut}'; } elseif (strpos($main_media->url, 'kewego.com') !== false) { // kewego.com link - begin $begin_tag = strpos($main_media->url, 'video/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '.'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{kewego}' . $link_ . '{/kewego}'; } elseif (strpos($main_media->url, 'krazyshow.com') !== false) { // krazyshow.com [adult] link - begin $link_array = explode('cid=', $main_media->url); $link_ = $link_array[1]; $media = '{krazyshow}' . $link_ . '{/krazyshow}'; } elseif (strpos($main_media->url, 'ku6.com') !== false) { // ku6.com link - begin $begin_tag = strpos($main_media->url, 'show/'); $remaining_link = substr($main_media->url, $begin_tag + 5, strlen($main_media->url)); $end_tag = strpos($remaining_link, '.'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{ku6}' . $link_ . '{/ku6}'; } elseif (strpos($main_media->url, 'liveleak.com') !== false) { // liveleak.com link - begin $link_array = explode('i=', $main_media->url); $link_ = $link_array[1]; $media = '{liveleak}' . $link_ . '{/liveleak}'; } elseif (strpos($main_media->url, 'metacafe.com') !== false) { // metacafe.com link - begin $begin_tag = strpos($main_media->url, 'watch/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strlen($remaining_link); $link_ = substr($remaining_link, 0, $end_tag); $media = '{metacafe}' . $link_ . '{/metacafe}'; } elseif (strpos($main_media->url, 'mofile.com') !== false) { // mofile.com link - begin $begin_tag = strpos($main_media->url, 'com/'); $remaining_link = substr($main_media->url, $begin_tag + 4, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{mofile}' . $link_ . '{/mofile}'; } elseif (strpos($main_media->url, 'myspace.com') !== false) { // myspace.com link - begin $link_array = explode('VideoID=', $main_media->url); $link_ = $link_array[1]; $media = '{myspace}' . $link_ . '{/myspace}'; } elseif (strpos($main_media->url, 'myvideo.de') !== false) { // myvideo.de link - begin $begin_tag = strpos($main_media->url, 'watch/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{myvideo}' . $link_ . '{/myvideo}'; } elseif (strpos($main_media->url, 'redtube.com') !== false) { // redtube.com [adult] link - begin $link_array = explode('/', $main_media->url); $link_ = $link_array[1]; $media = '{redtube}' . $link_ . '{/redtube}'; } elseif (strpos($main_media->url, 'revver.com') !== false) { // revver.com link - begin $begin_tag = strpos($main_media->url, 'video/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{revver}' . $link_ . '{/revver}'; } elseif (strpos($main_media->url, 'sapo.pt') !== false) { // sapo.pt link - begin $link_array = explode('pt/', $main_media->url); $link_ = $link_array[1]; $media = '{sapo}' . $link_ . '{/sapo}'; } elseif (strpos($main_media->url, 'sevenload.com') !== false) { // sevenload.com link - begin $begin_tag = strpos($main_media->url, 'videos/'); $remaining_link = substr($main_media->url, $begin_tag + 7, strlen($main_media->url)); $end_tag = strpos($remaining_link, '-'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{sevenload}' . $link_ . '{/sevenload}'; } elseif (strpos($main_media->url, 'sohu.com') !== false) { // sohu.com link - begin $link_array = explode('/', $main_media->url); $link_ = $link_array[count($link_array) - 1]; $media = '{sohu}' . $link_ . '{/sohu}'; } elseif (strpos($main_media->url, 'southparkstudios.com') !== false) { // southparkstudios.com link - begin $begin_tag = strpos($main_media->url, 'clips/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{southpark}' . $link_ . '{/southpark}'; } elseif (strpos($main_media->url, 'spike.com') !== false) { // spike.com link - begin $link_array = explode('video/', $main_media->url); $link_ = $link_array[1]; $media = '{spike}' . $link_ . '{/spike}'; } elseif (strpos($main_media->url, 'stickam.com') !== false) { // stickam.com link - begin $link_array = explode('mId=', $main_media->url); $link_ = $link_array[1]; $media = '{stickam}' . $link_ . '{/stickam}'; } elseif (strpos($main_media->url, 'stupidvideos.com') !== false) { // stupidvideos.com link - begin $link_array = explode('#', $main_media->url); $link_ = $link_array[1]; $media = '{stupidvideos}' . $link_ . '{/stupidvideos}'; } elseif (strpos($main_media->url, 'tudou.com') !== false) { // tudou.com link - begin $begin_tag = strpos($main_media->url, 'view/'); $remaining_link = substr($main_media->url, $begin_tag + 5, strlen($main_media->url)); $end_tag = strpos($remaining_link, '/'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{tudou}' . $link_ . '{/tudou}'; } elseif (strpos($main_media->url, 'ustream.tv') !== false) { // ustream.tv link - begin $link_array = explode('recorded/', $main_media->url); $link_ = $link_array[1]; $media = '{ustream}' . $link_ . '{/ustream}'; } elseif (strpos($main_media->url, 'veoh.com') !== false) { // veoh.com link - begin $link_array = explode('videos/', $main_media->url); $link_ = $link_array[1]; $media = '{veoh}' . $link_ . '{/veoh}'; } elseif (strpos($main_media->url, 'videotube.de') !== false) { // videotube.de link - begin $link_array = explode('watch/', $main_media->url); $link_ = $link_array[1]; $media = '{videotube}' . $link_ . '{/videotube}'; } elseif (strpos($main_media->url, 'vidiac.com') !== false) { // vidiac.com link - begin $begin_tag = strpos($main_media->url, 'video/'); $remaining_link = substr($main_media->url, $begin_tag + 6, strlen($main_media->url)); $end_tag = strpos($remaining_link, '.'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{vidiac}' . $link_ . '{/vidiac}'; } elseif (strpos($main_media->url, 'vimeo.com') !== false) { // vimeo.com link - begin $link_array = explode('.com/', $main_media->url); $link_ = $link_array[1]; $media = '{vimeo}' . $link_ . '{/vimeo}'; } elseif (strpos($main_media->url, 'yahoo.com') !== false) { // video.yahoo.com link - begin $link_array = explode('watch/', $main_media->url); $link_ = $link_array[1]; $media = '{yahoo}' . $link_ . '{/yahoo}'; } elseif (strpos($main_media->url, 'youare.tv') !== false) { // youare.tv link - begin $link_array = explode('id=', $main_media->url); $link_ = $link_array[1]; $media = '{youare}' . $link_ . '{/youare}'; } elseif (strpos($main_media->url, 'youku.com') !== false) { // youku.com link - begin $begin_tag = strpos($main_media->url, 'v_show/'); $remaining_link = substr($main_media->url, $begin_tag + 7, strlen($main_media->url)); $end_tag = strpos($remaining_link, '.'); if ($end_tag === false) { $end_tag = strlen($remaining_link); } $link_ = substr($remaining_link, 0, $end_tag); $media = '{youku}' . $link_ . '{/youku}'; } elseif (strpos($main_media->url, 'youmaker.com') !== false) { // youmaker.com link - begin $link_array = explode('id=', $main_media->url); $link_ = $link_array[1]; $media = '{youmaker}' . $link_ . '{/youmaker}'; } else { //----------- not special link - begin $extension_array = explode('.', $main_media->url); $extension = $extension_array[count($extension_array) - 1]; if (strtolower($extension) == 'flv' || strtolower($extension) == 'swf' || strtolower($extension) == 'mov' || strtolower($extension) == 'wmv' || strtolower($extension) == 'mp4' || strtolower($extension) == 'divx') { $tag_begin = '{' . strtolower($extension) . 'remote}'; $tag_end = '{/' . strtolower($extension) . 'remote}'; } if (!isset($tag_begin)) { $tag_begin = NULL; } if (!isset($tag_end)) { $tag_end = NULL; } $media = $tag_begin . $main_media->url . $tag_end; //----------- not special link - begin } $media = jwAllVideos($media, $aheight, $awidth, $vheight, $vwidth); } //$media = '<a target="_blank" href="'.$main_media->url.'">'.$main_media->name.'</a>'; if ($main_media->source == 'local') { $extension_array = explode('.', $main_media->local); $extension = $extension_array[count($extension_array) - 1]; //echo $extension; if (strtolower($extension) == 'flv' || strtolower($extension) == 'swf' || strtolower($extension) == 'mov' || strtolower($extension) == 'wmv' || strtolower($extension) == 'mp4' || strtolower($extension) == 'divx') { $tag_begin = '{' . strtolower($extension) . 'remote}'; $tag_end = '{/' . strtolower($extension) . 'remote}'; } if (!isset($tag_begin)) { $tag_begin = NULL; } if (!isset($tag_end)) { $tag_end = NULL; } $media = $tag_begin . $the_base_link . $configs->videoin . '/' . $main_media->local . $tag_end; $media = jwAllVideos($media, $aheight, $awidth, $vheight, $vwidth); } } if ($main_media->type == 'audio') { if ($main_media->source == 'code') { $media = $main_media->code; } if ($main_media->source == 'url') { $extension_array = explode('.', $main_media->url); $extension = $extension_array[count($extension_array) - 1]; if (strtolower($extension) == 'mp3' || strtolower($extension) == 'wma' || strtolower($extension) == 'm4a') { $tag_begin = '{' . strtolower($extension) . 'remote}'; $tag_end = '{/' . strtolower($extension) . 'remote}'; } $media = $tag_begin . $main_media->url . $tag_end; $media = jwAllVideos($media, $aheight, $awidth, $vheight, $vwidth); } if ($main_media->source == 'local') { $extension_array = explode('.', $main_media->local); $extension = $extension_array[count($extension_array) - 1]; if (strtolower($extension) == 'mp3' || strtolower($extension) == 'wma') { $tag_begin = '{' . strtolower($extension) . 'remote}'; $tag_end = '{/' . strtolower($extension) . 'remote}'; } $media = $tag_begin . $the_base_link . $configs->audioin . '/' . $main_media->local . $tag_end; $media = jwAllVideos($media, $aheight, $awidth, $vheight, $vwidth); } } if ($main_media->type == 'url') { $media = '<a target="_blank" href="' . $main_media->url . '">' . $main_media->name . '</a>'; } if ($main_media->type == 'docs') { if ($main_media->source == 'url') { $media = '<a target="_blank" href="' . $main_media->url . '">' . $main_media->name . '</a>'; } } if ($main_media->type == 'image') { $img_size = @getimagesize(JPATH_SITE . DS . $configs->imagesin . DS . 'media' . DS . 'thumbs' . $main_media->local); if (isset($img_size[0]) && isset($img_size[1])) { $img_width = $img_size[0]; $img_height = $img_size[1]; if ($img_width > 0 && $img_height > 0) { if ($main_media->width > 0) { $thumb_width = $main_media->width; $thumb_height = $img_height / ($img_width / $main_media->width); } elseif ($main_media->height > 0) { $thumb_height = $main_media->height; $thumb_width = $img_width / ($img_height / $main_media->height); } else { $thumb_height = 200; $thumb_width = $img_width / ($img_height / 200); } } if (isset($thumb_width) && isset($thumb_height)) { $media = '<img width="' . $thumb_width . '" height="' . $thumb_height . '" src="'; } else { $media = '<img src="'; } $media .= JURI::root() . "/" . $configs->imagesin . '/media/thumbs' . $main_media->local . '" />'; } } if ($main_media->type == 'text') { $media = $main_media->code; } if ($main_media->type == 'Article') { $media = getArticleById($main_media->code); } if ($main_media->type == "file") { $media = '<a target="_blank" href="' . JURI::ROOT() . $configs->filesin . '/' . $main_media->local . '">' . $main_media->name . '</a><br/><br/>' . $main_media->instructions; } if (!isset($media)) { return NULL; } return $media; }
echo '<td class="key" width="150px">'; echo '<label for="conf_payment_total" width="100" title="' . JText::_("COM_MATUKIO_TOTAL_AMOUNT") . '">'; echo JText::_("COM_MATUKIO_TOTAL_AMOUNT"); echo '</label>'; echo '</td>'; echo "<td>"; echo "<div id=\"conf_payment_total\"></div>"; echo "</tr>"; echo "</td>"; echo "</table>"; } // AGB echo "<br />"; $agb = MatukioHelperSettings::getSettings("agb_text", ""); if (!empty($agb)) { $link = JURI::ROOT() . "index.php?tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&option=" . JFactory::getApplication()->input->get('option') . "&view=agb"; echo MatukioHelperUtilsBooking::getCheckbox("agb", " ", false); echo "<a href=\"" . $link . "\" class=\"modal cjmodal\" rel=\"{handler: 'iframe', size: {x:700, y:500}}\">"; echo JTEXT::_('COM_MATUKIO_TERMS_AND_CONDITIONS'); echo "</a>"; } ?> </div> <div id="mat_control"> <div id="mat_control_inner"> <button id="btn_back" class="mat_button"><?php echo JTEXT::_("COM_MATUKIO_BACK"); ?> </button> <button id="btn_next" class="mat_button"><?php echo JTEXT::_("COM_MATUKIO_NEXT");
/** * Create the css * * $params JRegistry the module params * $prefix integer the prefix of the params * * @return Array of css */ static function createCss($params, $prefix = 'menu') { $css = array(); $csspaddingtop = ($params->get($prefix . 'paddingtop') and $params->get($prefix . 'usemargin')) ? 'padding-top: ' . $params->get($prefix . 'paddingtop', '0') . 'px;' : ''; $csspaddingright = ($params->get($prefix . 'paddingright') and $params->get($prefix . 'usemargin')) ? 'padding-right: ' . $params->get($prefix . 'paddingright', '0') . 'px;' : ''; $csspaddingbottom = ($params->get($prefix . 'paddingbottom') and $params->get($prefix . 'usemargin')) ? 'padding-bottom: ' . $params->get($prefix . 'paddingbottom', '0') . 'px;' : ''; $csspaddingleft = ($params->get($prefix . 'paddingleft') and $params->get($prefix . 'usemargin')) ? 'padding-left: ' . $params->get($prefix . 'paddingleft', '0') . 'px;' : ''; $css['padding'] = $csspaddingtop . $csspaddingright . $csspaddingbottom . $csspaddingleft; $cssmargintop = ($params->get($prefix . 'margintop') and $params->get($prefix . 'usemargin')) ? 'margin-top: ' . $params->get($prefix . 'margintop', '0') . 'px;' : ''; $cssmarginright = ($params->get($prefix . 'marginright') and $params->get($prefix . 'usemargin')) ? 'margin-right: ' . $params->get($prefix . 'marginright', '0') . 'px;' : ''; $cssmarginbottom = ($params->get($prefix . 'marginbottom') and $params->get($prefix . 'usemargin')) ? 'margin-bottom: ' . $params->get($prefix . 'marginbottom', '0') . 'px;' : ''; $cssmarginleft = ($params->get($prefix . 'marginleft') and $params->get($prefix . 'usemargin')) ? 'margin-left: ' . $params->get($prefix . 'marginleft', '0') . 'px;' : ''; $css['margin'] = $cssmargintop . $cssmarginright . $cssmarginbottom . $cssmarginleft; $css['background'] = ($params->get($prefix . 'bgcolor1') and $params->get($prefix . 'usebackground')) ? 'background: ' . $params->get($prefix . 'bgcolor1') . ';' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-image: url("' . JURI::ROOT() . $params->get($prefix . 'bgimage') . '");' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-repeat: ' . $params->get($prefix . 'bgimagerepeat') . ';' : ''; $css['background'] .= ($params->get($prefix . 'bgimage') and $params->get($prefix . 'usebackground')) ? 'background-position: ' . $params->get($prefix . 'bgpositionx') . ' ' . $params->get($prefix . 'bgpositiony') . ';' : ''; $css['gradient'] = ($css['background'] and $params->get($prefix . 'bgcolor2') and $params->get($prefix . 'usegradient')) ? "background: -moz-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%, " . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%);" . "background: -webkit-gradient(linear, left top, left bottom, color-stop(0%," . $params->get($prefix . 'bgcolor1', '#f0f0f0') . "), color-stop(100%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . ")); " . "background: -webkit-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%);" . "background: -o-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%);" . "background: -ms-linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%);" . "background: linear-gradient(top, " . $params->get($prefix . 'bgcolor1', '#f0f0f0') . " 0%," . $params->get($prefix . 'bgcolor2', '#e3e3e3') . " 100%); " . "filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='" . $params->get($prefix . 'bgcolor1', '#f0f0f0') . "', endColorstr='" . $params->get($prefix . 'bgcolor2', '#e3e3e3') . "',GradientType=0 );" : ''; $css['borderradius'] = $params->get($prefix . 'useroundedcorners') ? '-moz-border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' . '-webkit-border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' . 'border-radius: ' . $params->get($prefix . 'roundedcornerstl', '0') . 'px ' . $params->get($prefix . 'roundedcornerstr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbr', '0') . 'px ' . $params->get($prefix . 'roundedcornersbl', '0') . 'px;' : ''; $shadowinset = $params->get($prefix . 'shadowinset', 0) ? 'inset ' : ''; $css['shadow'] = ($params->get($prefix . 'shadowcolor') and $params->get($prefix . 'shadowblur') and $params->get($prefix . 'useshadow')) ? '-moz-box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' . '-webkit-box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' . 'box-shadow: ' . $shadowinset . $params->get($prefix . 'shadowoffsetx', '0') . 'px ' . $params->get($prefix . 'shadowoffsety', '0') . 'px ' . $params->get($prefix . 'shadowblur', '') . 'px ' . $params->get($prefix . 'shadowspread', '0') . 'px ' . $params->get($prefix . 'shadowcolor', '') . ';' : ''; $css['border'] = ($params->get($prefix . 'bordercolor') and $params->get($prefix . 'borderwidth') and $params->get($prefix . 'useborders')) ? 'border: ' . $params->get($prefix . 'bordercolor', '#efefef') . ' ' . $params->get($prefix . 'borderwidth', '1') . 'px solid;' : ''; $css['fontsize'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontsize')) ? 'font-size: ' . $params->get($prefix . 'fontsize') . ';' : ''; $css['fontcolor'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontcolor')) ? 'color: ' . $params->get($prefix . 'fontcolor') . ';' : ''; $css['fontweight'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'fontweight')) ? 'font-weight: ' . $params->get($prefix . 'fontweight') . ';' : ''; /* $css['fontcolorhover'] = ($params->get($prefix . 'usefont') AND $params->get($prefix . 'fontcolorhover')) ? 'color: ' . $params->get($prefix . 'fontcolorhover') . ';' : ''; */ $css['descfontsize'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'descfontsize')) ? 'font-size: ' . $params->get($prefix . 'descfontsize') . ';' : ''; $css['descfontcolor'] = ($params->get($prefix . 'usefont') and $params->get($prefix . 'descfontcolor')) ? 'color: ' . $params->get($prefix . 'descfontcolor') . ';' : ''; return $css; }
/** * adat form tárolása * &JRequest formfields * @return void */ public function save() { $document =& JFactory::getDocument(); $viewType = $document->getType(); $view =& $this->getView($this->_viewname, $viewType); $model =& $this->getModel($this->_mainmodel); $item = new stdclass(); $item->id = 1; $item->json = JRequest::getVar('json'); $view->setModel($model, true); if ($model->save($item)) { $this->setMessage(JText::_('BEALLITASOKTAROLVA')); $this->setRedirect(JURI::root() . 'index.php?option=com_temakorok&view=temakoroklist'); $this->redirect(); } else { $view->setLayout('form'); $item = $model->bind($_POST); $view->set('Item', $item); $view->set('Msg', $model->getMessage()); $view->set('okLink', JURI::ROOT() . '/index.php?option=com_beallitasok&view=beallitasok&task=save'); $view->set('cancelLink', JURI::root() . '/index.php?option=com_temakorok&view=temakoroklist'); $view->set('helpLink', JURI::root() . '/index.php?option=com_content&view=article&id=12&Itemid=435&tmpl=component'); $view->display(); } }