Esempio n. 1
0
 /**
  * create OAuth Link
  *
  * @param $options
  *  loading:      loading message
  *  login:        login link text
  *  datasource:   datasource name (default: twitter)
  *  authenticate: use authenticate link (default: false)
  */
 public function oauthLink($options = array())
 {
     $default = array('loading' => __d('twitter_kit', 'Loading...', true), 'login' => __d('twitter_kit', 'Login Twitter', true), 'datasource' => 'twitter', 'authorize' => false, 'loginElementId' => 'twitter-login-wrap');
     $options = am($default, $options);
     $action = $options['authorize'] ? 'authorize_url' : 'authenticate_url';
     $request_url = $this->Html->url(array('plugin' => 'twitter_kit', 'controller' => 'oauth', 'action' => $action . '/' . urlencode($options['datasource'])), true);
     $this->Js->buffer("\n            \$.getJSON('{$request_url}', {}, function(data){\n            var link = \$('<a>').attr('href', data.url).html('{$options['login']}');\n            \$('#{$options['loginElementId']} .loading').remove();\n            \$('#{$options['loginElementId']}').append(link);\n            });\n        ");
     $out = sprintf('<span id="%s"><span class="loading">%s</span></span>', $options['loginElementId'], $options['loading']);
     return $this->output($out);
 }
Esempio n. 2
0
 /**
  * getInstance
  *
  * @return JsHelper
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new JsHelper();
     }
     return self::$instance;
 }
Esempio n. 3
0
 /**
  * create tweet box
  *
  * @param $fieldName
  * @param $options
  *      type: element type (default: textarea)
  *      maxLength:   text max length (default: 140)
  *      counterText: length message
  *      submit: submit button message. if set to false, not create.
  *      jqueryCharCount: path to charCount.js (jquery plugin)
  *      other keys set to input element options.
  */
 public function tweet($fieldName, $options = array())
 {
     $this->setEntity($fieldName);
     $domId = !empty($options['id']) ? $options['id'] : $this->domId($fieldName);
     $default = array('type' => 'textarea', 'maxlength' => 140, 'jqueryCharCount' => '/twitter_kit/js/charCount.js', 'counterText' => __d('twitter_kit', 'Characters left: ', true), 'submit' => __d('twitter_kit', 'Tweet', true));
     $options = am($default, $options);
     $inputOptions = $options;
     unset($inputOptions['jqueryCharCount']);
     unset($inputOptions['counterText']);
     unset($inputOptions['submit']);
     $out = $this->Html->script($options['jqueryCharCount']);
     $out .= $this->Form->input($fieldName, $inputOptions);
     $out .= $this->Js->buffer("\n            \$('#{$domId}').charCount({\n                limit: {$options['maxlength']},\n                counterText: '{$options['counterText']}',\n                exceeded: function(element) {\n                    \$('#{$domId}Submit').attr('disabled', true);\n                },\n                allowed: function(element) {\n                    \$('#{$domId}Submit').removeAttr('disabled');\n                }\n            });\n        ");
     if ($options['submit']) {
         $out .= $this->Form->submit($options['submit'], array('id' => $domId . 'Submit'));
     }
     return $this->output($out);
 }
Esempio n. 4
0
    function test_javascript_tag()
    {
        $foo = JsHelper::javascript_tag("alert('All is good')");
        $exp = <<<EXPECTED
<script type="text/javascript">
//<![CDATA[
alert('All is good')
//]]>
</script>
EXPECTED;
        $this->assertEqual($exp, $foo);
    }
 /**
  * Test prepareUrl method
  * 
  * @return void
  */
 public function testPrepareUrl()
 {
     $expected = $url = array('controller' => 'articles', 'action' => 'view', 'my-first-article');
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
     $this->Js->setReturnValue('get', $this->Js);
     $this->Js->setReturnValue('effect', '');
     $this->CommentWidget->options(array('target' => 'placeholder', 'ajaxAction' => 'add'));
     $expected['action'] = 'add';
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
     $this->CommentWidget->options(array('target' => 'placeholder', 'ajaxAction' => array('controller' => 'comments', 'action' => 'add')));
     $expected = array('controller' => 'comments', 'action' => 'add', 'my-first-article');
     $this->assertEqual($this->CommentWidget->prepareUrl($url), $expected);
 }
