예제 #1
0
$doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/datepicker.css');
$doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/view_paymentsetting_default.js');
$doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/view_paymentsetting_default.less');
AdminUIHelper::startAdminArea($this);
$js_content = '';
$app = JFactory::getApplication();
ob_start();
?>
<script type="text/javascript">
    jQuery(document).ready(function ($) {
        $('.view-paymentsetting-default').view_paymentsetting_default({});
    });
</script>
<?php 
$js_content = ob_get_clean();
$js_content = TSMUtility::remove_string_javascript($js_content);
$doc->addScriptDeclaration($js_content);
?>
<div class="view-paymentsetting-default">
    <form action="index.php" method="post" class="form-horizontal" name="adminForm" id="adminForm">
        <!--<table>
		<tr>
			<td width="100%">
				<?php 
/*echo $this->displayDefaultViewSearch ('com_tsmart_CURRENCY','search') ; */
?>
			</td>
		</tr>
		</table>-->
        <div id="editcell">
            <div class="vm-page-nav">
예제 #2
0
    public function display($tpl = null)
    {
        $view = vRequest::getCmd('view', vRequest::getCmd('controller', 'tsmart'));
        $doc = JFactory::getDocument();
        $input = JFactory::getApplication()->input;
        $this->add_new_popup = $input->get('add_new_popup', 0, 'string');
        $this->close_window_children = $input->get('close_window_children', 0, 'int');
        $this->show_in_parent_window = $input->get('show_in_parent_window', 0, 'int');
        $dialog_element_id = $input->get('dialog_element_id', '', 'string');
        $close_ui_dialog_id = $input->get('ui_dialog_id', '', 'string');
        $parent_ui_dialog_id = $input->get('ui_dialog_id', '', 'string');
        $link_reload = $input->get('link_redirect', base64_encode('index.php?option=com_tsmart&view=' . $view), 'string');
        $parent_iframe_id = $input->get('iframe_id', '', 'string');
        $reload_iframe_id = $input->get('reload_iframe_id', '', 'string');
        $remove_ui_dialog = $input->get('remove_ui_dialog', false, 'boolean');
        $small_form = $input->get('small_form', 0, 'int');
        if ($this->show_in_parent_window == 1) {
            $doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/asianventure_edit_from.js');
            $doc->addScript(JUri::root() . '/media/system/js/base64.js');
            $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/view_component.less');
            $js_content = '';
            ob_start();
            ?>
            <script type="text/javascript">
                jQuery(document).ready(function ($) {
                    $('.admin.com_tsmart.view-<?php 
            echo $view;
            ?>
').asianventure_edit_from({
                        show_in_parent_window:<?php 
            echo $this->show_in_parent_window == 1 ? 1 : 0;
            ?>
,
                        view_height:<?php 
            echo $this->view_height ? $this->view_height : 0;
            ?>
,
                        close_window_children:<?php 
            echo $this->close_window_children;
            ?>
,
                        dialog_element_id:'<?php 
            echo $dialog_element_id;
            ?>
',
                        link_reload:'<?php 
            echo $link_reload;
            ?>
',
                        parent_iframe_id:'<?php 
            echo $parent_iframe_id;
            ?>
',
                        parent_ui_dialog_id:'<?php 
            echo $parent_ui_dialog_id;
            ?>
',
                        close_ui_dialog_id:'<?php 
            echo $close_ui_dialog_id;
            ?>
',
                        reload_iframe_id:'<?php 
            echo $reload_iframe_id;
            ?>
',
                        remove_ui_dialog:'<?php 
            echo json_encode($remove_ui_dialog);
            ?>
',
                        small_form:<?php 
            echo $small_form;
            ?>
                    });
                });
            </script>
            <?php 
            $js_content = ob_get_clean();
            require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/utility.php';
            $js_content = TSMUtility::remove_string_javascript($js_content);
            $doc->addScriptDeclaration($js_content);
        }
        if ($view == 'tsmart' or $view == 'about' or $this->manager($view)) {
            //or $this->canDo->get('core.admin')
            //or $this->canDo->get('vm.'.$view) ) { //Super administrators always have access
            if (JFactory::getApplication()->isSite()) {
                $unoverridable = array('category', 'manufacturer', 'user');
                //This views have the same name and must not be overridable
                if (!in_array($view, $unoverridable)) {
                    if (!class_exists('VmTemplate')) {
                        require VMPATH_SITE . DS . 'helpers' . DS . 'vmtemplate.php';
                    }
                    $template = VmTemplate::getDefaultTemplate();
                    $this->addTemplatePath(VMPATH_ROOT . DS . 'templates' . DS . $template['template'] . DS . 'html' . DS . 'com_tsmart' . DS . $this->_name);
                }
            }
            $result = $this->loadTemplate($tpl);
            if ($result instanceof Exception) {
                return $result;
            }
            echo $result;
            if ($this->writeJs) {
                vmJsApi::keepAlive();
                echo vmJsApi::writeJS();
            }
            return true;
        } else {
            JFactory::getApplication()->redirect('index.php?option=com_tsmart', tsmText::_('JERROR_ALERTNOAUTHOR'), 'error');
        }
    }
