本文整理汇总了PHP中JURI::ROOT方法的典型用法代码示例。如果您正苦于以下问题:PHP JURI::ROOT方法的具体用法?PHP JURI::ROOT怎么用?PHP JURI::ROOT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JURI
的用法示例。
在下文中一共展示了JURI::ROOT方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBackendPrintWindow
/**
* 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;
}
示例2: array
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();
示例3: 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\">";
示例4:
// 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>";
示例5: getCalendarButton
/**
* 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> ";
}
示例6: GetAttachmentLink
function GetAttachmentLink($folder,$filename,$name,$title = '', $rel = 'nofollow') {
return self::GetHrefLink ( JURI::ROOT()."{$folder}/{$filename}", $name, $title, $rel );
}
示例7: json_encode
<?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') {
示例8: getSitePath
/**
* sem_f004()
* @return mixed
*/
public static function getSitePath()
{
return JURI::ROOT();
}
示例9: GetAttachmentLink
function GetAttachmentLink($folder, $filename, $name, $title = '', $rel = 'nofollow')
{
return CKunenaLink::GetHrefLink(JURI::ROOT() . $folder . '/' . $filename, $name, $title, $rel);
}
示例10: _getAttachementLink
/**
* @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>';
}
示例11: parse_media
//.........这里部分代码省略.........
$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"
示例12: createCss
/**
* 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;
}
示例13: renderImageList
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;
}
示例14: _get
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;
}
示例15: parse_media
//.........这里部分代码省略.........
}
}
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);
}