Commit 107000ed authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Merge branch 'master' of git+ssh://git.catalyst.net.nz/var/git/mahara into mahara-trunk

Conflicts:

	htdocs/lib/db/upgrade.php
parents 74cae021 389a20ab
......@@ -48,7 +48,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
if (!empty($configdata['artefactids'])) {
$artefactids = implode(', ', array_map('db_quote', $configdata['artefactids']));
if (!$mostrecent = get_records_sql_array(
'SELECT a.title, a.ctime, p.title AS parenttitle, a.id, a.parent
'SELECT a.title, ' . db_format_tsfield('a.ctime', 'ctime') . ', p.title AS parenttitle, a.id, a.parent
FROM {artefact} a
JOIN {artefact} p ON a.parent = p.id
WHERE a.artefacttype = \'blogpost\'
......@@ -60,7 +60,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
}
// format the dates
foreach ($mostrecent as &$data) {
$data->displaydate = format_date(time($data->ctime));
$data->displaydate = format_date($data->ctime);
}
$smarty = smarty_core();
$smarty->assign('mostrecent', $mostrecent);
......
......@@ -37,7 +37,7 @@ class PluginBlocktypeFiledownload extends PluginBlocktype {
}
public static function get_categories() {
return array('file');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -52,7 +52,7 @@ class PluginBlocktypeFolder extends PluginBlocktype {
}
public static function get_categories() {
return array('file');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -37,7 +37,7 @@ class PluginBlocktypeImage extends PluginBlocktype {
}
public static function get_categories() {
return array('file', 'images');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
......@@ -37,7 +37,7 @@ class PluginBlocktypeInternalmedia extends PluginBlocktype {
}
public static function get_categories() {
return array('multimedia', 'file');
return array('fileimagevideo');
}
public static function has_config() {
......
......@@ -46,7 +46,7 @@ class PluginBlocktypeExternalvideo extends SystemBlocktype {
}
public static function get_categories() {
return array('multimedia');
return array('fileimagevideo');
}
public static function render_instance(BlockInstance $instance) {
......
<h3>Main Menu</h3>
<p>The Main Menu provides you with important resources and information. There are two menus in use within the system &#8211; publicly available resources for non-logged in users and resources for logged in users. Items within these two menus will likely differ.</p>
......@@ -220,9 +220,8 @@ $string['20,30,30,20'] = 'Larger centre columns';
$string['noviewlayouts'] = 'There are no view layouts for a %s column view';
$string['blocktypecategory.feeds'] = 'External feeds';
$string['blocktypecategory.images'] = 'Images';
$string['blocktypecategory.fileimagevideo'] = 'Files, images and video';
$string['blocktypecategory.general'] = 'General';
$string['blocktypecategory.multimedia'] = 'Multimedia';
$string['notitle'] = 'No title';
$string['clickformoreinformation'] = 'Click for more information and to place feedback';
......
......@@ -786,6 +786,27 @@ function xmldb_core_upgrade($oldversion=0) {
}
if ($oldversion < 2008012400) {
$blocktypes = get_column_sql(
'SELECT DISTINCT blocktype
FROM {blocktype_installed_category}
WHERE category IN (\'file\', \'images\', \'multimedia\')'
);
delete_records_sql(
'DELETE FROM {blocktype_installed_category}
WHERE category IN (\'file\', \'images\', \'multimedia\')'
);
delete_records_sql(
'DELETE FROM {blocktype_category}
WHERE name IN (\'file\', \'images\', \'multimedia\')'
);
insert_record('blocktype_category', array('name' => 'fileimagevideo'));
foreach ($blocktypes as $bt) {
insert_record('blocktype_installed_category', array('blocktype' => $bt, 'category' => 'fileimagevideo'));
}
}
if ($oldversion < 2008012401) {
table_column('usr_registration', null, 'lang', 'text', null, null, '', '');
}
......
......@@ -447,10 +447,6 @@ function upgrade_plugin($upgrade) {
delete_records_select('artefact_installed_type', $select,
array_merge(array($pluginname),$types));
}
// install a blocktype category for this plugin
if (get_config('installed') && !record_exists('blocktype_category', 'name', $pluginname)) {
insert_record('blocktype_category', (object)array('name' => $pluginname));
}
}
// install blocktype categories.
......@@ -798,11 +794,10 @@ function sort_upgrades($k1, $k2) {
return ($weight1 > $weight2);
}
/** core blocktype categories the system exports
* (eg not tied to artefact plugins)
/** blocktype categories the system exports (including artefact categories)
*/
function get_core_blocktype_categories() {
return array('general', 'images', 'multimedia', 'feeds');
function get_blocktype_categories() {
return array('general', 'internal', 'blog', 'resume', 'fileimagevideo', 'feeds');
}
function install_blocktype_categories_for_plugin($blocktype) {
......@@ -824,13 +819,7 @@ function install_blocktype_categories_for_plugin($blocktype) {
function install_blocktype_categories() {
db_begin();
if ($artefacts = plugins_installed('artefact')) {
$artefacts = array_map(create_function('$a', 'return $a->name;'), $artefacts);
}
else {
$artefacts = array();
}
$categories = array_merge(get_core_blocktype_categories(), $artefacts);
$categories = get_blocktype_categories();
$installedcategories = get_column('blocktype_category', 'name');
if ($toinstall = array_diff($categories, $installedcategories)) {
......
......@@ -14,7 +14,7 @@
<td>
{if !$view.submittedto}
<a href="{$WWWROOT}view/delete.php?id={$view.id}" class="fr"><strong>{str tag="deletethisview" section="view"}</strong></a>
<a href="{$WWWROOT}view/blocks.php?id={$view.od}" class="fr"><strong>{str tag ="editthisview" section="view"}</strong></a>
<a href="{$WWWROOT}view/blocks.php?id={$view.id}" class="fr"><strong>{str tag ="editthisview" section="view"}</strong></a>
{/if}
<h3><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a></h3>
<div class="viewitem">
......@@ -74,7 +74,7 @@
<div class="center">{$pagination}</div>
{else}
{str tag="noviews" section="views"}
<div class="message">{str tag="noviews" section="views"}</div>
{/if}
{include file="columnleftend.tpl"}
......
......@@ -10,7 +10,7 @@
{foreach from=$options key=id item=description}
<div class="fl" style="margin: 0 .5em; text-align: center;">
<div><img src="/thumb.php?type=viewlayout&vl={$id}" alt=""></div>
<div><img src="{$WWWROOT}thumb.php?type=viewlayout&vl={$id}" alt=""></div>
<div><input type="radio" class="radio" name="layout" value="{$id}"></div>
<div>{$description|escape}</div>
</div>
......
......@@ -48,7 +48,7 @@ $form = pieform(array(
'type' => 'submitcancel',
'title' => get_string('deleteviewconfirm', 'view'),
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'view/temp.php'
'goto' => get_config('wwwroot') . 'view/'
)
),
));
......@@ -64,6 +64,6 @@ function deleteview_submit(Pieform $form, $values) {
$view->delete();
handle_event('deleteview', $viewid);
$SESSION->add_ok_msg(get_string('viewdeleted', 'view'));
redirect('/view/temp.php');
redirect('/view/');
}
?>
......@@ -32,7 +32,7 @@ define('SECTION_PLUGINNAME', 'view');
define('SECTION_PAGE', 'index');
require(dirname(dirname(__FILE__)) . '/init.php');
require('pieforms/pieform.php');
require_once('pieforms/pieform.php');
define('TITLE', get_string('myviews', 'view'));
$limit = param_integer('limit', 5);
......
......@@ -63,7 +63,7 @@ $form = pieform(array(
'type' => 'submitcancel',
'title' => get_string('submitviewconfirm', 'view', $view->title, $group->name),
'value' => array(get_string('yes'), get_string('no')),
'goto' => get_config('wwwroot') . 'view/temp.php'
'goto' => get_config('wwwroot') . 'view/'
)
),
));
......@@ -76,7 +76,7 @@ $smarty->display('view/submit.tpl');
function submitview_submit(Pieform $form, $values) {
global $SESSION, $viewid, $groupid;
update_record('view', array('submittedto' => $groupid), array('id' => $viewid));
$SESSION->add_ok_msg(get_string('submitview', 'view'));
redirect('/view/temp.php');
$SESSION->add_ok_msg(get_string('viewsubmitted', 'view'));
redirect('/view/');
}
?>
Markdown is supported
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