예제 #3
0
 public function create_children_departure($tsmart_departure_id)
 {
     $query = $this->_db->getQuery(true);
     $query->delete('#__tsmart_departure')->where('tsmart_departure_parent_id=' . (int) $tsmart_departure_id);
     $this->_db->setQuery($query);
     $ok = $this->_db->execute();
     if (!$ok) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     $table_departure = $this->getTable();
     $table_departure->load($tsmart_departure_id);
     $date_type = $table_departure->date_type;
     if ($date_type == 'day_select') {
         $days_seleted = explode(',', $table_departure->days_seleted);
     } else {
         $sale_period_from = $table_departure->sale_period_from;
         $sale_period_to = $table_departure->sale_period_to;
         $days_seleted = TSMUtility::dateRange($sale_period_from, $sale_period_to);
         $weekly = $table_departure->weekly;
         $weekly = explode(',', $weekly);
         foreach ($days_seleted as $key => $day) {
             $day_of_week = strtolower(date('D', strtotime($day)));
             if (!in_array($day_of_week, $weekly)) {
                 unset($days_seleted[$key]);
             }
         }
     }
     require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmdeparture.php';
     foreach ($days_seleted as $day) {
         $table_departure->departure_date = $day;
         $day = JFactory::getDate($day);
         $table_departure->tsmart_departure_id = 0;
         $table_departure->departure_code = tsmDeparture::get_format_departure_code($tsmart_departure_id, $day);
         $table_departure->tsmart_departure_parent_id = $tsmart_departure_id;
         $ok = $table_departure->store();
         if (!$ok) {
             $this->setError($table_departure->getErrors());
             return false;
         }
     }
     return true;
 }