Esempio n. 6
0
 /**
  * create Hovercards
  *
  * @param string $element
  * @param array  $options
  */
 public function hovercards($element = '.content', $options = array())
 {
     if (!empty($options['username'])) {
         $username = $options['username'];
         unset($options['username']);
     }
     $opt = '';
     if (!empty($options)) {
         $opt = json_encode($options);
     }
     if (!empty($username)) {
         if (empty($options)) {
             $opt = "{ username: {$username} }";
         } else {
             $opt = preg_replace('/^{/', "{ username: {$username},", $opt);
         }
     }
     $this->Js->buffer("\n        twttr.anywhere(function (T) {\n            T('{$element}').hovercards({$opt});\n        });");
 }
Esempio n. 7
0
				<div class="span9">
					<div class="btn-toolbar">
						<div class="filter-search btn-group"><?php 
echo JHtml::calendar($this->state->get('filter.from_date'), 'filter_from_date', 'filter_from_date', '%Y-%m-%d', 'for =1 placeholder="From date" style="width: 100px;"');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo JHtml::calendar($this->state->get('filter.to_date'), 'filter_to_date', 'filter_to_date', '%Y-%m-%d', 'for =1 placeholder="To date" style="width: 100px;"');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo JsHelper::timepicker($this->state->get('filter.from_time'), 'filter_from_time', 'filter_from_time', 'class="input-mini" title="From time" placeholder="From time"', 'showMeridian : false,defaultTime: false');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo JsHelper::timepicker($this->state->get('filter.to_time'), 'filter_to_time', 'filter_to_time', 'class="input-mini" title="To time" placeholder="To time"', 'showMeridian : false,defaultTime: false');
?>
</div>
						
						<div><?php 
echo $this->getTransportType();
echo $this->getRoute();
?>
</div>
						
						
					</div>	
					<div class="btn-toolbar">
						
						<div class="filter-search btn-group"><?php 
echo $this->getAirportFrom();
Esempio n. 8
0
<?php

/**
 * @package 	Bookpro
 * @author 		Ngo Van Quan
 * @link 		http://joombooking.com
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id$
 **/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
AImporter::helper('date', 'currency', 'js');
jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('mod_jbtour_search');
JsHelper::checkTimeOutScript('tour');
?>
<legend>Update search</legend>
<div class="well well-small"><?php 
echo JModuleHelper::renderModule($module);
?>
</div>

<form name="frontForm" id="tour_list_form" method="post" action='index.php'>
<table class="table table_tour">
	<thead>
		<tr>
			
			<th width="15%"><?php 
echo JText::_('COM_BOOKPRO_TOUR_NO');
?>
Esempio n. 9
0
 /**
  * Returns a JavaScript tag with the '$content' inside.
  * Example:
  *   JsHelper::javascript_tag("alert('All is good')");
  *   => <script type="text/javascript">alert('All is good')</script>
  *
  * @param type <description>
  *
  * @return type <description>
  */
 function javascript_tag($content)
 {
     return TagHelper::content_tag('script', JsHelper::js_cdata_section($content), array('type' => 'text/javascript'));
 }
Esempio n. 10
0
 /**
  * @ignore
  */
 function build_observer($klass, $name, $options = array())
 {
     if (!isset($options['with']) && $options['update']) {
         $options['with'] = 'value';
     }
     $callback = PrototypeHelper::remote_function($options);
     $javascript = 'new ' . $klass . '("' . $name . '", ';
     if (isset($options['frequency'])) {
         $javascript .= $options['frequency'] . ", ";
     }
     $javascript .= 'function(element, value) {';
     $javascript .= $callback . '});';
     return JsHelper::javascript_tag($javascript);
 }
Esempio n. 11
0
 * @version 	$Id: default.php  23-06-2012 23:33:14
 **/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
