Example #1
0
 function getResourcesType($type_id = 0)
 {
     $type_id = intval($type_id);
     //if this is the first time calling this function, grab the list from db
     if (empty($resource_types)) {
         include_once TR_INCLUDE_PATH . 'classes/DAO/ResourceTypesDAO.class.php';
         $resourceTypesDAO = new ResourceTypesDAO();
         $rows = $resourceTypesDAO->getAll();
         if (is_array($rows)) {
             foreach ($rows as $row) {
                 $this->resource_types[$row['type_id']] = $row['type'];
             }
         }
     }
     if (!empty($this->resource_types[$type_id])) {
         return $this->resource_types[$type_id];
     }
     return $this->resource_types;
 }
Example #2
0
/* Inclusive Design Institute                                           */
/*                                                                      */
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
/**
 * This script creates the interface of "edit content" => "adapted content"
 */
if (!defined('TR_INCLUDE_PATH')) {
    exit;
}
include_once TR_INCLUDE_PATH . 'classes/DAO/ResourceTypesDAO.class.php';
include_once TR_INCLUDE_PATH . 'classes/DAO/DAO.class.php';
$dao = new DAO();
$resourceTypesDAO = new ResourceTypesDAO();
global $_content_id, $content_row, $msg;
$cid = $_content_id;
if ($cid == 0) {
    $msg->printErrors('SAVE_BEFORE_PROCEED');
    require_once TR_INCLUDE_PATH . 'footer.inc.php';
    exit;
}
/**
 * When the file name is a remote URL, this function reduces the full URL
 * @param  $filename
 * @return the reduced name
 */
function get_display_filename($filename)
{
    if (substr($filename, 0, 7) == 'http://' || substr($filename, 0, 8) == 'https://') {