예제 #4
0
 /**
  * Retireve a list of product from the database.
  *
  * This is written to get a list for selecting product. Therefore it asks for enabled
  * @author Max Milbers
  * @return object List of product objects
  */
 function store(&$data)
 {
     if (!vmAccess::manager('product')) {
         vmWarn('Insufficient permissions to store product');
         return false;
     }
     $table_product = $this->getTable('products');
     if (!empty($data['tsmart_product_id'])) {
         $table_product->load($data['tsmart_product_id']);
     }
     if (!$table_product->tsmart_product_id || $table_product->product_code == '' || $table_product->product_code == 0) {
         $data['product_code'] = strtolower(TSMUtility::random_code(6));
     }
     $stored = $table_product->bindChecknStore($data, false);
     $errors = $table_product->getErrors();
     if (!$stored or count($errors) > 0) {
         foreach ($errors as $error) {
             vmError('Product store ' . $error);
         }
         if (!$stored) {
             vmError('You are not an administrator or the correct vendor, storing of product cancelled');
         }
         return FALSE;
     }
     $tsmart_product_id = $this->tsmart_product_id = $data['tsmart_product_id'] = (int) $table_product->tsmart_product_id;
     if (empty($this->tsmart_product_id)) {
         vmError('Product not stored, no id');
         return FALSE;
     }
     if ($tsmart_product_id) {
         $db = JFactory::getDbo();
         //inser to activity
         $query = $db->getQuery(true);
         $query->delete('#__tsmart_tour_id_activity_id')->where('tsmart_product_id=' . (int) $tsmart_product_id);
         $db->setQuery($query)->execute();
         $err = $db->getErrorMsg();
         if (!empty($err)) {
             vmError('can not delete activity in this tour', $err);
         }
         $list_activity_id = $data['list_activity_id'];
         foreach ($list_activity_id as $tsmart_activity_id) {
             $query->clear()->insert('#__tsmart_tour_id_activity_id')->set('tsmart_product_id=' . (int) $tsmart_product_id)->set('tsmart_activity_id=' . (int) $tsmart_activity_id);
             $db->setQuery($query)->execute();
             $err = $db->getErrorMsg();
             if (!empty($err)) {
                 vmError('can not insert activity in this tour', $err);
             }
         }
         //end inser tour type
         //inser to countries
         $query = $db->getQuery(true);
         $query->delete('#__tsmart_tour_id_country_id')->where('tsmart_product_id=' . (int) $tsmart_product_id);
         $db->setQuery($query)->execute();
         $err = $db->getErrorMsg();
         if (!empty($err)) {
             vmError('can not delete country in this tour', $err);
         }
         $list_tsmart_country_id = $data['list_tsmart_country_id'];
         foreach ($list_tsmart_country_id as $tsmart_country_id) {
             $query->clear()->insert('#__tsmart_tour_id_country_id')->set('tsmart_product_id=' . (int) $tsmart_product_id)->set('tsmart_country_id=' . (int) $tsmart_country_id);
             $db->setQuery($query)->execute();
             $err = $db->getErrorMsg();
             if (!empty($err)) {
                 vmError('can not insert country in this tour', $err);
             }
         }
         //inser to tour class
         $query = $db->getQuery(true);
         $query->delete('#__tsmart_tour_id_service_class_id')->where('tsmart_product_id=' . (int) $tsmart_product_id);
         $db->setQuery($query)->execute();
         $err = $db->getErrorMsg();
         if (!empty($err)) {
             vmError('can not delete tour in tour class', $err);
         }
         $list_tour_service_class_id = $data['list_tour_service_class_id'];
         foreach ($list_tour_service_class_id as $tsmart_service_class_id) {
             $query->clear()->insert('#__tsmart_tour_id_service_class_id')->set('tsmart_product_id=' . (int) $tsmart_product_id)->set('tsmart_service_class_id=' . (int) $tsmart_service_class_id);
             $db->setQuery($query)->execute();
             $err = $db->getErrorMsg();
             if (!empty($err)) {
                 vmError('can not insert tour in this tour class', $err);
             }
         }
         //inser to tour group size
         $query = $db->getQuery(true);
         $query->delete('#__tsmart_tour_id_group_size_id')->where('tsmart_product_id=' . (int) $tsmart_product_id);
         $db->setQuery($query)->execute();
         $err = $db->getErrorMsg();
         if (!empty($err)) {
             vmError('can not delete tour in tour group size', $err);
         }
         $list_group_size_id = $data['list_group_size_id'];
         if ($data['price_type'] == 'both_options') {
             $list_group_size_id[] = 2;
         } elseif ($data['price_type'] == 'flat_price') {
             $list_group_size_id = array();
             $list_group_size_id[] = 2;
         }
         foreach ($list_group_size_id as $tsmart_group_size_id) {
             $query->clear()->insert('#__tsmart_tour_id_group_size_id')->set('tsmart_product_id=' . (int) $tsmart_product_id)->set('tsmart_group_size_id=' . (int) $tsmart_group_size_id);
             $db->setQuery($query)->execute();
             $err = $db->getErrorMsg();
             if (!empty($err)) {
                 vmError('can not insert tour in this tour group size', $err);
             }
         }
     }
     return $tsmart_product_id;
 }
