/** * @ingroup jquery_tab_helper * Function to setup the tab helper system. This is called automatcially by the other functions. * */ function jquery_tab_setup() { // make sure we have jquery jquery_setup(); jquery_ui_setup('flick'); $CI =& get_instance(); if ($CI->input->post('_jquery_last_tab_index')) { jquery_tab_set_tab_index(intval($CI->input->post('_jquery_last_tab_index'))); } $active_tab = intval($CI->session->flashdata('jquery_tabs_last_used_index')); if ($CI->add_css_file('jquery_tab/jquery_tab.css')) { $javascript = <<<_EOM <script type="text/javascript"> \$("document").ready(function() { \t\t\$("#jquery_tabs").tabs( { \t\t\tactive: {$active_tab}, \t\t\tactivate: function(event, ui) { \t\t\t\t\$(":input[name='_jquery_last_tab_index']").val(\$("#jquery_tabs").tabs("option", "active")); \t\t\t} \t\t}); \t}); </script> _EOM; $CI->add_java_script($javascript); } }
/** * @ingroup jquery_helper * Function to setup the java script ui libraries for JQuery. * This function will needs to be called before ui part of jquery can be used. * @param string $style_name Name of the style to use for the jquery UI. */ function jquery_ui_setup($style_name) { jquery_setup(); $CI =& get_instance(); if ($CI->add_javascript_file('jquery-ui-1.9.2.custom.min')) { $css_file = 'jquery-ui/ui-' . strtolower($style_name) . '/jquery-ui-1.9.2.custom.css'; $CI->add_css_file($css_file); return TRUE; } return FALSE; }
/** * @ingroup datepicker_helper * Setup and load in the datepicker javascript library. * * This function will be automatically called by the form_datepicker_input function. */ function form_datepicker_setup() { // setup using the jquery_helper jquery_setup(); if (jquery_ui_setup('lightness')) { $script = <<<_EOM \t\t <script type="text/javascript"> \t\$(function() { \t\t\$( "#datepicker" ).datepicker( { dateFormat: "yy-mm-dd", \t\t\t\t\t\t\t\t\t\tshowButtonPanel: true }); \t}); </script> _EOM; $CI =& get_instance(); $CI->add_java_script($script); } }
public function setup() { // setup using the jquery_helper $this->CI->load->helper('jquery'); jquery_setup(); if ($this->_config['is_vertical_view']) { $this->CI->add_css_file("ddsmoothmenu/ddsmoothmenu-v.css"); } else { $this->CI->add_css_file("ddsmoothmenu/ddsmoothmenu.css"); } $this->CI->add_javascript_file("ddsmoothmenu/ddsmoothmenu.js"); $script = <<<__EOM <script type="text/javascript"> ddsmoothmenu.init({ \tmainmenuid: "smoothmenu", //menu DIV id \torientation: '{ORIENTATION}', //Horizontal or vertical menu: Set to "h" or "v" \tclassname: 'ddsmoothmenu', //class added to menu's outer DIV //\tcustomtheme: ["#805a4a", "#18374a"], \tcontentsource: "markup", // "markup" or ["container_id", "path_to_menu_file"] \tarrowimages: {down:['downarrowclass', '{IMAGE_FOLDER}/down.gif', 23], \t\t\t\t\tright:['rightarrowclass', '{IMAGE_FOLDER}/right.gif'] \t\t\t\t} }) </script> __EOM; $orientation = 'h'; if ($this->_config['is_vertical_view']) { $orientation = 'v'; } $script = preg_replace('/{ORIENTATION}/', $orientation, $script); if (isset($this->_config['image_folder'])) { $script = preg_replace('/{IMAGE_FOLDER}/', $this->_config['image_folder'], $script); } $this->CI->add_java_script($script); }