Beispiel #1
0
function createTabs($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config)
{
    jimport('joomla.html.pane');
    jimport('joomla.utilities.date');
    JHtml::_('behavior.framework');
    $document = JFactory::getDocument();
    $document->addStyleSheet("components/com_guru/css/tabs_css.css");
    $document->addStyleSheet("components/com_guru/css/tabs.css");
    $document->addScript("components/com_guru/js/programs.js");
    $itemid = JRequest::getVar("Itemid", "0");
    $user = JFactory::getUser();
    $user_id = $user->id;
    $lesson_size = $config->lesson_window_size;
    $lesson_size = explode("x", $lesson_size);
    $lesson_height = $lesson_size["0"];
    $lesson_width = $lesson_size["1"];
    if (trim($lesson_height) == "" || trim($lesson_height) == "0") {
        $lesson_height == 1000;
    }
    if (trim($lesson_width) == "" || trim($lesson_width) == "0") {
        $lesson_width == 600;
    }
    $action_bool = getAction();
    $action = "";
    if ($action_bool === TRUE) {
        $action = "&action=renew";
    }
    ?>
    <div>
 <!-- start mobile version -->
        <div class="g_mobile">
            <div class="container-fluid">
                <div class="call_2_action buy_now">
                    <div>
                        <?php 
    boostrap_buttons($program, $course, $config, $course_config);
    ?>
                    </div>
                </div>
                
                <div id="accordion" class="accordion">
                    <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        ?>
                            <div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_TABLE_CONTENT");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                    <?php 
        tab1boost($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config);
        ?>
	
                                </div>
                            </div>

					<?php 
    }
    if ($program->description != "" && $course_config->course_description_show == "0") {
        ?>
                        	<div class="accordionItem">
								<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_DESCRIPTION");
        ?>
</h3>
								<div class="clearfix tab-body  g_accordion-group g_content_active">
									<?php 
        tab2($program);
        ?>
								</div>
							</div>
					<?php 
    }
    if ($course_config->course_tab_price == "0" && !is_array($button)) {
        ?>
                    		<div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_BUY_PRICE");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                	<?php 
        if (!isset($button)) {
            $button = "";
        }
        tab3($program, $config);
        ?>
                                </div>
							</div>
					<?php 
    }
    if (!empty($exercise)) {
        ?>
                    		<div class="accordionItem">
                            	<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_EXERCISE_FILES");
        ?>
</h3>
                            	<div class="clearfix tab-body  g_accordion-group g_content_active">
                            		<?php 
        tab4($exercise, $config);
        ?>
                            	</div>
							</div>
					<?php 
    }
    if ($course_config->course_author == "0") {
        ?>
                    		<div class="accordionItem">
                    			<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_AUTHOR");
        ?>
</h3>
                    			<div class="clearfix tab-body  g_accordion-group g_content_active">
									<?php 
        tab5($author, $course, $config, $course_config);
        ?>
                            	</div>
							</div>
					<?php 
    }
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        ?>
                    		<div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_REQUIREMENTS");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                	<?php 
        tab6($requirements, $program);
        ?>
                                </div>
							</div>
					<?php 
    }
    ?>
                </div>
            </div>
        </div>
        <!-- end mobile version -->
        <!-- start computer/tablet version -->
        <div class="g_hide_mobile">
            <div class=" guru-course-view" id="guru_tabs">
                <div>
                    <ul id="guru_tabs_navs" class="nav nav-tabs clearfix">
                         <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        ?>
                                <li id="li-tab1" class="ui-tabs-active"><a href="#" onclick="javascript:changeGuruTab('tab1'); return false;"><?php 
        echo JText::_("GURU_TAB_TABLE_CONTENT");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($program->description != "" && $course_config->course_description_show == "0") {
        ?>
                                    <li id="li-tab2"><a href="#" onclick="javascript:changeGuruTab('tab2'); return false;"><?php 
        echo JText::_("GURU_TAB_DESCRIPTION");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($course_config->course_tab_price == "0" && !is_array($button)) {
        ?>
                                    <li id="li-tab3"><a href="#" onclick="javascript:changeGuruTab('tab3'); return false;"><?php 
        echo JText::_("GURU_BUY_PRICE");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if (!empty($exercise)) {
        ?>
                                    <li id="li-tab4"><a href="#" onclick="javascript:changeGuruTab('tab4'); return false;"><?php 
        echo JText::_("GURU_EXERCISE_FILES");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($course_config->course_author == "0") {
        ?>
                                    <li id="li-tab5"><a href="#" onclick="javascript:changeGuruTab('tab5'); return false;"><?php 
        echo JText::_("GURU_TAB_AUTHOR");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        ?>
                                    <li id="li-tab6"><a href="#" onclick="javascript:changeGuruTab('tab6'); return false;"><?php 
        echo JText::_("GURU_TAB_REQUIREMENTS");
        ?>
</a></li>
                         <?php 
    }
    ?>
                </ul>
             </div>
             
             <div class="tab-content">
                 <div id="tab1" style="display:block;">
                     <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        tab1($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config);
    }
    ?>
                 </div>
                 <div id="tab2" style="display:none;">
                     <?php 
    if ($program->description != "" && $course_config->course_description_show == "0") {
        tab2($program);
    }
    ?>
                 </div>
                 <div id="tab3" style="display:none;">
                     <?php 
    if (!isset($button)) {
        $button = "";
    }
    if ($course_config->course_tab_price == "0" && !is_array($button)) {
        tab3($program, $config);
    }
    ?>
                 </div>
                 <div id="tab4" style="display:none;">
                     <?php 
    if (!empty($exercise)) {
        tab4($exercise, $config);
    }
    ?>
                 </div>
                 <div id="tab5" style="display:none;">
                     <?php 
    if ($course_config->course_author == "0") {
        tab5($author, $course, $config, $course_config);
    }
    ?>
                 </div>
                 <div id="tab6" style="display:none;">
                     <?php 
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        tab6($requirements, $program);
    }
    ?>
                 </div>
             </div>
         </div>
    </div>        
 </div>
 <?php 
}
Beispiel #2
0
function createTabs($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config)
{
    jimport('joomla.html.pane');
    jimport('joomla.utilities.date');
    JHtml::_('behavior.framework');
    $document = JFactory::getDocument();
    $document->addStyleSheet("components/com_guru/css/tabs_css.css");
    $document->addStyleSheet("components/com_guru/css/tabs.css");
    $document->addScript("components/com_guru/js/programs.js");
    $itemid = JRequest::getVar("Itemid", "0");
    $user = JFactory::getUser();
    $user_id = $user->id;
    $lesson_size = $config->lesson_window_size;
    $lesson_size = explode("x", $lesson_size);
    $lesson_height = $lesson_size["0"];
    $lesson_width = $lesson_size["1"];
    if (trim($lesson_height) == "" || trim($lesson_height) == "0") {
        $lesson_height == 1000;
    }
    if (trim($lesson_width) == "" || trim($lesson_width) == "0") {
        $lesson_width == 600;
    }
    $action_bool = getAction();
    $action = "";
    if ($action_bool === TRUE) {
        $action = "&action=renew";
    }
    $st_psgpage = json_decode($config->st_psgpage);
    $buy_background = $st_psgpage->course_other_background;
    $course_id = intval(JRequest::getVar("cid", 0));
    $buy_class = $st_psgpage->course_other_button;
    ?>
    <div>
 <!-- start mobile version -->
        <div class="uk-hidden-large uk-hidden-medium">
            <div class="container-fluid">
                <div class="uk-alert">
                    <div>
                        <?php 
    $button = createButton($buy_background, $course_id, $buy_class, $program, $program_content);
    // display message like "Get access to all the tutorials in the course now! and Buy Now button"
    if (is_array($button)) {
        echo $button["0"];
    } else {
        echo $button;
    }
    ?>
                    </div>
                </div>
                
                <div id="accordion" class="accordion">
                    <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        ?>
                            <div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_TABLE_CONTENT");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                    <?php 
        tab1($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config, "p");
        ?>
	
                                </div>
                            </div>

					<?php 
    }
    if ($program->description != "" && $course_config->course_description_show == "0") {
        ?>
                        	<div class="accordionItem">
								<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_DESCRIPTION");
        ?>
</h3>
								<div class="clearfix tab-body  g_accordion-group g_content_active">
									<?php 
        tab2($program);
        ?>
								</div>
							</div>
					<?php 
    }
    if ($course_config->course_tab_price == "0" && !is_array(@$button)) {
        ?>
                    		<div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_BUY_PRICE");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                	<?php 
        if (!isset($button)) {
            $button = "";
        }
        tab3($program, $config);
        ?>
                                </div>
							</div>
					<?php 
    }
    if (!empty($exercise)) {
        ?>
                    		<div class="accordionItem">
                            	<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_EXERCISE_FILES");
        ?>
</h3>
                            	<div class="clearfix tab-body  g_accordion-group g_content_active">
                            		<?php 
        tab4($exercise, $config);
        ?>
                            	</div>
							</div>
					<?php 
    }
    if ($course_config->course_author == "0") {
        ?>
                    		<div class="accordionItem">
                    			<h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_AUTHOR");
        ?>
</h3>
                    			<div class="clearfix tab-body  g_accordion-group g_content_active">
									<?php 
        tab5($author, $course, $config, $course_config);
        ?>
                            	</div>
							</div>
					<?php 
    }
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        ?>
                    		<div class="accordionItem">
                                <h3 class="g_accordion-group ui-corner-all g_title_active"><?php 
        echo JText::_("GURU_TAB_REQUIREMENTS");
        ?>