예제 #5
0
                        </td>
                        <td align="left">
                            <?php 
    if ($show_edit) {
        ?>
                                <?php 
        echo VmHTML::editor('answer', $row->answer);
        ?>
                            <?php 
    } else {
        ?>
                                <a href="<?php 
        echo $editlink;
        ?>
"><?php 
        echo TSMUtility::truncate($row->answer);
        ?>
 </a>
                            <?php 
    }
    ?>
                        </td>
                        <td align="left">
                            <?php 
    if ($show_edit) {
        ?>
                                <?php 
        echo VmHTML::select('tsmart_categoryfaq_id', $this->list_categoryfaq, $row->tsmart_categoryfaq_id, '', 'tsmart_categoryfaq_id', 'categoryfaq_name');
        ?>
                            <?php 
    } else {
예제 #6
0
    public static function build_excursion_addon($name, $list_passenger = array(), $default = '0', $departure, $passenger_config, $list_excursion_addon)
    {
        $doc = JFactory::getDocument();
        JHtml::_('jquery.ui');
        JHtml::_('jquery.ui', array('sortable'));
        $session = JFactory::getSession();
        $json_list_passenger = $session->get('json_list_passenger');
        $json_list_passenger = json_decode($json_list_passenger);
        $doc->addScript(JUri::root() . '/media/system/js/jquery.utility.js');
        $doc->addScript(JUri::root() . '/media/system/js/select2-master/dist/js/select2.full.js');
        $doc->addScript(JUri::root() . '/media/system/js/jquery.serializeObject.js');
        $doc->addScript(JUri::root() . '/media/system/js/jquery.base64.js');
        $doc->addStyleSheet(JUri::root() . '/media/system/js/select2-master/dist/css/select2.css');
        $doc->addStyleSheet(JUri::root() . '/media/system/js/tipso-master/src/tipso.css');
        $doc->addStyleSheet(JUri::root() . '/media/system/js/animate.css-master/animate.css');
        $doc->addScript(JUri::root() . '/media/system/js/DeLorean-Ipsum-master/jquery.delorean.ipsum.js');
        $doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/controller/build_excursion_addon/html_build_excursion_addon.js');
        $doc->addScript(JUri::root() . '/media/system/js/tipso-master/src/tipso.js');
        $doc->addScript(JUri::root() . '/media/system/js/bootstrap-notify-master/bootstrap-notify.js');
        $doc->addScript(JUri::root() . '/media/system/js/jquery.scrollTo-master/jquery.scrollTo.js');
        $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/js/controller/build_excursion_addon/html_build_excursion_addon.less');
        require_once JPATH_ROOT . '/libraries/php-loremipsum-master/src/LoremIpsum.php';
        $doc->addScript(JUri::root() . '/media/system/js/jquery-cookie-master/src/jquery.cookie.js');
        $lipsum = new joshtronic\LoremIpsum();
        $input = JFactory::getApplication()->input;
        $id_element = 'html_build_pickup_transfer_' . $name;
        $debug = true;
        ob_start();
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function ($) {
                var cookie_list_passenger = $.cookie('cookie_list_passenger');
                cookie_list_passenger = $.parseJSON(cookie_list_passenger);
                $('#<?php 
        echo $id_element;
        ?>
').html_build_excursion_addon({
                    list_passenger: cookie_list_passenger,
                    input_name: "<?php 
        echo $name;
        ?>
",
                    element_key: "<?php 
        echo $id_element;
        ?>
",
                    debug:<?php 
        echo json_encode($debug);
        ?>
,
                    departure:<?php 
        echo json_encode($departure);
        ?>
,
                    list_excursion_addon:<?php 
        echo json_encode($list_excursion_addon);
        ?>
,
                    passenger_config:<?php 
        echo json_encode($passenger_config);
        ?>
                });
            });
        </script>
        <?php 
        $script_content = ob_get_clean();
        $script_content = TSMUtility::remove_string_javascript($script_content);
        $doc->addScriptDeclaration($script_content);
        ob_start();
        ?>
        <div class="html_build_pickup_transfer row-fluid" id="<?php 
        echo $id_element;
        ?>
">
            <div class="<?php 
        echo $id_element;
        ?>
_list_transfer">
                <div class="item-transfer">
                    <div class="move-transfer handle"><span title="" class="icon-move "></span></div>
                    <div class="row-fluid">
                        <div class="span12"><h4><?php 
        echo JText::_('transfer ');
        ?>
<span class="transfer-order">1</span>
                            </h4></div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">
                            <div
                                class="air-price"><?php 
        echo JText::sprintf('price<br/> from <span class="price">%d</span> /pers', $list_excursion_addon->sale_price);
        ?>
</div>
                        </div>
                        <div class="span8">
                            <h5><?php 
        echo JText::_('Air port pickup & transfer');
        ?>
</h5>
                            <ul class="list-passenger">
                                <li><label class="checkbox-inline"> <input class="passenger-item" type="checkbox"> <span
                                            class="full-name"></span><span class="in_transfer"></span></label></li>
                            </ul>
                        </div>
                    </div>
                    <div class="transfer-fluid note">
                        <div class="span12">
                            <h4><?php 
        echo JText::_('Your note');
        if ($debug) {
            ?>
                                    <button type="button" class="btn btn-primary random-text">Random text
                                    </button><?php 
        }
        ?>
</h4>
                            <textarea data-name="transfer_note" style="width: 96%;height: 50px"></textarea>
                        </div>
                    </div>

                    <div class="row-fluid">
                        <div class="span12">
                            <button type="button"
                                    class="btn btn-primary add-more-transfer pull-right"><?php 
        echo JText::_('Add more transfer');
        ?>
</button>
                            <button type="button"
                                    class="btn btn-primary remove-transfer pull-right"><?php 
        echo JText::_('Remove transfer');
        ?>
</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="transfering-list">
                <div class="row-fluid">
                    <div class="span12">
                        <h4 style="text-align: center"><?php 
        echo JText::_('transfering list');
        ?>
</h4>
                        <div class="table table-hover table-bordered table-transfering-list">
                            <div class="thead">
                                <div class="row-fluid">
                                    <div class="span2">
                                        <div class="column-header-item"><?php 
        echo JText::_('transfer');
        ?>
