Commit 31378080 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files
parents 9d160909 73c63993
......@@ -1174,4 +1174,17 @@ function is_mysql() {
return (strpos(get_config('dbtype'), 'mysql') === 0);
}
/**
* function to convert an array to
* an array of placeholders (?)
* with the right number of values
*
* @param array $array input array
*/
function db_array_to_ph($array) {
return array_pad(array(), count($array), '?');
}
?>
......@@ -607,6 +607,20 @@ function hsc ($text) {
return htmlspecialchars($text, ENT_COMPAT, 'UTF-8');
}
/**
* function to convert an array of objects to
* an array containing one field per place
*
* @param array $array input array
* @param mixed $field field to look for in each object
*/
function mixed_array_to_field_array($array, $field) {
$repl_fun = create_function('$n, $field', '$n = (object)$n; return $n->{$field};');
$fields = array_pad(array(), count($array), $field);
return array_map($repl_fun, $array, $fields);
}
/**
* Used by XMLDB
*/
......
<?php
/**
* This program is part of Mahara
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage notification/email
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
require_once(get_config('docroot') . 'notification/lib.php');
class PluginNotificationEmail extends PluginNotification {
public static function notify_user($user, $data) {
// @todo
}
}
?>
<?php
/**
* This program is part of Mahara
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core or plugintype/pluginname
* @author Your Name <you@example.org>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2006102700;
$config->release = '0.1';
?>
......@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage notification/internal
* @subpackage notification/emaildigest
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
......@@ -26,8 +26,13 @@
defined('INTERNAL') || die();
class PluginNotificationEmaildigest extends Plugin {
require_once(get_config('docroot') . 'notification/lib.php');
class PluginNotificationEmaildigest extends PluginNotification {
public static function notify_user($user, $data) {
// @todo
}
}
?>
......@@ -26,7 +26,13 @@
defined('INTERNAL') || die();
class PluginNotificationInternal extends Plugin {
require_once(get_config('docroot') . 'notification/lib.php');
class PluginNotificationInternal extends PluginNotification {
public static function notify_user($user, $data) {
// @todo
}
}
......
......@@ -26,5 +26,10 @@
defined('INTERNAL') || die();
abstract class PluginNotification extends Plugin {
public abstract static function notify_user($user, $data);
}
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment