PHP Classes

File: aksara/Modules/Pages/Views/index.php

Recommend this page to a friend!
  Classes of Aby Dahana  >  Aksara  >  aksara/Modules/Pages/Views/index.php  >  Download  
File: aksara/Modules/Pages/Views/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: Initial commit for update 4.2.8

1. Core improvements;
2. Menu generator improvements;
3. Validation for file upload improvements;
4. Adds the failed login attempts blocking with customizable attempt count and blocking time;
5. Login page improvements, removing the login component due to the easy customization;
6. Removing unused JS plugins;
7. Routing machine preparation for maps rendering;
8. Preparing the market addons to be able to auto update the installed modules and themes;
9. Changes for uploader plugin with Aksara custom uploader since the previous version used to be paid version (fileuploader by innostudio);
10. Improve the carousel slideshow CMS that previously missing the order when uploaded file is skipping the first slide;
Initial commit for update 4.2.8

Refine the core modules
Initial commit for update 4.2.8

This commit replace the dependent configuration with newest CodeIgniter configuration (path /aksara/Config);

Changes for database migrations: Adds seeder to seeds the dummy data instead of writing it under migration.

Core and Model: Updating the missing placement for case insensitive query parameter;

String helper: remove unused parameter;

Touching the core javascript: /public/assets/local/require.min.js (add the missing array usage for css);

Minor updates for the core module
Initial commit for update 4.2.8
Initial commit for update 4.2.8

Change the phrase
Initial commit for update 4.2.8

Files changed:
1. \aksara\Common.php (remove the single quote string replacement);
2. \aksara\laboratory\Core.php (correcting the response for API request);
3. \aksara\laboratory\Template.php (adds the API documentation for administration menu);
4. Adds the required validation for some modules;
5. Adds the API Documentation under the API module;
6. Adds the parameter from the data atribut when using swiperJS;
7. Change the structure of session table.
8. Minor changes for installation page;
9. Minor changes for core modules.
Date: 7 days ago
Size: 7,261 bytes
 

Contents

Class file image Download
<?php
   