</div>
                                    </div>
                                    <div class="span2">
                                        <div class="column-header-item"><?php 
        echo JText::_('transfer type');
        ?>
</div>
                                    </div>
                                    <div class="span3">
                                        <div class="column-header-item"><?php 
        echo JText::_('Passenger');
        ?>
</div>
                                    </div>
                                    <div class="span3">
                                        <div class="column-header-item"><?php 
        echo JText::_('Bed note');
        ?>
</div>
                                    </div>
                                    <div class="span2">
                                        <div class="column-header-item"><?php 
        echo JText::_('transfer note');
        ?>
</div>
                                    </div>
                                </div>
                            </div>
                            <div class="tbody">
                                <div class="row-fluid div-item-transfer">
                                    <div class="span2">
                                        <div class="row-item-column"><span class="order">1</span></div>
                                    </div>
                                    <div class="span2">
                                        <div class="row-item-column">
                                            <div class="transfer_type"></div>
                                        </div>
                                    </div>
                                    <div class="span3">
                                        <div class="row-item-column">
                                            <div class="table_list_passenger"></div>
                                        </div>
                                    </div>
                                    <div class="span3">
                                        <div class="row-item-column">
                                            <div class="private-transfer"></div>
                                        </div>
                                    </div>
                                    <div class="span2">
                                        <div class="row-item-column">
                                            <div class="transfer_note"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" name="<?php 
        echo $name;
        ?>
">
        </div>
        <?php 
        $html = ob_get_clean();
        return $html;
    }