AImporter::helper('date', 'bookpro', 'currency', 'form', 'js', 'transport');
JHtml::_('jquery.framework');
JHtml::_('jquery.ui');
$lang = JFactory::getLanguage();
$local = substr($lang->getTag(), 0, 2);
$doc = JFactory::getDocument();
$doc->addScript("http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
$doc->addScript("http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/localization/messages_" . $local . ".js");
$doc->addScript(JURI::base() . "/components/com_bookpro/assets/js/jbtransport.js");
AImporter::css('jbtransport');
//check session timeout
JsHelper::checkTimeOutScript();
$total_pass = $this->cart->adult + $this->cart->child;
?>
<h1><?php 
echo JText::_('COM_BOOKPRO_TRANSPORT_CHOOSE_VEHICLE');
?>
</h1>
<?php 
echo JLayoutHelper::render('transport_process_bar', 3, JPATH_ROOT . '/components/com_bookpro/layouts');
?>
<form name="transportVehicle" action='index.php' method="post" id="transportVehicle"> 
	<div >
		<div class="row-fluid">
			
			<div class="span4">
			<?php 
Esempio n. 12
0
}
if (isset($required_fields)) {
    // Output JavaScript to validate form (make sure required fields are filled out)
    $js = 'reqField="' . $lang_common['required field'] . '";reqFormLang={';
    while (list($elem_orig, $elem_trans) = each($required_fields)) {
        $js .= $elem_orig . ':"' . addslashes(str_replace('&nbsp;', ' ', $elem_trans)) . '",';
    }
    $js = rtrim($js, ',') . '};';
    JsHelper::getInstance()->addInternal($js);
    JsHelper::getInstance()->add(PUN_ROOT . 'js/required.js');
}
if (in_array($basename, array('post.php', 'viewtopic.php', 'edit.php'))) {
    JsHelper::getInstance()->add(PUN_ROOT . 'js/board.js');
}
if (in_array($basename, array('message_list.php', 'moderate.php'))) {
    JsHelper::getInstance()->add(PUN_ROOT . 'js/check.js');
}
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_head>
// START SUBST - <body>
if (isset($focus_element)) {
    $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus();', $tpl_main);
    $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus();">', $tpl_main);
}
// END SUBST - <body>
if (isset($hint_box)) {
    $tpl_temp = $hint_box;
} else {
    $tpl_temp = null;
Esempio n. 13
0
			setTimeout(function(){
				$("#header_error").text("<?php 
echo Yii::t('site', 'There was an error getting data from the server to your device. Please check your internet connection. Retrying in 10 seconds.');
?>
");
				$("#header_error").show();
				}
			,5000);
			
			var ba = setTimeout(function(){$("#header_error").hide()},10000);
			var bb = setTimeout("get_Contents()",<?php 
echo Yii::app()->params['request_interval'];
?>
000 + 5000);//There was an error loading content, lets make a new request to try to get content again
		}
	);
}
function clear_preload(){
	$("#preload").hide();
	$("#page").show();
}
function check_preload(){
	if(preload_time_passed >=5){
		clear_preload();
		window.clearInterval(interval_check);
	}
}
<?php 
echo JsHelper::comments_voting();
echo JsHelper::subject_voting();
Esempio n. 14
0
 function showContainer()
 {
     global $lang_poll;
     JsHelper::getInstance()->add(PUN_ROOT . 'js/jquery.punmodalbox.js');
     JsHelper::getInstance()->add(PUN_ROOT . 'js/poll.js');
     return '<fieldset><legend>' . $lang_poll['poll'] . '</legend><div class="infldset txtarea"><input type="hidden" name="has_poll" id="has_poll" value="0" /><label><a id="apcreate" class="crtpoll" href="#">' . $lang_poll['create'] . '</a></label><div id="ppreview" style="display:none;position:relative;"></div></div></fieldset><br class="clearb" />';
 }
Esempio n. 15
0
 public function exportJson($sPlace = self::C_REQUEST)
 {
     return JsHelper::jsonEncode($this->export($sPlace));
 }
