Esempio n. 1
0
 public function init()
 {
     $this->drive = Yii::app()->params->profile->mediaWidgetDrive && Yii::app()->settings->googleIntegration;
     if (Yii::app()->settings->googleIntegration) {
         $auth = new GoogleAuthenticator();
         if (!isset($_SESSION['driveFiles']) && $auth->getAccessToken()) {
             Yii::import('application.modules.media.controllers.MediaController');
             $mediaController = new MediaController('MediaController');
             $_SESSION['driveFiles'] = $mediaController->printFolder('root', $auth);
         }
     }
     parent::init();
 }
Esempio n. 2
0
 public function defaultAction()
 {
     View::addScript(Env::get('fierce_src') . 'third-party/ckeditor/plugins/fierce-image-select/scripts/ckeditor-media.controller.js');
     parent::defaultAction();
 }
Esempio n. 3
0
 * Date: 16/09/15
 * Time: 1:22 PM
 */
/**
 * Backend page for administrators and Staff of Cyril's Classic Employees to edit employees
 */
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php';
if (isset($_SESSION['authenticated'])) {
    if ($_SESSION['authenticated'] == true) {
        $editResult = null;
        $sellerCon = new SellerController();
        $personCon = new PersonController();
        $offerCon = new OfferController();
        $featureCon = new FeatureController();
        $foCon = new Feature_OfferController();
        $mediaCon = new MediaController();
        $carCon = new CarController();
        $offerId = null;
        $sellerId = null;
        $personId = null;
        $selectedFeatureIds = array();
        $media = array();
        $carId = null;
        $sellerName = null;
        $carRego = null;
        $preferredPrice = null;
        $description = null;
        $status = null;
        $offerDate = null;
        function checkSelected($id1, $id2)
        {
Esempio n. 4
0
            $uiController->sidebar();
            break;
        case ConfigApp::$ACTION_ADD_NOTE:
            $notesController = new NotesController();
            $notesController->addNote();
            break;
        case ConfigApp::$ACTION_DELETE_NOTE:
            $notesController = new NotesController();
            $notesController->closeNote();
            break;
            //Courses
        //Courses
        case ConfigApp::$ACTION_VIEW_COURSES:
            $coursesController = new CoursesController();
            $coursesController->mostrar();
            break;
        case ConfigApp::$ACTION_ADD_MEDIA:
            $mediaController = new MediaController();
            $mediaController->addMedia();
            break;
            //ADMIN
        //ADMIN
        case ConfigApp::$ACTION_VIEW_ADMIN:
            $uiController = new UIController();
            $uiController->admin();
            break;
        default:
            echo 'Pagina no encontrada';
            break;
    }
}
Esempio n. 5
0
<?php

/**
 * Created by PhpStorm.
 * User: roessler
 * Date: 9/24/15
 * Time: 11:50 AM
 */
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php';
if (isset($_POST['image'])) {
    $image = $_POST['image'];
    $mediaCon = new MediaController();
    $media = $mediaCon->deleteMedia($image['media_id']);
    $mediaResult = array();
    if ($media->errorInfo()[2] == null) {
        $mediaResult['media_id'] = $image['media_id'];
        $mediaResult['dbDelete'] = true;
        $filePath = 'D:' . DIRECTORY_SEPARATOR . 'Students' . $image['file_path'];
        $filePath = str_replace('FIT2076_', 'FIT2076' . DIRECTORY_SEPARATOR, $filePath);
        if (unlink($filePath)) {
            $mediaResult['fileDelete'] = true;
        }
        $dirPath = dirname($filePath);
        if (count(scandir($dirPath)) <= 2) {
            if (rmdir($dirPath)) {
                $mediaResult['dirDelete'] = true;
            }
        }
        $mediaResult = json_encode($mediaResult);
        print_r($mediaResult);
        return json_encode($mediaResult);
Esempio n. 6
0
/**
 * Created by PhpStorm.
 * User: roessler
 * Date: 9/18/15
 * Time: 12:12 PM
 */
/**
 * Home Page for Cyril's Classic Cars
 */
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
$makeCon = new MakeController();
$modelCon = new ModelController();
$carCon = new CarController();
$featureCon = new FeatureController();
$mediaCon = new MediaController();
function dollar_format($value)
{
    $value = floatval($value);
    return '$' . number_format($value, 2);
}
function checkSelected($val1, $val2)
{
    if ($val1 == $val2) {
        echo 'selected';
    }
}
function checkFeatures($val, $features)
{
    if (in_array($val, $features)) {
        return true;
Esempio n. 7
0
 * Date: 16/09/15
 * Time: 1:22 PM
 */
/**
 * Backend page for administrators and Staff of Cyril's Classic Employees to delete sellers
 */
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'config/config.php';
if (isset($_SESSION['authenticated'])) {
    if ($_SESSION['authenticated'] == true) {
        $deleteResult = null;
        $sellerCon = new SellerController();
        $personCon = new PersonController();
        $offerCon = new OfferController();
        $featureCon = new FeatureController();
        $foCon = new Feature_OfferController();
        $mediaCon = new MediaController();
        $carCon = new CarController();
        $offerId = null;
        $sellerId = null;
        $personId = null;
        $featureIds = array();
        $featureNames = array();
        $features = array();
        $media = array();
        $carId = null;
        $sellerName = null;
        $carRego = null;
        $preferredPrice = null;
        $description = null;
        $status = null;
        function checkSelected($id1, $id2)
 /**
  * Adds an AJAX-only filter on the renderEpisodeList action
  * @return array the filters for this controller
  */
 public function filters()
 {
     return array_merge(parent::filters(), array('ajaxOnly + renderEpisodeList'));
 }