Skip to content

Commit

Permalink
lib MDL-19236 Added phpdocs and copyrights
Browse files Browse the repository at this point in the history
  • Loading branch information
samhemelryk committed May 26, 2009
1 parent 5b5c385 commit 226617e
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 159 deletions.
67 changes: 30 additions & 37 deletions lib/html2text.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
<?php

/*************************************************************************
* *
* class.html2text.inc *
* *
*************************************************************************
* *
* Converts HTML to formatted plain text *
* *
* Copyright (c) 2005-2007 Jon Abernathy <jon@chuggnutt.com> *
* All rights reserved. *
* *
* This script 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; either version 2 of the License, or *
* (at your option) any later version. *
* *
* The GNU General Public License can be found at *
* http://www.gnu.org/copyleft/gpl.html. *
* *
* This script is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* Author(s): Jon Abernathy <jon@chuggnutt.com> *
* *
* Last modified: 08/08/07 *
* *
*************************************************************************/

// This file is part of Moodle - http://moodle.org/
//
// Moodle 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, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
//
// Author(s): Jon Abernathy <jon@chuggnutt.com>
// Copyright (c) 2005-2007 Jon Abernathy <jon@chuggnutt.com>

/**
* Takes HTML and converts it to formatted, plain text.
Expand Down Expand Up @@ -100,9 +87,15 @@
*
* *** End of the housecleaning updates. Updated 08/08/07.
*
* @author Jon Abernathy <jon@chuggnutt.com>
* @version 1.0.0
* @since PHP 4.0.2
* @package moodlecore
* @copyright Jon Abernathy <jon@chuggnutt.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* @package moodlecore
* @copyright Jon Abernathy <jon@chuggnutt.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class html2text
{
Expand Down Expand Up @@ -218,7 +211,7 @@ class html2text
'-',
'*',
'£',
'EUR', // Euro sign. € ?
'EUR', // Euro sign. ?
' ' // Runs of spaces, post-handling
);

Expand Down Expand Up @@ -542,7 +535,7 @@ function _build_link_list( $link, $display )
/**
* Helper function for PRE body conversion.
*
* @param string HTML content
* @param string $text HTML content
* @access private
*/
function _convert_pre(&$text)
Expand All @@ -556,7 +549,7 @@ function _convert_pre(&$text)
/**
* Callback function for preg_replace_callback use.
*
* @param array PREG matches
* @param array $matches PREG matches
* @return string
* @access private
*/
Expand All @@ -578,7 +571,7 @@ function _preg_callback($matches)
/**
* Strtoupper multibyte wrapper function
*
* @param string
* @param string $str
* @return string
* @access private
*/
Expand Down
28 changes: 27 additions & 1 deletion lib/installlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,23 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/** INSTALL_WELCOME = 0 */
define('INSTALL_WELCOME', 0);
/** INSTALL_ENVIRONMENT = 1 */
define('INSTALL_ENVIRONMENT', 1);
/** INSTALL_PATHS = 2 */
define('INSTALL_PATHS', 2);
/** INSTALL_DOWNLOADLANG = 3 */
define('INSTALL_DOWNLOADLANG', 3);
/** INSTALL_DATABASETYPE = 4 */
define('INSTALL_DATABASETYPE', 4);
/** INSTALL_DATABASE = 5 */
define('INSTALL_DATABASE', 5);
/** INSTALL_SAVE = 6 */
define('INSTALL_SAVE', 6);

/**
*Tries to detect the right www root setting.
* Tries to detect the right www root setting.
* @return string detected www root
*/
function install_guess_wwwroot() {
Expand Down Expand Up @@ -88,6 +95,15 @@ function install_helpbutton($url, $title='') {

/**
* This is in function because we want the /install.php to parse in PHP4
*
* @param object $database
* @param string $dbhsot
* @param string $dbuser
* @param string $dbpass
* @param string $dbname
* @param string $prefix
* @param mixed $dboptions
* @return string
*/
function install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) {
try {
Expand All @@ -111,6 +127,8 @@ function install_db_validate($database, $dbhost, $dbuser, $dbpass, $dbname, $pre
* This function returns a list of languages and their full names. The
* list of available languages is fetched from install/lang/xx/installer.php
* and it's used exclusively by the installation process
*
* @global object
* @return array An associative array with contents in the form of LanguageCode => LanguageName
*/
function install_get_list_of_languages() {
Expand Down Expand Up @@ -195,6 +213,8 @@ function install_generate_configphp($database, $cfg, $userealpath=false) {
/**
* Prints complete help page used during installation.
* Does not return.
*
* @global object
* @param string $help
*/
function install_print_help_page($help) {
Expand Down Expand Up @@ -235,6 +255,8 @@ function install_print_help_page($help) {

/**
* Prints installation page header, we can no use weblib yet in isntaller.
*
* @global object
* @param array $config
* @param string $stagename
* @param string $heading
Expand Down Expand Up @@ -303,6 +325,8 @@ function install_print_header($config, $stagename, $heading, $stagetext) {

/**
* Prints installation page header, we can no use weblib yet in isntaller.
*
* @global object
* @param array $config
* @param bool $reload print reload button instead of next
* @return void
Expand Down Expand Up @@ -344,6 +368,8 @@ function install_print_footer($config, $reload=false) {
/**
* Prints css needed on installation page, tries to look like the rest of installation.
* Does not return.
*
* @global object
*/
function install_css_styles() {
global $CFG;
Expand Down
29 changes: 26 additions & 3 deletions lib/javascript-mod.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
<?php /// $Id$
<?php

/// Searches modules, filters and blocks for any Javascript files
/// that should be called on every page
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Searches modules, filters and blocks for any Javascript files
* that should be called on every page
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/** NO_MOODLE_COOKIES = true */
define('NO_MOODLE_COOKIES', true);
/** NO_UPGRADE_CHECK = true */
define('NO_UPGRADE_CHECK', true);

include('../config.php');
Expand Down
26 changes: 24 additions & 2 deletions lib/javascript.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
<?php /// $Id$
/// Load up any required Javascript libraries
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle 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, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Load up any required Javascript libraries
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
Expand Down
Loading

0 comments on commit 226617e

Please sign in to comment.