Esempio n. 16
0
}
if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == 1) {
    if ($cur_topic['is_subscribed']) {
        // I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
        $subscraction = '<p class="subscribelink clearb">' . $lang_topic['Is subscribed'] . ' - <a href="misc.php?unsubscribe=' . $id . '">' . $lang_topic['Unsubscribe'] . '</a></p>';
    } else {
        $subscraction = '<p class="subscribelink clearb"><a href="misc.php?subscribe=' . $id . '">' . $lang_topic['Subscribe'] . '</a></p>';
    }
} else {
    $subscraction = '<div class="clearer"></div>';
}
$page_title = pun_htmlspecialchars($pun_config['o_board_title'] . ' / ' . $cur_topic['subject']);
define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT . 'header.php';
if ($pun_config['o_show_post_karma'] == 1 || $pun_user['g_id'] < PUN_GUEST) {
    JsHelper::getInstance()->add(PUN_ROOT . 'js/karma.js');
}
echo '<div class="linkst"><div class="inbox">
<p class="pagelink conl">' . $paging_links . '</p>
<p class="postlink conr">' . $post_link . '</p>
<ul><li><a href="index.php">' . $lang_common['Index'] . '</a></li><li> &#187; <a href="viewforum.php?id=' . $cur_topic['forum_id'] . '">' . pun_htmlspecialchars($cur_topic['forum_name']) . '</a></li><li> &#187; ' . pun_htmlspecialchars($cur_topic['subject']) . '</li></ul>
<div class="clearer"></div></div></div>';
include_once PUN_ROOT . 'include/parser.php';
// hcs AJAX POLL MOD BEGIN
if ($pun_config['poll_enabled'] == 1) {
    include_once PUN_ROOT . 'include/poll/poll.inc.php';
    if ($cur_topic['has_poll']) {
        echo $Poll->showPoll($cur_topic['has_poll']);
    }
}
// hcs AJAX POLL MOD END
Esempio n. 17
0
 public function __construct(View $View, array $settings = array())
 {
     // proxy settings to Baklava helper
     $this->helpers['Baklava.Baklava'] = array_merge($settings, array('className' => null));
     parent::__construct($View, $settings);
 }
Esempio n. 18
0
<?php

$this->pageTitle = Yii::app()->name . ' - ' . $model->title;
$sub_data = SiteHelper::subject_content($model, 'array');
$this->ogtags = SiteHelper::get_ogtags($this->pageTitle, $model->content_type_id == 2 ? SiteHelper::subject_content($model) : $model->user_comment, $sub_data['image'], Yii::app()->params['weburl'] . '/sub/' . $model->urn, $sub_data['url']);
/*
 $(document).ready(function() {
});*/
$code = JsHelper::comments_voting();
Yii::app()->clientScript->registerScript('commentsvoting', $code);
$code2 = JsHelper::subject_voting();
Yii::app()->clientScript->registerScript('subjectvoting', $code2);
$code3 = 'var updateSubReadyCheck=setInterval(function(){
if( typeof window.getallData !== "undefined" ) {
	if( typeof window.getallData.session_username !== "undefined" ) {
		if( window.getallData.session_userid == ' . $model->user_id . ') {
			$("#sub_info_column").prepend(\'<div class="detail_section"><h3 class="detail_header">Settings</h3><div style="float:left;">' . CHtml::link(Yii::t('subject', 'updateSubject'), array('subject/update/' . $model->id)) . '</div><div style="float:left; padding-left:10px"><br></div><div class="clear_both"></div></div>\');
		}
	}
	clearInterval(updateSubReadyCheck);
}
},1000);
';
Yii::app()->clientScript->registerScript('updatesub', $code3);
?>

<h1><?php 
echo CHtml::encode($model->title);
?>
</h1>
Esempio n. 19
0
Copyright (C) 2007 artoodetoo (master@1wd.ru)

Included from: edit.php, filemap.php, viewtopic.php

Incoming variables:
$attachments: array - cache of attachments records
 ************************************************************************/
