Adding ChamiloApi

pull/2487/head
Julio 9 years ago
parent d0aa3d39a4
commit a3279f9217
  1. 11
      main/admin/configure_extensions.php
  2. 2
      main/inc/global.inc.php
  3. 20
      main/inc/lib/api.lib.php
  4. 6
      main/upload/upload_ppt.php
  5. 53
      src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php

@ -1,14 +1,17 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
/**
* Edition of extensions configuration
* @package chamilo.admin
*/
$cidReset=true;
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section=SECTION_PLATFORM_ADMIN;
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
// Database Table Definitions
$tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$message = '';
@ -314,7 +317,7 @@ Display::display_header($nameTool);
//$form -> addElement('html','<br /><br />');
$form -> addElement('text', 'path_to_lzx', get_lang('PathToLzx'));
//$form -> addElement('html','<br /><br />');
$options = api_get_document_conversion_sizes();
$options = ChamiloApi::getDocumentConversionSizes();
$form -> addElement('select', 'size', get_lang('SlideSize'), $options);

@ -64,7 +64,7 @@ if (!isset($GLOBALS['_configuration'])) {
require_once $_configuration['root_sys'].'main/inc/lib/api.lib.php';
$passwordEncryption = api_get_configuration_value('password_encryption');
if ($passwordEncryption == 'bcrypt') {
if ($passwordEncryption === 'bcrypt') {
require_once __DIR__.'/../../vendor/ircmaxell/password-compat/lib/password.php';
}

@ -7997,23 +7997,3 @@ function api_protect_limit_for_session_admin()
function api_is_student_view_active() {
return (isset($_SESSION['studentview']) && $_SESSION['studentview'] == "studentview");
}
/**
* Returns an array of resolutions that can be used for the conversion of documents to images
* @return array
*/
function api_get_document_conversion_sizes()
{
return array(
'540x405'=>'540x405 (3/4)',
'640x480'=>'640x480 (3/4)',
'720x540'=>'720x540 (3/4)',
'800x600'=>'800x600 (3/4)',
'1024x576'=>'1024x576 (16/9)',
'1024x768'=>'1000x750 (3/4)',
'1280x720'=>'1280x720 (16/9)',
'1280x860'=>'1280x960 (3/4)',
'1400x1050'=>'1400x1050 (3/4)',
'1600x900'=>'1600x900 (16/9)'
);
}

@ -1,5 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
/**
* Action controller for the upload process. The display scripts (web forms) redirect
* the process here to do what needs to be done with each file.
@ -77,9 +79,9 @@ $form->addElement('header', get_lang("WelcomeOogieSubtitle"));
$form->addElement('html', Display::return_message($message, 'info', false));
$form->addElement('file', 'user_file', array(Display::return_icon('powerpoint_big.gif'), $div_upload_limit));
$form->addElement('checkbox', 'take_slide_name', '', get_lang('TakeSlideName'));
$options = api_get_document_conversion_sizes();
$options = ChamiloApi::getDocumentConversionSizes();
$form->addElement('select', 'slide_size', get_lang('SlideSize'), $options);
if (api_get_setting('search_enabled') == 'true') {
if (api_get_setting('search_enabled') === 'true') {
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
$specific_fields = get_specific_field_list();
$form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument'));

@ -0,0 +1,53 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Component\Utils;
/**
* Class ChamiloApi
* @package Chamilo\CoreBundle\Component
*/
class ChamiloApi
{
private $configuration;
private static $instance = null;
protected function __construct($configuration)
{
$this->configuration = $configuration;
}
/**
* @return ChamiloApi|null
*/
public function getInstance($configuration = null)
{
if (is_null(self::$instance)) {
self::$instance = new ChamiloApi($configuration);
}
return self::$instance;
}
/**
* Returns an array of resolutions that can be used for the conversion of documents to images
* @return array
*/
public static function getDocumentConversionSizes()
{
return array(
'540x405' => '540x405 (3/4)',
'640x480' => '640x480 (3/4)',
'720x540' => '720x540 (3/4)',
'800x600' => '800x600 (3/4)',
'1024x576' => '1024x576 (16/9)',
'1024x768' => '1000x750 (3/4)',
'1280x720' => '1280x720 (16/9)',
'1280x860' => '1280x960 (3/4)',
'1400x1050' => '1400x1050 (3/4)',
'1600x900' => '1600x900 (16/9)',
);
}
}
Loading…
Cancel
Save