skala
Juan Carlos Raña 13 years ago
commit aaccc5a089
  1. 19
      main/admin/settings.lib.php
  2. 2
      main/auth/external_login/facebook.init.php
  3. 1
      main/course_home/course_home.php
  4. 114
      main/inc/conf/auth.conf.dist.php
  5. 12
      main/inc/lib/plugin.class.php
  6. 23
      main/inc/lib/plugin.lib.php
  7. 16
      main/inc/lib/template.lib.php
  8. 2
      main/install/install_files.inc.php
  9. 2
      main/template/default/layout/layout_1_col.tpl
  10. 5
      plugin/bbb/lib/bbb_plugin.class.php
  11. 2
      plugin/olpc_peru_filter/config.php
  12. 3
      plugin/olpc_peru_filter/install.php
  13. 19
      plugin/olpc_peru_filter/lib/olpc_peru_filter_plugin.class.php
  14. 3
      plugin/static/index.php
  15. 2
      plugin/static/lang/english.php
  16. 2
      plugin/static/lang/french.php

@ -48,11 +48,14 @@ function handle_regions() {
/* We display all the possible plugins and the checkboxes */
$plugin_list = array();
$plugin_region_list = array();
$my_plugin_list = $plugin_obj->get_plugin_regions();
foreach($my_plugin_list as $plugin_item) {
$plugin_list[$plugin_item] = $plugin_item;
foreach ($my_plugin_list as $plugin_item) {
$plugin_region_list[$plugin_item] = $plugin_item;
}
//Removing course tool
unset($plugin_region_list['course_tool_plugin']);
foreach ($installed_plugins as $plugin) {
$plugin_info_file = api_get_path(SYS_PLUGIN_PATH).$plugin.'/plugin.php';
@ -69,8 +72,14 @@ function handle_regions() {
echo '<h4>'.$plugin_info['title'].' <small>v'.$plugin_info['version'].'</small></h4>';
echo '<p>'.$plugin_info['comment'].'</p>';
echo '</td><td>';
$selected_plugins = $plugin_obj->get_areas_by_plugin($plugin);
echo Display::select('plugin_'.$plugin.'[]', $plugin_list, $selected_plugins, array('multiple' => 'multiple', 'style' => 'width:500px'), true, get_lang('None'));
$selected_plugins = $plugin_obj->get_areas_by_plugin($plugin);
if ($plugin_info['is_course_plugin']) {
$region_list = array('course_tool_plugin' => 'course_tool_plugin');
} else {
$region_list = $plugin_region_list;
}
echo Display::select('plugin_'.$plugin.'[]', $region_list, $selected_plugins, array('multiple' => 'multiple', 'style' => 'width:500px'), true, get_lang('None'));
echo '</td></tr>';
}
}

@ -19,7 +19,7 @@ require_once dirname(__FILE__).'/facebook-php-sdk/src/facebook.php';
global $facebook_config;
//Loads the portal facebook settings
require_once dirname(__FILE__).'../../inc/conf/auth.conf.php';
$conf = dirname(__FILE__).'../../inc/conf/auth.conf.php';
/**
* See facebook section of the auth.conf.php file

@ -280,7 +280,6 @@ if (api_get_setting('homepage_view') == 'activity' || api_get_setting('homepage_
} elseif (api_get_setting('homepage_view') == 'vertical_activity') {
require 'vertical_activity.php';
}
$content = '<div id="course_tools">'.$content.'</div>';
$tpl = new Template($tool_name);
$tpl->assign('actions', $actions);

@ -0,0 +1,114 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Configuration file for all authentication methods. Uncomment and configure only the section(s) you need.
* @package chamilo.conf.auth
*/
/**
* Facebook
*/
/*
* Decomment those lines and put your facebook app parameters here
* Find them here : https://developers.facebook.com/apps/
$facebook_config = array( 'appId' => 'APPID',
'secret' => 'secret app',
'return_url' => api_get_path(WEB_PATH).'?action=fbconnect'
);
*/
/**
* Shibboleth
*/
// $shibb_login = ...;
/**
* LDAP
*/
/**
* Array of connection parameters
**/
$extldap_config = array(
//base dommain string
'base_dn' => 'DC=cblue,DC=be',
//admin distinguished name
'admin_dn' => 'CN=admin,dc=cblue,dc=be',
//admin password
'admin_password' => 'pass',
//ldap host
'host' => array('1.2.3.4', '2.3.4.5', '3.4.5.6'),
// filter
// 'filter' => '', // no () arround the string
//'port' => , default on 389
//protocl version (2 or 3)
'protocol_version' => 3,
// set this to 0 to connect to AD server
'referrals' => 0,
//String used to search the user in ldap. %username will ber replaced by the username.
//See extldap_get_user_search_string() function below
// 'user_search' => 'sAMAccountName=%username%', // no () arround the string
'user_search' => 'uid=%username%', // no () arround the string
//encoding used in ldap (most common are UTF-8 and ISO-8859-1
'encoding' => 'UTF-8',
//Set to true if user info have to be update at each login
'update_userinfo' => true
);
/**
* Correspondance array between chamilo user info and ldap user info
* This array is of this form :
* '<chamilo_field> => <ldap_field>
*
* If <ldap_field> is "func", then the value of <chamilo_field> will be the return value of the function
* extldap_get_<chamilo_field>($ldap_array)
* In this cas you will have to declare the extldap_get_<chamilo_field> function
*
* If <ldap_field> is a string beginning with "!", then the value will be this string without "!"
*
* If <ldap_field> is any other string then the value of <chamilo_field> will be
* $ldap_array[<ldap_field>][0]
*
* If <ldap_field> is an array then its value will be an array of values with the same rules as above
*
**/
$extldap_user_correspondance = array(
'firstname' => 'givenName',
'lastname' => 'sn',
'status' => 'func',
'admin' => 'func',
'email' => 'mail',
'auth_source' => '!extldap',
//'username' => ,
'language' => '!english',
'password' => '!PLACEHOLDER',
'extra' => array(
'title' => 'title',
'globalid' => 'employeeID',
'department' => 'department',
'country' => 'co',
'bu' => 'Company')
);
/**
* OpenID
*/
$langMainInfo = 'You may login to this site using an OpenID. You may add your OpenId URLs below, and also see a list of any OpenIDs which have already been added.';
$langMainInfoDetail = '<p>OpenID is a secure way to use one user ID and password to log in to many web sites without special software, giving the same password to each site, or losing control over which information is shared with each site that you visit.</p>';
$langMainInfoDetail .= '<p>Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. Logging in via OpenID is far more secure than cross-site logins using drupal.module.</p>';
$langMainInfoDetail .= '<p>More information on OpenID is available at <a href="http://openid.net">OpenID.net</a></p>';
/**
* CAS
*/
//$cas = ...;

@ -18,6 +18,7 @@ class Plugin {
private $settings = null;
private $strings = null; //translation strings
public $is_course_plugin = false;
/**
* When creating a new course, these settings are added to the course, in
@ -46,11 +47,12 @@ class Plugin {
function get_info() {
$result = array();
$result['title'] = $this->get_title();
$result['comment'] = $this->get_comment();
$result['version'] = $this->get_version();
$result['author'] = $this->get_author();
$result['plugin_class'] = get_class($this);
$result['title'] = $this->get_title();
$result['comment'] = $this->get_comment();
$result['version'] = $this->get_version();
$result['author'] = $this->get_author();
$result['plugin_class'] = get_class($this);
$result['is_course_plugin'] = $this->is_course_plugin;
if ($form = $this->get_settings_form()) {
$result['settings_form'] = $form;

@ -128,11 +128,14 @@ class AppPlugin {
return $this->plugin_regions;
}
function load_region($region, $main_template, $forced = false) {
function load_region($region, $main_template, $forced = false) {
if ($region == 'course_tool_plugin') {
return null;
}
ob_start();
$this->get_all_plugin_contents_by_region($region, $main_template, $forced);
$content = ob_get_contents();
ob_end_clean();
ob_end_clean();
return $content;
}
@ -147,13 +150,12 @@ class AppPlugin {
$root = api_get_path(SYS_PLUGIN_PATH);
//1. Loading english if exists
$english_path = $root.$plugin_name."/lang/english.php";
$english_path = $root.$plugin_name."/lang/english.php";
if (is_readable($english_path)) {
include $english_path;
foreach ($strings as $key => $string) {
//$$key = $string;
foreach ($strings as $key => $string) {
$GLOBALS[$key] = $string;
}
}
@ -165,8 +167,7 @@ class AppPlugin {
if (is_readable($path)) {
include $path;
if (!empty($strings)) {
foreach ($strings as $key => $string) {
//$$key = $string;
foreach ($strings as $key => $string) {
$GLOBALS[$key] = $string;
}
}
@ -182,14 +183,14 @@ class AppPlugin {
* @todo improve this function
*/
function get_all_plugin_contents_by_region($region, $template, $forced = false) {
global $_plugins;
global $_plugins;
if (isset($_plugins[$region]) && is_array($_plugins[$region])) {
//if (1) {
//if (1) {
//Load the plugin information
foreach ($_plugins[$region] as $plugin_name) {
//The plugin_info variable is available inside the plugin index
$plugin_info = $this->get_plugin_info($plugin_name, $forced);
$plugin_info = $this->get_plugin_info($plugin_name, $forced);
//We also know where the plugin is
$plugin_info['current_region'] = $region;

@ -119,13 +119,13 @@ class Template {
$this->plugin = new AppPlugin();
//1. Showing installed plugins in regions
$plugin_regions = $this->plugin->get_plugin_regions();
$plugin_regions = $this->plugin->get_plugin_regions();
foreach ($plugin_regions as $region) {
$this->set_plugin_region($region);
}
}
//2. Loading the course plugin info
global $course_plugin;
global $course_plugin;
if (isset($course_plugin) && !empty($course_plugin) && !empty($this->course_id)) {
//Load plugin get_langs
$this->plugin->load_plugin_lang_variables($course_plugin);
@ -656,11 +656,11 @@ class Template {
}
/* Sets the plugin content in a template variable */
function set_plugin_region($plugin_region) {
function set_plugin_region($plugin_region) {
if (!empty($plugin_region)) {
$content = $this->plugin->load_region($plugin_region, $this, $this->force_plugin_load);
if (!empty($content)) {
$this->assign('plugin_'.$plugin_region, $content);
$region_content = $this->plugin->load_region($plugin_region, $this, $this->force_plugin_load);
if (!empty($region_content)) {
$this->assign('plugin_'.$plugin_region, $region_content);
} else {
$this->assign('plugin_'.$plugin_region, null);
}

@ -31,7 +31,7 @@ if (defined('SYSTEM_INSTALLATION')) {
copy(api_get_path(CONFIGURATION_PATH).'mail.conf.dist.php', api_get_path(CONFIGURATION_PATH).'mail.conf.php');
copy(api_get_path(CONFIGURATION_PATH).'profile.conf.dist.php', api_get_path(CONFIGURATION_PATH).'profile.conf.php');
copy(api_get_path(CONFIGURATION_PATH).'events.conf.dist.php', api_get_path(CONFIGURATION_PATH).'events.conf.php');
//copy(api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', api_get_path(CONFIGURATION_PATH).'auth.conf.php');
copy(api_get_path(CONFIGURATION_PATH).'auth.conf.dist.php', api_get_path(CONFIGURATION_PATH).'auth.conf.php');
copy(api_get_path(CONFIGURATION_PATH).'portfolio.conf.dist.php', api_get_path(CONFIGURATION_PATH).'portfolio.conf.php');
} else {
echo 'You are not allowed here !' . __FILE__;

@ -15,7 +15,7 @@
{% if content is not null %}
<section id="main_content">
{{ content}}
{{ content }}
</section>
{% endif %}
&nbsp;

@ -8,7 +8,8 @@
*/
class BBBPlugin extends Plugin
{
public $is_course_plugin = true;
//When creating a new course this settings are added to the course
public $course_settings = array(
// array('name' => 'big_blue_button_welcome_message', 'type' => 'text'),
@ -26,7 +27,7 @@ class BBBPlugin extends Plugin
function install() {
$table = Database::get_main_table('plugin_bbb_meeting');
$sql = "CREATE TABLE $table (
$sql = "CREATE TABLE IF NOT EXISTS $table (
id INT unsigned NOT NULL auto_increment PRIMARY KEY,
c_id INT unsigned NOT NULL DEFAULT 0,
meeting_name VARCHAR(255) NOT NULL DEFAULT '',

@ -4,4 +4,4 @@
/* OLPCPeruFilter parameters that will be registered in the course settings */
require_once '../../main/inc/global.inc.php';
require_once 'lib/olpc_peru_filter_plugin.class.php';
require_once 'lib/olpc_peru_filter_plugin.class.php';

@ -10,5 +10,4 @@
*/
require_once 'config.php';
OLPCPeruFilterPlugin::create()->install();
OLPC_Peru_FilterPlugin::create()->install();

@ -1,14 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/* To show the plugin course icons you need to add these icons:
/* To show the plugin course icons you need to add these icons in the main/img Chamilo platform
* main/img/icons/22/plugin_name.png
* main/img/icons/64/plugin_name.png
* main/img/icons/64/plugin_name_na.png
*/
class OLPC_Peru_FilterPlugin extends Plugin
{
public $is_course_plugin = true;
//When creating a new course, these settings are added to the course
public $course_settings = array(
// array('name' => 'big_blue_button_welcome_message', 'type' => 'text'),
@ -29,19 +30,7 @@ class OLPC_Peru_FilterPlugin extends Plugin
$this->install_course_fields_in_all_courses();
}
function uninstall() {
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$t_options = Database::get_main_table(TABLE_MAIN_SETTINGS_OPTIONS);
//New settings
/*
$sql = "DELETE FROM $t_settings WHERE variable = 'olpc_peru_filter_tool_enable'";
Database::query($sql);
//Old settings deleting just in case
$sql = "DELETE FROM $t_settings WHERE variable = 'olpc_peru_filter_plugin'";
Database::query($sql);
$sql = "DELETE FROM $t_options WHERE variable = 'olpc_peru_filter_plugin'";
Database::query($sql);
*/
function uninstall() {
//Deleting course settings
$this->uninstall_course_fields_in_all_courses();
}

@ -10,8 +10,7 @@ $title = $title ? "<h4>$title</h4>" : '';
$css = $plugin->get_css();
$css = $css ? "<style type=\"text/css\" scoped=\"scoped\">$css</style>" : '';
if (empty($content))
{
if (empty($content)) {
echo '';
}

@ -8,8 +8,6 @@
$strings['plugin_title'] = "Static";
$strings['plugin_comment'] = "Display static html content.";
$strings['content'] = "Content";
$strings['block_title'] = "Block title";
//$strings['title'] = "Title";

@ -8,6 +8,4 @@
$strings['plugin_title'] = "Statique";
$strings['plugin_comment'] = "Affiche du contenu html.";
$strings['content'] = "Contenu";
$strings['block_title'] = "Titre du bloc";

Loading…
Cancel
Save