if (@$attachments) {
    $thumb_height = $pun_config['file_thumb_height'];
    $thumb_width = $pun_config['file_thumb_width'];
    $pview_height = $pun_config['file_preview_height'];
    $pview_width = $pun_config['file_preview_width'];
    $tmp = array();
    foreach ($attachments as $post_attachments) {
        foreach ($post_attachments as $attachment) {
            // generate preview images just-in-time
            if (preg_match('/^image\\/(.*)$/i', $attachment['mime'], $regs)) {
                $pview_fname = require_thumb($attachment['id'], $attachment['location'], $pview_width, $pview_height, false);
                $thumb_fname = require_thumb($attachment['id'], $attachment['location'], $thumb_width, $thumb_height, true);
                $img_size = ' (' . $regs[1] . ' ' . $attachment['image_dim'] . ')';
            } else {
                $thumb_fname = $img_size = null;
            }
            $tmp[] = "'" . $attachment['id'] . "': [" . "'" . format_time($attachment['uploaded']) . "'," . "'" . pun_htmlspecialchars($attachment['filename']) . "'," . "'" . $lang_fu['Size'] . ': ' . round($attachment['size'] / 1024, 1) . 'kb ' . $img_size . ' ' . $lang_fu['Downloads'] . ': ' . $attachment['downloads'] . "','" . $thumb_fname . "'," . intval(isset($attachment['can_download']) ? $attachment['can_download'] : $can_download) . ']';
        }
    }
    JsHelper::getInstance()->addInternal('ATTACH_DATA={' . implode(',', $tmp) . '};');
    unset($tmp);
}
JsHelper::getInstance()->add(PUN_ROOT . 'js/pop.js');
echo '<div id="pun-popup" class="punpopup"><p id="pun-title" class="popup-title">title</p><p id="pun-desc" class="popup-desc">Description</p><p id="pun-body" class="popup-body">Body</p></div>';
Esempio n. 20
0
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id$
 **/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
$items = $this->items;
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$search_type = $this->state->get('filter.search_type');
$search_key = $this->state->get('filter.search');
$isPassengerSearch = !empty($search_key) && $search_type == 'passenger';
JHTML::_('behavior.modal');
JHtml::_('jquery.framework');
JHtml::_('formbehavior.chosen', '.select-2');
$show = $this->state->get('filter.station_id') || $this->state->get('filter.airport_id') || $this->state->get('filter.group_id') == 0;
JsHelper::advanceSearchBox('#advance_search', '#advance_search_desc', $show);
$document = JFactory::getDocument();
$document->addScript(JURI::root() . 'components/com_bookpro/assets/js/bootstrap-datepicker.js');
$document->addScript(JURI::root() . 'components/com_bookpro/assets/js/locales/bootstrap-datepicker.' . substr($lang->getTag(), 0, 2) . '.js');
$document->addStyleSheet(JURI::root() . 'components/com_bookpro/assets/css/datepicker.css');
$fromDate = $this->state->get('filter.from_date');
$toDate = $this->state->get('filter.to_date');
$js_dateformat = DateHelper::getConvertDateFormat('J');
$php_dateformat = DateHelper::getConvertDateFormat('P');
//get authorise of agent
$manager_authorise = $this->authorise->order_manager;
?>


<!-- Calendar -->
<script type="text/javascript">
Esempio n. 21
0
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id: default.php  23-06-2012 23:33:14
 **/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