예제 #7
0
 /**
  * Applies CSRF protection by means of a standard Joomla! token (nonce) check.
  * Raises a 403 Access Forbidden error through the platform if the check fails.
  *
  * TODO Move this check inside the platform
  *
  * @return  boolean  True if the CSRF check is successful
  *
  * @throws Exception
  */
 protected function _csrfProtection()
 {
     static $isCli = null, $isAdmin = null;
     if (is_null($isCli)) {
         $isCli = F0FPlatform::getInstance()->isCli();
         $isAdmin = F0FPlatform::getInstance()->isBackend();
     }
     switch ($this->csrfProtection) {
         // Never
         case 0:
             return true;
             break;
             // Always
         // Always
         case 1:
             break;
             // Only back-end and HTML format
         // Only back-end and HTML format
         case 2:
             if ($isCli) {
                 return true;
             } elseif (!$isAdmin && $this->input->get('format', 'html', 'cmd') != 'html') {
                 return true;
             }
             break;
             // Only back-end
         // Only back-end
         case 3:
             if (!$isAdmin) {
                 return true;
             }
             break;
     }
     $hasToken = false;
     $session = JFactory::getSession();
     // Joomla! 1.5/1.6/1.7/2.5 (classic Joomla! API) method
     if (method_exists('JUtility', 'getToken')) {
         $token = TSMUtility::getToken();
         $hasToken = $this->input->get($token, false, 'none') == 1;
         if (!$hasToken) {
             $hasToken = $this->input->get('_token', null, 'none') == $token;
         }
     }
     // Joomla! 2.5+ (Platform 12.1+) method
     if (!$hasToken) {
         if (method_exists($session, 'getToken')) {
             $token = $session->getToken();
             $hasToken = $this->input->get($token, false, 'none') == 1;
             if (!$hasToken) {
                 $hasToken = $this->input->get('_token', null, 'none') == $token;
             }
         }
     }
     // Joomla! 2.5+ formToken method
     if (!$hasToken) {
         if (method_exists($session, 'getFormToken')) {
             $token = $session->getFormToken();
             $hasToken = $this->input->get($token, false, 'none') == 1;
             if (!$hasToken) {
                 $hasToken = $this->input->get('_token', null, 'none') == $token;
             }
         }
     }
     if (!$hasToken) {
         F0FPlatform::getInstance()->raiseError(403, JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'));
         return false;
     }
 }
예제 #8
0
    /**
     * Start the administrator area table
     *
     * The entire administrator area with contained in a table which include the admin ribbon menu
     * in the left column and the content in the right column.  This function sets up the table and
     * displays the admin menu in the left column.
     */
    static function startAdminArea($vmView, $selectText = 'com_tsmart_DRDOWN_AVA2ALL')
    {
        JHtml::_('jquery.framework');
        $doc = JFactory::getDocument();
        //JHtml::_('behavior.formvalidator');
        JHtml::_('formbehavior.chosen');
        JHTML::_('behavior.core');
        JHtml::_('jquery.ui');
        $doc = JFactory::getDocument();
        $doc->addScript(JUri::root() . '/media/system/js/jquery.serializeObject.js');
        $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/datepicker.js');
        $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/effect.js');
        $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/draggable.js');
        $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/dialog.js');
        $doc->addScript(JUri::root() . '/media/jquery-ui-1.11.1/ui/autocomplete.js');
        $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/core.css');
        $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/theme.css');
        $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/dialog.css');
        $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/datepicker.css');
        $doc->addStyleSheet(JUri::root() . '/media/jquery-ui-1.11.1/themes/base/datepicker.css');
        $doc->addStyleSheet(JUri::root() . '/media/system/js/datepicker/css/base.css');
        $doc->addStyleSheet(JUri::root() . '/media/system/js/datepicker/css/clean.css');
        if (vRequest::getCmd('format') == 'pdf') {
            return;
        }
        if (vRequest::getCmd('manage', false)) {
            self::$backEnd = false;
        }
        if (self::$vmAdminAreaStarted) {
            return;
        }
        self::$vmAdminAreaStarted = true;
        $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/admin_ui.less');
        $doc->addStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/css/icons.css');
        $doc->addScript(JUri::root() . '/media/system/js/purl-master/purl-master/purl.js');
        $doc->addScript(JUri::root() . '/media/system/js/URI.js-gh-pages/src/URI.js');
        $doc->addScript(JUri::root() . '/administrator/components/com_tsmart/assets/js/asianventure.js');
        $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/asianventure.less');
        $admin = 'administrator/components/com_tsmart/assets/css';
        $modalJs = '';
        //loading defaut admin CSS
        vmJsApi::css('admin_ui', $admin);
        vmJsApi::css('admin.styles', $admin);
        vmJsApi::css('toolbar_images', $admin);
        vmJsApi::css('menu_images', $admin);
        vmJsApi::css('vtip');
        $view = vRequest::getCmd('view', 'tsmart');
        if ($view != 'tsmart') {
            vmJsApi::css('chosen');
            vmJsApi::css('jquery.fancybox-1.3.4');
            //vmJsApi::css('ui/jquery.ui.all');
        }
        if ($view != 'tsmart') {
            vmJsApi::addJScript('fancybox/jquery.mousewheel-3.0.4.pack', false, false);
            vmJsApi::addJScript('fancybox/jquery.easing-1.3.pack', false, false);
            vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack', false, false);
            VmJsApi::chosenDropDowns();
        }
        $app = JFactory::getApplication();
        $input = $app->input;
        $cid = $input->get('cid', array(), 'array');
        $key = $input->get('key', array(), 'array');
        $list_key = array();
        foreach ($key as $a_key => $item) {
            $list_key = "{$a_key}={$item}";
        }
        $str_key = '';
        if ($list_key != '') {
            $str_key = '&' . $list_key;
        }
        $key_string = '';
        $show_edit_in_line = $input->get('show_edit_in_line', 0, 'int');
        $hide_toolbar = $input->get('hide_toolbar', 0, 'int');
        if ($show_edit_in_line) {
            $doc->addLessStyleSheet(JUri::root() . '/administrator/components/com_tsmart/assets/less/asianventure-edit-inline.less');
        }
        $tsmart_product_id = $app->input->get('tsmart_product_id', array(), 'array');
        $tsmart_product_id = $tsmart_product_id[0];
        $uri = JUri::getInstance();
        $url = $uri->toString(array('query'));
        $js_content = '';
        ob_start();
        ?>
    <script type="text/javascript">
        jQuery(document).ready(function ($) {
            $('.admin.com_tsmart').asianventure({
                show_iframe:<?php 
        echo json_encode(tsmConfig::$show_iframe);
        ?>
,
                add_new_popup:<?php 
        echo $vmView->add_new_popup == 1 ? 1 : 0;
        ?>
,
                cid:<?php 
        echo json_encode($cid);
        ?>
,
                key_string: "<?php 
        echo $str_key;
        ?>
",
                url: '<?php 
        echo 'index.php' . $url;
        ?>
',
                view: '<?php 
        echo $vmView->getName();
        ?>
',
            });
        });
    </script>
    <?php 
        $js_content = ob_get_clean();
        require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/utility.php';
        $js_content = TSMUtility::remove_string_javascript($js_content);
        $doc->addScriptDeclaration($js_content);
        vmJsApi::addJScript('/administrator/components/com_tsmart/assets/js/jquery.coookie.js');
        vmJsApi::addJScript('/administrator/components/com_tsmart/assets/js/vm2admin.js');
        $vm2string = "editImage: 'edit image',select_all_text: '" . tsmText::_('com_tsmart_DRDOWN_SELALL') . "',select_some_options_text: '" . tsmText::_($selectText) . "'";
        vmJsApi::addJScript('vm.remindTab', "\n\t\tvar tip_image='" . JURI::root(true) . "/components/com_tsmart/assets/js/images/vtip_arrow.png';\n\t\tvar vm2string ={" . $vm2string . "} ;\n\t\tjQuery( function(\$) {\n\n\t\t\tjQuery('dl#system-message').hide().slideDown(400);\n\t\t\tjQuery('.tsmart-admin-area .toggler').vm2admin('toggle');\n\t\t\tjQuery('#admin-ui-menu').vm2admin('accordeon');\n\t\t\tif ( jQuery('#admin-ui-tabs').length  ) {\n\t\t\t\tjQuery('#admin-ui-tabs').vm2admin('tabs',tsmartcookie);\n\t\t\t}\n\t\t\tjQuery('#content-box [title]').vm2admin('tips',tip_image);\n\t\t\tjQuery('.reset-value').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tnone = '';\n\t\t\t\tjQuery(this).parent().find('.ui-autocomplete-input').val(none);\n\t\t\t});\n\t\t});\t");
        ?>
    <!--[if lt IE 9]>
    <script src="//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
    <style type="text/css">
        .tsmart-admin-area {
            display: block;
        }

        .tsmart-admin-area #menu-wrapper {
            float: left;
        }

        .tsmart-admin-area #admin-content {
            margin-left: 221px;
        }

        <
        /
        script >
    <![endif]-->
    <?php 
        if (!self::$backEnd) {
            //JToolBarHelper
            $bar = JToolbar::getInstance('toolbar');
            ?>
    <div class="toolbar-box" style="height: 84px;position: relative;"><?php 
            echo $bar->render();
            ?>
</div>
<?php 
        }
        ?>
    <?php 
        $hideMenu = JFactory::getApplication()->input->cookie->getString('vmmenu', 'show') === 'hide' ? ' menu-collapsed' : '';
        ?>
    <div class="tsmart-admin-area<?php 
        echo $hideMenu;
        ?>
 <?php 
        echo $show_edit_in_line ? 'edit-in-line' : '';
        ?>