if($results)
    {
        foreach(
$results as $key => $val)
        {
           
$carousels = json_decode($val->carousel_content);
           
$faqs = json_decode($val->faq_content);
           
            if(
$carousels)
            {
               
$navigation = null;
               
$carousel_items = null;
               
                foreach(
$carousels as $_key => $_val)
                {
                   
$navigation .= '<li data-target="#carouselExampleIndicators" data-slide-to="' . $_key . '"' . ($_key == 0 ? ' class="active"' : '') . '></li>';
                   
$carousel_items .= '
                        <div class="carousel-item bg-dark gradient'
. ($_key == 0 ? ' active' : '') . '" style="background:#333 url(\'' . get_image('carousels', (isset($_val->background) ? $_val->background : 'placeholder.png')) . '\') center center no-repeat;background-size:cover;background-attachment:fixed">
                            <div class="full-height d-flex align-items-center">
                                <div class="clip gradient-top"></div>
                                <div class="carousel-caption container" style="position:inherit">
                                    <div class="row">
                                        '
. ($_val->thumbnail && $_val->thumbnail != 'placeholder.png' ? '
                                        <div class="col-lg-4 offset-lg-1 text-center text-lg-left d-none d-md-block">
                                            <div class="pt-5 w-100">
                                                <img src="'
. get_image('carousels', 'placeholder.png') . '" class="img-fluid rounded-more" />
                                            </div>
                                        </div>
                                        '
: null) . '
                                        <div class="'
. ($_val->thumbnail && $_val->thumbnail != 'placeholder.png' ? 'col-lg-6 text-center text-lg-left d-flex align-items-center justify-content-center' : 'col-md-10 offset-md-1 col-lg-8 offset-lg-2 text-center') . '">
                                            <div class="pt-5 w-100">
                                                <h1 class="font-weight-bold mb-3 text-light">
                                                    '
. (isset($_val->title) ? $_val->title : phrase('untitled')) . '
                                                </h1>
                                                <p class="text-light mb-5">
                                                    '
. (isset($_val->description) ? truncate($_val->description, 260) : phrase('description_was_not_set')) . '
                                                </p>
                                                '
. (isset($_val->link) && $_val->link ? '
                                                <div class="row">
                                                    <div class="col-sm-6 offset-sm-3 col-md-12 offset-md-0">
                                                        <a href="'
. $_val->link . '" class="btn btn-outline-light btn-lg rounded-pill" data-animation="animated bounceInLeft" style="border-width:2px">
                                                            '
. (isset($_val->label) && $_val->label ? $_val->label : phrase('read_more')) . '
                                                            <i class="mdi mdi-chevron-right"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                                '
: null) . '
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    '
;
                }
               
                echo
'
                    <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
                        '
. (sizeof($carousels) > 1 ? '
                        <ol class="carousel-indicators">
                            '
. $navigation . '
                        </ol>
                        '
: '') . '
                        <div class="carousel-inner">
                            '
. $carousel_items . '
                        </div>
                        '
. (sizeof($carousels) > 1 ? '
                        <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                            <span class="sr-only">
                                '
. phrase('previous') . '
                            </span>
                        </a>
                        <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                            <span class="carousel-control-next-icon" aria-hidden="true"></span>
                            <span class="sr-only">
                                '
. phrase('next') . '
                            </span>
                        </a>
                        '
: '') . '
                    </div>
                '
;
            }
           
            if(
$faqs)
            {
               
$output = null;
               
                foreach(
$faqs as $_key => $_val)
                {
                    if(!isset(
$_val->question) || !$_val->answer) continue;
                   
                   
$output .= '
                        <div class="card">
                            <div class="card-header" id="heading_'
. $_key . '">
                                <a href="#" class="d-block font-weight-bold" data-toggle="collapse" data-target="#collapse_'
. $_key . '" aria-expanded="' . (!$_key ? 'true' : 'false') . '" aria-controls="collapse_' . $_key . '">
                                    '
. $_val->question . '
                                </a>
                            </div>
                            <div id="collapse_'
. $_key . '" class="collapse' . (!$_key ? ' show' : null) . '" aria-labelledby="heading_' . $_key . '" data-parent="#accordionExample">
                                <div class="card-body">
                                    '
. $_val->answer . '
                                </div>
                            </div>
                        </div>
                    '
;
                }
               
               
$faqs = '
                    <div class="accordion" id="accordionExample">
                        '
. $output . '
                    </div>
                '
;
            }
           
            echo
'
                <div class="jumbotron jumbotron-fluid bg-light gradient">
                    <div class="container">
                        <div class="text-center text-sm-left">
                            <h3 class="mb-0'
. (!$meta->description ? ' mt-3' : null) . '">
                                '
. $meta->title . '
                            </h3>
                            <p class="lead mb-0">
                                '
. truncate($meta->description, 256) . '
                            </p>
                        </div>
                    </div>
                </div>
                <div class="container">
                    <div class="text-justify mb-3">
                        '
. preg_replace('/(<[^>]+) style=".*?"/i', '$1', preg_replace('/<img src="(.*?)"/i', '<img id="og-image" src="$1" class="img-fluid rounded"', $val->page_content)) . '
                    </div>
                    <div class="mb-3">
                        '
. $faqs . '
                    </div>
                    <p>
                        <i class="text-muted text-sm">
                            '
. phrase('updated_at') . ' ' . phrase(strtolower(date('l', strtotime($val->updated_timestamp)))) . ', ' . $val->updated_timestamp . '
                        </i>
                    </p>
                </div>
            '
;
        }
    }
    else
    {
       
$link_left = null;
       
$link_right = null;
       
        if(isset(
$suggestions) && $suggestions)
        {
           
$num = 1;
           
            foreach(
$suggestions as $key => $val)
            {
                if(
$num % 2 == 0)
                {
                   
$link_right .= '
                        <li>
                            <a href="'
. base_url('pages/' . $val->page_slug) . '" class="--xhr">
                                '
. $val->page_title . '
                            </a>
                        </li>
                    '
;
                }
                else
                {
                   
$link_left .= '
                        <li>
                            <a href="'
. base_url('pages/' . $val->page_slug) . '" class="--xhr">
                                '
. $val->page_title . '
                            </a>
                        </li>
                    '
;
                }
               
               
$num++;
            }
        }
       
        echo
'
            <div class="container pt-5">
                <div class="text-center pt-5 pb-5">
                    <h1 class="text-muted">
                        404
                    </h1>
                    <i class="mdi mdi-dropbox mdi-5x text-muted"></i>
                </div>
                <div class="row mb-5">
                    <div class="col-md-6 offset-md-3">
                        <h2 class="text-center">
                            '
. phrase('page_not_found') . '
                        </h2>
                        <p class="lead text-center mb-5">
                            '
. phrase('the_page_you_requested_does_not_exist') . '
                        </p>
                        <div class="text-center mt-5">
                            <a href="'
. base_url() . '" class="btn btn-outline-primary rounded-pill --xhr">
                                <i class="mdi mdi-arrow-left"></i>
                                '
. phrase('back_to_home') . '
                            </a>
                        </div>
                    </div>
                </div>
                <div class="row mb-2">
                    <div class="col-md-10 offset-md-1">
                        <h5>
                            <i class="mdi mdi-lightbulb-on-outline"></i>
                            '
. phrase('our_suggestions') . '
                            <blink>_</blink>
                        </h5>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-5 offset-md-1">
                        <ul>
                            '
. $link_left . '
                        </ul>
                    </div>
                    <div class="col-md-5">
                        <ul>
                            '
. $link_right . '
                        </ul>
                    </div>
                </div>
            </div>
        '
;
    }

For more information send a message to info at phpclasses dot org.