</h3>
                                <div class="clearfix tab-body  g_accordion-group g_content_active">
                                	<?php 
        tab6($requirements, $program);
        ?>
                                </div>
							</div>
					<?php 
    }
    ?>
                </div>
            </div>
        </div>
        <!-- end mobile version -->
        <!-- start computer/tablet version -->
        <div class="uk-hidden-small hidden-phone">
            <div class="guru-course-view" id="guru_tabs">
                <div>
                    <ul class="uk-subnav uk-subnav-pill">
                         <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        ?>
                                <li id="li-tab1" class="uk-active"><a href="#" onclick="javascript:changeGuruTab('tab1'); return false;"><?php 
        echo JText::_("GURU_TAB_TABLE_CONTENT");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($program->description != "" && $course_config->course_description_show == "0") {
        ?>
                                    <li id="li-tab2"><a href="#" onclick="javascript:changeGuruTab('tab2'); return false;"><?php 
        echo JText::_("GURU_TAB_DESCRIPTION");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($course_config->course_tab_price == "0" && !is_array($button)) {
        ?>
                                    <li id="li-tab3"><a href="#" onclick="javascript:changeGuruTab('tab3'); return false;"><?php 
        echo JText::_("GURU_BUY_PRICE");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if (!empty($exercise)) {
        ?>
                                    <li id="li-tab4"><a href="#" onclick="javascript:changeGuruTab('tab4'); return false;"><?php 
        echo JText::_("GURU_EXERCISE_FILES");
        ?>
</a></li>
                         <?php 
    }
    ?>
                         <?php 
    if ($course_config->course_author == "0") {
        ?>
                                    <li id="li-tab5">
                                    	<a href="#" onclick="javascript:changeGuruTab('tab5'); return false;">
											<?php 
        if (count($author) == 1) {
            echo JText::_("GURU_TAB_AUTHOR");
        } else {
            echo JText::_("GURU_TAB_AUTHORS");
        }
        ?>
                                        </a>
									</li>
                         <?php 
    }
    ?>
                         <?php 
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        ?>
                                    <li id="li-tab6"><a href="#" onclick="javascript:changeGuruTab('tab6'); return false;"><?php 
        echo JText::_("GURU_TAB_REQUIREMENTS");
        ?>
</a></li>
                         <?php 
    }
    ?>
                </ul>
             </div>
             
             <div class="tab-content">
                 <div id="tab1" style="display:block;">
                     <?php 
    if (!empty($program_content) && $course_config->course_table_contents == "0") {
        tab1($program, $author, $program_content, $exercise, $requirements, $course, $config, $course_config, 'd');
    }
    ?>
                 </div>
                 <div id="tab2" style="display:none;">
                     <?php 
    if ($program->description != "" && $course_config->course_description_show == "0") {
        tab2($program);
    }
    ?>
                 </div>
                 <div id="tab3" style="display:none;">
                     <?php 
    if (!isset($button)) {
        $button = "";
    }
    if ($course_config->course_tab_price == "0" && !is_array($button)) {
        tab3($program, $config);
    }
    ?>
                 </div>
                 <div id="tab4" style="display:none;">
                     <?php 
    if (!empty($exercise)) {
        tab4($exercise, $config);
    }
    ?>
                 </div>
                 <div id="tab5" style="display:none;">
                     <?php 
    if ($course_config->course_author == "0") {
        tab5($author, $course, $config, $course_config);
    }
    ?>
                 </div>
                 <div id="tab6" style="display:none;">
                     <?php 
    if ((!empty($requirements) || $program->pre_req != "" || $program->pre_req_books != "" || $program->reqmts != "") && $course_config->course_requirements == "0" && !is_array($button)) {
        tab6($requirements, $program);
    }
    ?>
                 </div>
             </div>
         </div>
    </div>        
 </div>
 <?php 
}