">
        <div class="div-loading"></div>
        <?php 
        if ($vmView->add_new_popup == 1) {
            ?>
            <div id="vm-edit-form-<?php 
            echo $vmView->getName();
            ?>
" class="vm-edit-form">
                <iframe id="vm-iframe-<?php 
            echo $vmView->getName();
            ?>
" scrolling="no" src=""></iframe>
            </div>
        <?php 
        }
        ?>
        <style type="text/css">
            .div-loading {
                display: none;
                background: url("<?php 
        echo JUri::root();
        ?>
/global_css_images_js/images/loading.gif") center center no-repeat;
                position: fixed;
                z-index: 1000;
                top: 0;
                left: 0;
                height: 100%;
                width: 100%
            }
        </style>
        <div id="admin-content" class="admin-content container-fluid">
            <?php 
        if (!$hide_toolbar) {
            ?>
            <div class="row-fluid toolbar-top">

            </div>
            <div class="toolbar-top2">
                <div class="content-toolbar-top2">
                    <div class="row-fluid">
                        <div class="span6">
                            <img src="<?php 
            echo JUri::root();
            ?>
/images/Untitled-10.png">
                        </div>
                        <div class="span4 offset2">
                            <h2>ADMIN DASKBOARD</h2>
                        </div>
                    </div>
                </div>
            </div>

            <div class="toolbar-top3">
                <div class="content-toolbar-top3">
                     <div class="row-fluid">
                        <div class="span5">
                            <a href="index.html" class="navbar-brand">
                                <i class="im-windows8 text-logo-element animated bounceIn"></i><span class="text-logo">Asianventure</span>
                            </a>


                            <a title="" class="pull-right tool">
                                <i class="ec-help"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="ec-pencil"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="br-grid"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="ec-refresh"></i>
                            </a>

                        </div>
                        <div class="span7">
                            <a title="" class="pull-right tool">
                                <i class="ec-help"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="ec-pencil"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="br-grid"></i>
                            </a>
                            <a title="" class="pull-right tool">
                                <i class="ec-refresh"></i>
                            </a>
                        </div>
                     </div>
                </div>
            </div>

            <div class="toolbar-top5">
                <div class="content-toolbar-top5">
                    <div class="row-fluid">
                        <div class="span3">
                            <h1><span title="" class="icon-palette"></span><span style="margin-left: 20px;color: #990100">Tour portal</span>
                            </h1>
                        </div>
                    </div>
                </div>
            </div>
            <?php 
        }
        ?>
            <?php 
        $app = JFactory::getApplication();
        $view = $app->input->get('view', 'tsmart', 'string');
        ?>
            <?php 
        if ($view == 'tsmart') {
            echo self::show_tab_home_page($tsmart_product_id);
            ?>
                <div class="vm_toolbar"></div>
                <script>
                    jQuery(document).ready(function ($) {
                        $.fn.vertical_accordian_drop_down_menu_bar('#vertical_accordian_drop_down_menu_bar');
                    });
                </script>
            <?php 
        }
        ?>
            <?php 
        if ($view != 'tsmart') {
            ?>

                <?php 
            if (!$hide_toolbar) {
                ?>
                <?php 
                if (in_array($view, array('country', 'state', 'cityarea', 'currency', 'language', 'airport'))) {
                    echo self::show_tab_geo($view, $tsmart_product_id);
                    ?>
                        <div class="vm-title tab-geo">
                            <div class="content-vm-title">
                                <div class="row-fluid">
                                    <div class="span2 ">
                                        <h3 class="title_page pull-left"><?php 
                    echo JText::_($vmView->getName());
                    ?>
</h3>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="vm_toolbar"></div>
                        <?php 
                } else {
                    echo self::show_tab_default($tsmart_product_id);
                    ?>
                        <div class="vm-title ">
                            <div class="content-vm-title">
                                <div class="row-fluid">
                                    <div class="span2">
                                        <h3 class="title_page pull-left"><?php 
                    echo JText::_($vmView->getName());
                    ?>
</h3>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="vm_toolbar"></div>
                        <?php 
                }
                ?>
                    <?php 
            }
            ?>
            <?php 
        }
        ?>

            <?php 
    }