AImporter::helper('date', 'bookpro', 'currency', 'form', 'js');
JHtml::_('jquery.framework');
//JsHelper::addTimePickerLib();
$lang = JFactory::getLanguage();
$local = substr($lang->getTag(), 0, 2);
$doc = JFactory::getDocument();
$doc->addScript("http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
$doc->addScript("http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/localization/messages_" . $local . ".js");
//check session timeout
JsHelper::checkTimeOutScript('transport');
?>

<script type="text/javascript">
	jQuery(document).ready(function($){
		$("#frontForm").validate({
		    lang: '<?php 
echo $local;
?>
',
			rules: {
				firstname: "required",
				lastname: "required",
				email: {
					required: true,
					email: true
Esempio n. 22
0
 /**
  * Makes the elements with the DOM ID specified by '$element_id' sortable
  * by drag-and-drop and make an AJAX call whenever the sort order has
  * changed. By default, the action called gets the serialized sortable
  * element as parameters.
  *
  * Example:
  *   <php echo sortable_element($my_list, array(
  *      'url' => '@order',
  *   )) ?>
  *
  * In the example, the action gets a '$my_list' array parameter
  * containing the values of the ids of elements the sortable consists
  * of, in the current order.
  *
  * You can change the behaviour with various options, see
  * http://script.aculo.us for more documentation.
  */
 function sortable_element($element_id, $options = array())
 {
     if (!isset($options['with'])) {
         $options['with'] = "Sortable.serialize('{$element_id}')";
     }
     if (!isset($options['onUpdate'])) {
         $options['onUpdate'] = sprintf('function(){%s}', PrototypeHelper::remote_function($options));
     }
     foreach (PrototypeHelper::get_ajax_options() as $key) {
         unset($options[$key]);
     }
     foreach (array('tag', 'overlap', 'constraint', 'handle') as $option) {
         if (isset($options[$option])) {
             $options[$option] = "'{$options[$option]}'";
         }
     }
     if (isset($options['containment'])) {
         $options['containment'] = self::array_or_string_for_javascript($options['containment']);
     }
     if (isset($options['hoverclass'])) {
         $options['hoverclass'] = "'{$options['hoverclass']}'";
     }
     if (isset($options['only'])) {
         $options['only'] = self::array_or_string_for_javascript($options['only']);
     }
     return JsHelper::javascript_tag(sprintf("Sortable.create('%s', %s)", $element_id, JsHelper::options_for_javascript($options)));
 }
Esempio n. 23
0
<?php

// Make sure no one attempts to run this script "directly"
if (!defined('PUN')) {
    exit;
}
$footer_style = isset($footer_style) ? $footer_style : '';
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_main>
// JS_HELPER MOD BEGIN
if (JsHelper::getInstance()->count() > 0 || JsHelper::getInstance()->countInternal() > 0) {
    JsHelper::getInstance()->addFirst('//code.jquery.com/jquery-1.12.0.min.js');
    $tpl_main = str_replace('<pun_js_helper>', JsHelper::getInstance()->headerOut(), $tpl_main);
} else {
    $tpl_main = str_replace('<pun_js_helper>', '', $tpl_main);
}
// JS_HELPER MOD END
// START SUBST - <pun_footer>
ob_start();
echo '<div id="brdfooter" class="block"><h2><span>' . $lang_common['Board footer'] . '</span></h2><div class="box"><div class="inbox">';
//PMS MOD BEGIN
require PUN_ROOT . 'include/pms/footer_links.php';
//PMS MOD END
if ($footer_style == 'index' || $footer_style == 'search') {
    if (!$pun_user['is_guest']) {
        echo '<dl id="searchlinks" class="conl"> <dt><strong>' . $lang_common['Search links'] . '</strong></dt> <dd><a href="search.php?action=show_24h">' . $lang_common['Show recent posts'] . '</a></dd> <dd><a href="search.php?action=show_unanswered">' . $lang_common['Show unanswered posts'] . '</a></dd>';
        if ($pun_config['o_subscriptions'] == 1) {
            echo '<dd><a href="search.php?action=show_subscriptions">' . $lang_common['Show subscriptions'] . '</a></dd>';
        }
Esempio n. 24
0
function do_hide($text, $post = 0, $matches)
{
    global $pun_user, $lang_topic, $lang_common;
    include_once PUN_ROOT . 'lang/' . $pun_user['language'] . '/topic.php';
    $matches[3] = intval($matches[3]);
    /**
     * Если автор указал [hide=(\d+)][/hide] с параметром,
     * то он ограничил читателя, в возмозможности просматривать скрытый текст,
     * по кол-ву написанных читателем сообщений в форум.
     **/
    if ($pun_user['num_posts'] < $matches[3]) {
        return str_replace($matches[0], str_replace(array('%num_posts%', '%posts%'), array($pun_user['num_posts'], $matches[3]), $lang_common['BBCode posts']), $text);
    }
    $basename = basename($_SERVER['PHP_SELF']);
    if (pathinfo(dirname($_SERVER['PHP_SELF']), PATHINFO_FILENAME) == 'wap') {
        if ($basename == 'hide.php') {
            return str_replace($matches[0], '<div class="attach_list">' . $matches[4] . '</div>', $text);
        }
        return str_replace($matches[0], '<div class="attach_list"><a onclick="window.open(\'hide.php?id=' . $post . '\', \'\', \'width=420,height=230,resizable=yes,scrollbars=yes,status=yes,location=no\'); return false;" target="_blank" href="hide.php?id=' . $post . '">' . $lang_topic['Show'] . '</a></div>', $text);
    }
    if ($basename == 'viewprintable.php') {
        return str_replace($matches[0], '<div class="spoiler" style="display: block;"><strong>' . $lang_topic['Hide'] . '</strong><br/>' . $matches[4] . '</div>', $text);
    }
    JsHelper::getInstance()->add(PUN_ROOT . 'js/spoiler.js');
    return str_replace($matches[0], '<div><input type="button" value="' . $lang_topic['Hide'] . '" onclick="spoiler(this.nextSibling);"/><div class="spoiler"><br/>' . $matches[4] . '</div></div>', $text);
}
Esempio n. 25
0
echo $this->form->getLabel('start_time');
?>
</div>
					<div class="controls"><?php 
echo JsHelper::timepicker($this->item->start_time, 'jform[start_time]', 'jform_start_time');
?>
</div>
				</div> 
				
				<div class="control-group">
					<div class="control-label"><?php 
echo $this->form->getLabel('return_time');
?>
</div>
					<div class="controls"><?php 
echo JsHelper::timepicker($this->item->return_time, 'jform[return_time]', 'jform_return_time');
?>
</div>
				</div> 		
								
								
				<div class="control-group">
					<div class="control-label"><?php 
echo $this->form->getLabel('days');
?>
</div>
					<div class="controls"><?php 
echo $this->form->getInput('days');
?>
</div>
				</div>
		<?php 
$lang = JFactory::getLanguage();
$local = substr($lang->getTag(), 0, 2);
$doc = JFactory::getDocument();
AImporter::helper('tour');
$cart = $displayData;
$passengers = TourHelper::getPassengerForm($cart->filter['adult'], $cart->filter['child'], $cart->filter['infant']);
JsHelper::addDatePickerLib();
$doc->addScript(JURI::base() . 'components/com_bookpro/assets/js/view-tourconfirm.js');
$depart_start = $cart->filter['start'];
$p_mindate = JFactory::getDate($depart_start);
$p_mindate->modify('+2 day');
//adult old year >12
$a_mindate = JFactory::getDate($depart_start)->sub(new DateInterval('P108Y'));
$a_maxdate = JFactory::getDate($depart_start)->sub(new DateInterval('P12Y'));
$a_maxdate->modify('+1 day');
//(2-12)
$c_mindate = JFactory::getDate($depart_start)->sub(new DateInterval('P12Y'));
$c_mindate->modify('+2 day');
$c_maxdate = JFactory::getDate()->sub(new DateInterval('P3D'));
//(<2)
$i_mindate = JFactory::getDate($depart_start)->sub(new DateInterval('P2Y'));
$i_mindate->modify('+2 day');
$js = '
		    var a_mindate="' . $a_mindate->format('Y-m-d') . '";
		    var a_maxdate="' . $a_maxdate->format('Y-m-d') . '";
		    var c_mindate="' . $c_mindate->format('Y-m-d') . '";
		    var c_maxdate="' . $c_maxdate->format('Y-m-d') . '";
		    var i_mindate="' . $i_mindate->format('Y-m-d') . '";		
		    var dateFormat="' . DateHelper::getConvertDateFormat('J') . '";
		';
Esempio n. 27
0
<?php

if (!$pun_user['is_guest'] && $pun_user['g_pm'] == 1 && $pun_config['o_pms_enabled'] && $pun_user['messages_enable'] == 1) {
    include PUN_ROOT . 'lang/' . $pun_user['language'] . '/pms.php';
    // Check for new messages
    $result_messages = $db->query('SELECT COUNT(1) FROM ' . $db->prefix . 'messages WHERE showed=0 AND owner=' . $pun_user['id']) or error('Unable to check for new messages', __FILE__, __LINE__, $db->error());
    $new_msg = $db->fetch_row($result_messages);
    if ($new_msg[0] > 0) {
        $tpl_temp .= '<li class="pmlink"><strong><a href="message_list.php"> ' . $lang_pms['New messages'] . ' (' . $new_msg[0] . ')</a></strong></li>';
        if ($pun_user['popup_enable'] == 1) {
            $result = $db->query('SELECT id FROM ' . $db->prefix . 'messages WHERE popup=0 AND owner=' . $pun_user['id'] . ' ORDER BY id DESC') or error('Unable update popup status', __FILE__, __LINE__, $db->error());
            $return = $db->fetch_row($result);
            if ($return[0]) {
                JsHelper::getInstance()->addInternal('window.open("' . PUN_ROOT . 'message_popup.php?id=' . $return[0] . '","NewPM","width=760,height=200,resizable=yes,scrollbars=yes");');
                $db->query('UPDATE ' . $db->prefix . 'messages SET popup=1 WHERE popup=0 AND owner=' . $pun_user['id']) or error('Unable to update popup status', __FILE__, __LINE__, $db->error());
            }
        }
    }
    // Check if the inbox is full
    $result = $db->query('SELECT COUNT(1) FROM ' . $db->prefix . 'messages WHERE owner=' . $pun_user['id']) or error('Unable to test if the message-box is full', __FILE__, __LINE__, $db->error());
    $count = $db->fetch_row($result);
    // Display error message
    if ($count[0] >= $pun_user['g_pm_limit']) {
        $tpl_temp .= '<li class="pmlink"><strong><a href="message_list.php">' . $lang_pms['Full inbox'] . '</a></strong></li>';
    }
}
Esempio n. 28
0
Show buttons above edit and post form.
This file is part of Elektra File Upload mod for PunBB.

Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
Copyright (C) 2007 artoodetoo (master@1wd.ru)

Included from: edit.php, post.php

Incoming variables;

Outgoing variables:
$attachments: array - cache of attachments records
 ************************************************************************/
JsHelper::getInstance()->add(PUN_ROOT . 'js/reply.js');
JsHelper::getInstance()->addInternal('
var post_form = \'' . $focus_element[0] . '\';
var txt	 = \'\';
var text_enter_title = \'' . $lang_fu['JS enter title'] . '\';
var text_enter_url = \'' . $lang_fu['JS enter url'] . '\';
var text_enter_url_name = \'' . $lang_fu['JS enter url name'] . '\';
var text_enter_image = \'' . $lang_fu['JS enter image'] . '\';
var text_enter_email = \'' . $lang_fu['JS enter email'] . '\';
var error_no_url = \'' . $lang_fu['JS no url'] . '\';
var error_no_title = \'' . $lang_fu['JS no title'] . '\';
var error_no_email = \'' . $lang_fu['JS no email'] . '\';
');
?>
<div id="buttonmenu">
    <ul>
        <li><a href="#" onclick="return insert_text('[b]', '[/b]');"><strong>B</strong></a></li>
Esempio n. 29
0
</div>

<!-- START DASHBOARD CHART -->
<?php 
/*<div class="block-full-width">
	<div id="dashboard-chart" style="height: 250px; width: 100%; float: left;"></div>
	<div class="chart-legend">
		<div id="dashboard-legend"></div>
	</div>                                                
</div>*/
?>
                  
<!-- END DASHBOARD CHART -->

<?php 
JsHelper::graphMorrisJs();
?>

<script type="text/javascript">
$(function(){        
    Morris.Bar({
        element: 'dashboard-bar-1',
        data: [
            { y: 'Jan 15', a: 75, b: 35 },
            { y: 'Feb 15', a: 64, b: 26 },
            { y: 'Mar 15', a: 78, b: 39 },
        ],
        xkey: 'y',
        ykeys: ['a', 'b'],
        labels: ['New', 'Resign'],
        barColors: ['#33414E', '#3FBAE4'],
Esempio n. 30
0
	blink_page_title(current_title);
	$("#comment_textarea").attr('disabled',false);
			
}



var interval_check;
$(document).ready(function() {
	get_Contents(function(){
		//Add this callback only the first time after we fetch content
		interval_check = setInterval("check_preload()",1000);	
	});
		//We need to iframe the layer as it is windowed element and we are working with different user content
		//adata a as swf flash that dont have wmode=opaque
		$('<iframe src="about:blank" width="980" height="900" id="frame_box" frameBorder="0" scrolling="no" style="display:none; background-color:white; z-index:9000; position:absolute;"></iframe>').prependTo('#main_body');
		 setTimeout(function (){
		 $('#frame_box').contents().find('body').html('<p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center"><b><font size="7" face="Trebuchet MS" color="#3F3F3F"><?php 
echo Yii::t('site', 'Next sub is:');
?>
</font></b></p><p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center">&nbsp;</p><p align="center" style="font: normal 14px Trebuchet MS, Arial, Helvetica, sans-serif; color:#3F3F3F;"><b><?php 
echo CHtml::link(Yii::t('subject', 'You can add your own sub here'), Yii::app()->getRequest()->getBaseUrl(true) . "/subject/add", array('target' => '_top'));
?>
</b></p>');
		 },3000); 
		 
});

<?php 
echo JsHelper::comments_voting();