예제 #9
0
    /**
     * Creates a Table of Contents for the pagebreak
     *
     * @param   object   &$row      The article object.  Note $article->text is also available
     * @param   array    &$matches  Array of matches of a regex in onContentPrepare
     * @param   integer  &$page     The 'page' number
     *
     * @return  void
     *
     * @since  1.6
     */
    protected function _createToc(&$row, &$matches, &$page)
    {
        $heading = isset($row->title) ? $row->title : JText::_('PLG_CONTENT_PAGEBREAK_NO_TITLE');
        $input = JFactory::getApplication()->input;
        $limitstart = $input->getUInt('limitstart', 0);
        $showall = $input->getInt('showall', 0);
        // TOC header.
        $row->toc = '<div class="pull-right article-index">';
        if ($this->params->get('article_index') == 1) {
            $headingtext = JText::_('PLG_CONTENT_PAGEBREAK_ARTICLE_INDEX');
            if ($this->params->get('article_index_text')) {
                $headingtext = htmlspecialchars($this->params->get('article_index_text'), ENT_QUOTES, 'UTF-8');
            }
            $row->toc .= '<h3>' . $headingtext . '</h3>';
        }
        // TOC first Page link.
        $class = $limitstart === 0 && $showall === 0 ? 'toclink active' : 'toclink';
        $row->toc .= '<ul class="nav nav-tabs nav-stacked">
		<li class="' . $class . '">
			<a href="' . JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=') . '" class="' . $class . '">' . $heading . '</a>
		</li>
		';
        $i = 2;
        foreach ($matches as $bot) {
            $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=&limitstart=' . ($i - 1));
            if (@$bot[0]) {
                $attrs2 = TSMUtility::parseAttributes($bot[0]);
                if (@$attrs2['alt']) {
                    $title = stripslashes($attrs2['alt']);
                } elseif (@$attrs2['title']) {
                    $title = stripslashes($attrs2['title']);
                } else {
                    $title = JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $i);
                }
            } else {
                $title = JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $i);
            }
            $liClass = $limitstart == $i - 1 ? ' class="active"' : '';
            $class = $limitstart == $i - 1 ? 'toclink active' : 'toclink';
            $row->toc .= '<li' . $liClass . '><a href="' . $link . '" class="' . $class . '">' . $title . '</a></li>';
            $i++;
        }
        if ($this->params->get('showall')) {
            $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language) . '&showall=1&limitstart=');
            $liClass = $limitstart == $i - 1 ? ' class="active"' : '';
            $class = $limitstart == $i - 1 ? 'toclink active' : 'toclink';
            $row->toc .= '<li' . $liClass . '><a href="' . $link . '" class="' . $class . '">' . JText::_('PLG_CONTENT_PAGEBREAK_ALL_PAGES') . '</a></li>';
        }
        $row->toc .= '</ul></div>';
    }