[Customisation Database Commits] r358 - in /trunk/titania: ./ contributions/ includes/ includes/core/ includes/objects/ language/en/ styles/default/template/contributions/
Nathan Guse
exreaction at phpbb.com
Mon Sep 14 17:45:56 BST 2009
Author: exreaction
Date: Mon Sep 14 17:45:56 2009
New Revision: 358
Log:
Lots of stuff, mostly focusing on the contrib manage page.
Updated the compiled install
Updated the contrib create to follow the same setup as contrib manage
Generate category select handles padding too now to make it easier to follow
Error checking for the categories selected, ex: no style categories if mod type selected
Resyncing the contrib count for categories when submitting/updating them
Fixing the type ids in the installer, had the wrong numbers before
Removed:
trunk/titania/styles/default/template/contributions/contribution_create.html
Modified:
trunk/titania/compiled_install.php
trunk/titania/contributions/create.php
trunk/titania/contributions/manage.php
trunk/titania/includes/core/cache.php
trunk/titania/includes/core/titania.php
trunk/titania/includes/functions_posting.php
trunk/titania/includes/objects/contribution.php
trunk/titania/install.php
trunk/titania/language/en/common.php
trunk/titania/language/en/contributions.php
trunk/titania/styles/default/template/contributions/contribution_manage.html
Modified: trunk/titania/compiled_install.php
==============================================================================
*** trunk/titania/compiled_install.php (original)
--- trunk/titania/compiled_install.php Mon Sep 14 17:45:56 2009
***************
*** 42,48 ****
$version_config_name = 'titania_version';
$versions = array(
! '0.1.14' => array(
'table_add' => array(
array(TITANIA_ATTACHMENTS_TABLE, array(
'COLUMNS' => array(
--- 42,48 ----
$version_config_name = 'titania_version';
$versions = array(
! '0.1.16' => array(
'table_add' => array(
array(TITANIA_ATTACHMENTS_TABLE, array(
'COLUMNS' => array(
***************
*** 277,289 ****
--- 277,293 ----
'contrib_id' => array('UINT', 0),
'contrib_validated' => array('BOOL', 0),
'attachment_id' => array('UINT', 0),
+ 'revision_version' => array('VCHAR', ''),
'revision_name' => array('STEXT_UNI', '', 'true_sort'),
'revision_time' => array('UINT:11', 0),
+ 'validation_date' => array('UINT:11', 0),
),
'PRIMARY_KEY' => 'revision_id',
'KEYS' => array(
'contrib_id' => array('INDEX', 'contrib_id'),
'contrib_validated' => array('INDEX', 'contrib_validated'),
+ 'revision_time' => array('INDEX', 'revision_time'),
+ 'validation_date' => array('INDEX', 'validation_date'),
),
)),
array(TITANIA_TAG_FIELDS_TABLE, array(
***************
*** 367,372 ****
--- 371,377 ----
'titania_author_mod', // Can moderate author profiles
'titania_contrib_submit', // Can submit contrib items
+ 'titania_contrib_mod', // Can moderate contrib items (manage them globally)
'titania_rate', // Can rate items
'titania_rate_reset', // Can reset the rating on items
***************
*** 387,393 ****
),
'permission_set' => array(
! array('ROLE_ADMIN_FULL', array('titania_rate_reset', 'titania_faq_mod', 'titania_post_mod', 'titania_author_mod')),
array('ROLE_MOD_FULL', array('titania_rate_reset', 'titania_faq_mod', 'titania_post', 'titania_post_edit_own', 'titania_post_delete_own', 'titania_post_mod_own')),
array('ROLE_USER_FULL', array('titania_rate', 'titania_post', 'titania_post_edit_own', 'titania_contrib_submit', 'titania_topic', 'titania_bbcode', 'titania_smilies')),
array('ROLE_USER_STANDARD', array('titania_rate', 'titania_post', 'titania_post_edit_own', 'titania_contrib_submit', 'titania_topic', 'titania_bbcode', 'titania_smilies')),
--- 392,398 ----
),
'permission_set' => array(
! array('ROLE_ADMIN_FULL', array('titania_rate_reset', 'titania_faq_mod', 'titania_post_mod', 'titania_author_mod', 'titania_contrib_mod')),
array('ROLE_MOD_FULL', array('titania_rate_reset', 'titania_faq_mod', 'titania_post', 'titania_post_edit_own', 'titania_post_delete_own', 'titania_post_mod_own')),
array('ROLE_USER_FULL', array('titania_rate', 'titania_post', 'titania_post_edit_own', 'titania_contrib_submit', 'titania_topic', 'titania_bbcode', 'titania_smilies')),
array('ROLE_USER_STANDARD', array('titania_rate', 'titania_post', 'titania_post_edit_own', 'titania_contrib_submit', 'titania_topic', 'titania_bbcode', 'titania_smilies')),
***************
*** 438,444 ****
'parent_id' => 1,
'left_id' => 20,
'right_id' => 21,
! 'category_type' => 3,
'category_name' => 'CAT_STYLES',
'category_name_clean' => 'styles',
'category_desc' => '',
--- 443,449 ----
'parent_id' => 1,
'left_id' => 20,
'right_id' => 21,
! 'category_type' => 2,
'category_name' => 'CAT_STYLES',
'category_name_clean' => 'styles',
'category_desc' => '',
Modified: trunk/titania/contributions/create.php
==============================================================================
*** trunk/titania/contributions/create.php (original)
--- trunk/titania/contributions/create.php Mon Sep 14 17:45:56 2009
***************
*** 27,86 ****
}
titania::add_lang('attachments');
! titania::load_object('contribution');
! $contrib = new titania_contribution();
$submit = (isset($_POST['submit'])) ? true : false;
! $contrib->contrib_name = utf8_normalize_nfc(request_var('name', '', true));
! $contrib->contrib_desc = utf8_normalize_nfc(request_var('description', '', true));
! $contrib_categories = request_var('contrib_category', array(0));
! $contrib->contrib_type = request_var('contrib_type', 0);
! $contrib->contrib_name_clean = request_var('permalink', '', true);
if ($submit)
{
! $error = $contrib->validate($contrib_categories);
! if (!sizeof($error))
! {
! // only if we are inserting the data
! if (!$contrib->contrib_id)
! {
! $contrib->contrib_user_id = phpbb::$user->data['user_id'];
! }
! // Temporary
! $contrib->contrib_visible = 1;
! $contrib->submit();
// Create relations
! $contrib->put_contrib_in_categories($contrib_categories);
// Update are attachments.
! $attachment->update_orphans($contrib->contrib_id);
!
! meta_refresh(3, $contrib->get_url());
! titania::error_box('SUCCESS', 'CONTRIB_CREATED', TITANIA_SUCCESS);
}
}
! // Generate the selects
! generate_type_select($contrib->contrib_type);
generate_category_select($contrib_categories);
$template->assign_vars(array(
! 'U_ACTION' => titania::$url->build_url('contributions/create'),
!
! 'ERROR_MSG' => ($submit && sizeof($error)) ? implode('<br />', $error) : false,
! 'CONTRIB_NAME' => $contrib->contrib_name,
! 'CONTRIB_PERMALINK' => $contrib->contrib_name_clean,
! 'CONTRIB_DESC' => $contrib->contrib_desc,
));
titania::page_header('CREATE_CONTRIBUTION');
! titania::page_footer(true, 'contributions/contribution_create.html');
\ No newline at end of file
--- 27,103 ----
}
titania::add_lang('attachments');
! titania::load_object(array('contribution', 'author'));
! titania::$contrib = new titania_contribution();
!
! titania::$contrib->contrib_user_id = phpbb::$user->data['user_id'];
! titania::$contrib->author = new titania_author(phpbb::$user->data['user_id']);
! titania::$contrib->author->load();
!
! // Load the message object
! titania::load_tool('message');
! $message = new titania_message(titania::$contrib);
! $message->set_auth(array(
! 'bbcode' => phpbb::$auth->acl_get('titania_bbcode'),
! 'smilies' => phpbb::$auth->acl_get('titania_smilies'),
! ));
! $message->set_settings(array(
! 'display_error' => false,
! 'display_subject' => false,
! 'subject_name' => 'name',
! ));
$submit = (isset($_POST['submit'])) ? true : false;
! $contrib_categories = array();
if ($submit)
{
! $post_data = $message->request_data();
! titania::$contrib->post_data($post_data);
! $contrib_categories = request_var('contrib_category', array(0));
! titania::$contrib->__set_array(array(
! 'contrib_type' => request_var('contrib_type', 0),
! 'contrib_name_clean' => request_var('permalink', '', true),
! 'contrib_visible' => 1,
! ));
! $error = titania::$contrib->validate($contrib_categories);
! if (($validate_form_key = $message->validate_form_key()) !== false)
! {
! $error[] = $validate_form_key;
! }
!
! if (!sizeof($error))
! {
! titania::$contrib->submit();
// Create relations
! titania::$contrib->put_contrib_in_categories($contrib_categories);
// Update are attachments.
! $attachment->update_orphans(titania::$contrib->contrib_id);
! redirect(titania::$contrib->get_url());
}
}
! // Generate some stuff
! generate_type_select(titania::$contrib->contrib_type);
generate_category_select($contrib_categories);
+ titania::$contrib->assign_details();
+ $message->display();
$template->assign_vars(array(
! 'S_POST_ACTION' => titania::$url->build_url('contributions/create'),
! 'S_CREATE' => true,
! 'CONTRIB_PERMALINK' => titania::$contrib->contrib_name_clean,
! 'ERROR_MSG' => ($submit && sizeof($error)) ? implode('<br />', $error) : false,
));
titania::page_header('CREATE_CONTRIBUTION');
! titania::page_footer(true, 'contributions/contribution_manage.html');
\ No newline at end of file
Modified: trunk/titania/contributions/manage.php
==============================================================================
*** trunk/titania/contributions/manage.php (original)
--- trunk/titania/contributions/manage.php Mon Sep 14 17:45:56 2009
***************
*** 23,29 ****
titania::load_object('contribution');
load_contrib();
- titania::$contrib->assign_details();
if (!titania::$contrib->is_author && !titania::$contrib->is_active_coauthor && !phpbb::$auth->acl_get('titania_contrib_mod'))
{
--- 23,28 ----
***************
*** 66,74 ****
titania::$contrib->submit();
// Create relations
! titania::$contrib->put_contrib_in_categories($contrib_categories, true);
!
! meta_refresh(3, titania::$contrib->get_url());
titania::error_box('SUCCESS', 'CONTRIB_UPDATED', TITANIA_SUCCESS);
}
--- 65,71 ----
titania::$contrib->submit();
// Create relations
! titania::$contrib->put_contrib_in_categories($contrib_categories);
titania::error_box('SUCCESS', 'CONTRIB_UPDATED', TITANIA_SUCCESS);
}
***************
*** 86,94 ****
phpbb::$db->sql_freeresult($result);
}
! // Generate the selects
generate_type_select(titania::$contrib->contrib_type);
generate_category_select($contrib_categories);
$message->display();
$template->assign_vars(array(
--- 83,92 ----
phpbb::$db->sql_freeresult($result);
}
! // Generate some stuff
generate_type_select(titania::$contrib->contrib_type);
generate_category_select($contrib_categories);
+ titania::$contrib->assign_details();
$message->display();
$template->assign_vars(array(
Modified: trunk/titania/includes/core/cache.php
==============================================================================
*** trunk/titania/includes/core/cache.php (original)
--- trunk/titania/includes/core/cache.php Mon Sep 14 17:45:56 2009
***************
*** 30,61 ****
/**
* Get categories by tag type
*
! * @param int $tag_type
! * @return array of category data (field_name and field_desc)
*/
! public function get_categories($tag_type = TAG_TYPE_MOD_CATEGORY)
{
! $categories = $this->get('_titania_categories_' . $tag_type);
! if (!$categories)
{
$categories = array();
! $sql = 'SELECT * FROM ' . TITANIA_TAG_FIELDS_TABLE . '
! WHERE tag_type_id = ' . (int) $tag_type;
$result = phpbb::$db->sql_query($sql);
while ($row = phpbb::$db->sql_fetchrow($result))
{
! $categories[$row['tag_id']] = array(
! 'id' => $row['tag_id'],
! 'name' => $row['tag_field_name'],
! 'clean_name' => $row['tag_clean_name'],
! 'desc' => $row['tag_field_desc'],
! );
}
phpbb::$db->sql_freeresult($result);
! $this->put('_titania_categories_' . $tag_type, $categories);
}
return $categories;
--- 30,57 ----
/**
* Get categories by tag type
*
! * @return array of categories
*/
! public function get_categories()
{
! $categories = $this->get('_titania_categories');
! if ($categories === false)
{
$categories = array();
!
! $sql = 'SELECT *
! FROM ' . TITANIA_CATEGORIES_TABLE . '
! ORDER BY left_id ASC';
$result = phpbb::$db->sql_query($sql);
while ($row = phpbb::$db->sql_fetchrow($result))
{
! $categories[$row['category_id']] = $row;
}
phpbb::$db->sql_freeresult($result);
! $this->put('_titania_categories', $categories);
}
return $categories;
***************
*** 65,70 ****
--- 61,71 ----
* Get the list of parents for a category
*
* @param int $category_id The category id to get the parents for.
+ * @return returns an array of the categories parents, ex:
+ * array(
+ * array('category_id' => 2, 'parent_id' => 1, 'category_name_clean' => 'Modifications'),
+ * array('category_id' => 1, 'parent_id' => 0, 'category_name_clean' => 'phpBB3'),
+ * ),
*/
public function get_category_parents($category_id)
{
Modified: trunk/titania/includes/core/titania.php
==============================================================================
*** trunk/titania/includes/core/titania.php (original)
--- trunk/titania/includes/core/titania.php Mon Sep 14 17:45:56 2009
***************
*** 816,820 ****
--- 816,822 ----
}
closedir($dh);
+
+ ksort(self::$types);
}
}
Modified: trunk/titania/includes/functions_posting.php
==============================================================================
*** trunk/titania/includes/functions_posting.php (original)
--- trunk/titania/includes/functions_posting.php Mon Sep 14 17:45:56 2009
***************
*** 17,23 ****
}
/*
! * This is a temporary function
*
* @param array $selected
* @return void
--- 17,23 ----
}
/*
! * Generate the category select (much is from the make_jumpbox function)
*
* @param array $selected
* @return void
***************
*** 29,50 ****
$selected = array($selected);
}
! $sql = 'SELECT *
! FROM ' . TITANIA_CATEGORIES_TABLE . '
! WHERE category_visible = 1';
! $result = phpbb::$db->sql_query($sql);
! while ($category = phpbb::$db->sql_fetchrow($result))
{
phpbb::$template->assign_block_vars('category_select', array(
! 'S_IS_SELECTED' => (in_array($category['category_id'], $selected)) ? true : false,
! 'VALUE' => $category['category_id'],
! 'TYPE' => $category['category_type'],
! 'NAME' => (isset(phpbb::$user->lang[$category['category_name']])) ? phpbb::$user->lang[$category['category_name']] : $category['category_name'],
));
}
- phpbb::$db->sql_freeresult($result);
}
/*
--- 29,73 ----
$selected = array($selected);
}
! $right = $padding = 0;
! $padding_store = array('0' => 0);
! $categories = titania::$cache->get_categories();
!
! foreach ($categories as $row)
{
+ if ($row['left_id'] < $right)
+ {
+ $padding++;
+ $padding_store[$row['parent_id']] = $padding;
+ }
+ else if ($row['left_id'] > $right + 1)
+ {
+ $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : $padding;
+ }
+
+ $right = $row['right_id'];
+
+ if ($row['category_type'] == 0 && ($row['left_id'] + 1 == $row['right_id']))
+ {
+ // Non-postable forum with no subforums, don't display
+ continue;
+ }
+
phpbb::$template->assign_block_vars('category_select', array(
! 'S_SELECTED' => (in_array($row['category_id'], $selected)) ? true : false,
! 'S_DISABLED' => ($row['category_type'] == 0) ? true : false,
! 'VALUE' => $row['category_id'],
! 'TYPE' => $row['category_type'],
! 'NAME' => (isset(phpbb::$user->lang[$row['category_name']])) ? phpbb::$user->lang[$row['category_name']] : $row['category_name'],
));
+
+ for ($i = 0; $i < $padding; $i++)
+ {
+ phpbb::$template->assign_block_vars('category_select.level', array());
+ }
}
}
/*
***************
*** 56,62 ****
function generate_type_select($selected = false)
{
phpbb::$template->assign_block_vars('type_select', array(
! 'S_IS_SELECTED' => ($selected) ? false : true,
'VALUE' => 0,
'NAME' => phpbb::$user->lang['SELECT_CONTRIB_TYPE'],
--- 79,85 ----
function generate_type_select($selected = false)
{
phpbb::$template->assign_block_vars('type_select', array(
! 'S_IS_SELECTED' => ($selected === false) ? true : false,
'VALUE' => 0,
'NAME' => phpbb::$user->lang['SELECT_CONTRIB_TYPE'],
Modified: trunk/titania/includes/objects/contribution.php
==============================================================================
*** trunk/titania/includes/objects/contribution.php (original)
--- trunk/titania/includes/objects/contribution.php Mon Sep 14 17:45:56 2009
***************
*** 142,147 ****
--- 142,163 ----
{
$error[] = phpbb::$user->lang['EMPTY_CATEGORY'];
}
+ else
+ {
+ $categories = titania::$cache->get_categories();
+
+ foreach ($contrib_categories as $category)
+ {
+ if (!isset($categories[$category]))
+ {
+ $error[] = phpbb::$user->lang['NO_CATEGORY'];
+ }
+ else if ($categories[$category]['category_type'] != $this->contrib_type)
+ {
+ $error[] = phpbb::$user->lang['WRONG_CATEGORY'];
+ }
+ }
+ }
if (!$this->contrib_desc)
{
***************
*** 492,521 ****
* @param bool $update
* @return void
*/
! public function put_contrib_in_categories($contrib_categories = array(), $update = false)
{
! // Prune the old relations if we are updating the contrib
! if ($update)
{
! $sql = 'DELETE
! FROM ' . TITANIA_CONTRIB_IN_CATEGORIES_TABLE . '
! WHERE contrib_id = ' . $this->contrib_id;
phpbb::$db->sql_query($sql);
}
if (!sizeof($contrib_categories))
{
return;
}
! $sql_ary = array();
foreach ($contrib_categories as $category_id)
{
$sql_ary[] = array(
'contrib_id' => $this->contrib_id,
'category_id' => $category_id,
);
}
phpbb::$db->sql_multi_insert(TITANIA_CONTRIB_IN_CATEGORIES_TABLE, $sql_ary);
}
}
--- 508,585 ----
* @param bool $update
* @return void
*/
! public function put_contrib_in_categories($contrib_categories = array())
{
! if (!$this->contrib_id)
{
! return;
! }
!
! // Get all of the categories that we are in and their parents to resync the count
! $categories_to_update = array();
! $sql = 'SELECT category_id FROM ' . TITANIA_CONTRIB_IN_CATEGORIES_TABLE . '
! WHERE contrib_id = ' . $this->contrib_id;
! $result = phpbb::$db->sql_query($sql);
! while ($row = phpbb::$db->sql_fetchrow($result))
! {
! $categories_to_update[] = $row['category_id'];
!
! $parents = titania::$cache->get_category_parents($row['category_id']);
! foreach ($parents as $parent)
! {
! $categories_to_update[] = $parent['category_id'];
! }
! }
! phpbb::$db->sql_freeresult($result);
!
! // Resync the count
! if (sizeof($categories_to_update))
! {
! $categories_to_update = array_unique($categories_to_update);
!
! $sql = 'UPDATE ' . TITANIA_CATEGORIES_TABLE . '
! SET category_contribs = category_contribs - 1
! WHERE ' . phpbb::$db->sql_in_set('category_id', $categories_to_update);
phpbb::$db->sql_query($sql);
}
+ // Remove them from the old categories
+ $sql = 'DELETE
+ FROM ' . TITANIA_CONTRIB_IN_CATEGORIES_TABLE . '
+ WHERE contrib_id = ' . $this->contrib_id;
+ phpbb::$db->sql_query($sql);
+
if (!sizeof($contrib_categories))
{
return;
}
! $categories_to_update = $sql_ary = array();
foreach ($contrib_categories as $category_id)
{
$sql_ary[] = array(
'contrib_id' => $this->contrib_id,
'category_id' => $category_id,
);
+
+ $categories_to_update[] = $category_id;
+ $parents = titania::$cache->get_category_parents($category_id);
+ foreach ($parents as $parent)
+ {
+ $categories_to_update[] = $parent['category_id'];
+ }
}
phpbb::$db->sql_multi_insert(TITANIA_CONTRIB_IN_CATEGORIES_TABLE, $sql_ary);
+
+ // Resync the count
+ if (sizeof($categories_to_update))
+ {
+ $categories_to_update = array_unique($categories_to_update);
+
+ $sql = 'UPDATE ' . TITANIA_CATEGORIES_TABLE . '
+ SET category_contribs = category_contribs + 1
+ WHERE ' . phpbb::$db->sql_in_set('category_id', $categories_to_update);
+ phpbb::$db->sql_query($sql);
+ }
}
}
Modified: trunk/titania/install.php
==============================================================================
*** trunk/titania/install.php (original)
--- trunk/titania/install.php Mon Sep 14 17:45:56 2009
***************
*** 572,578 ****
'parent_id' => 1,
'left_id' => 20,
'right_id' => 21,
! 'category_type' => 3,
'category_name' => 'CAT_STYLES',
'category_name_clean' => 'styles',
'category_desc' => '',
--- 572,578 ----
'parent_id' => 1,
'left_id' => 20,
'right_id' => 21,
! 'category_type' => 2,
'category_name' => 'CAT_STYLES',
'category_name_clean' => 'styles',
'category_desc' => '',
***************
*** 583,589 ****
'parent_id' => 2,
'left_id' => 3,
'right_id' => 4,
! 'category_type' => 2,
'category_name' => 'CAT_COSMETIC',
'category_name_clean' => 'cosmetic',
'category_desc' => '',
--- 583,589 ----
'parent_id' => 2,
'left_id' => 3,
'right_id' => 4,
! 'category_type' => 1,
'category_name' => 'CAT_COSMETIC',
'category_name_clean' => 'cosmetic',
'category_desc' => '',
***************
*** 594,600 ****
'parent_id' => 2,
'left_id' => 5,
'right_id' => 6,
! 'category_type' => 2,
'category_name' => 'CAT_ADMIN_TOOLS',
'category_name_clean' => 'admin-tools',
'category_desc' => '',
--- 594,600 ----
'parent_id' => 2,
'left_id' => 5,
'right_id' => 6,
! 'category_type' => 1,
'category_name' => 'CAT_ADMIN_TOOLS',
'category_name_clean' => 'admin-tools',
'category_desc' => '',
***************
*** 605,611 ****
'parent_id' => 2,
'left_id' => 7,
'right_id' => 8,
! 'category_type' => 2,
'category_name' => 'CAT_SECURITY',
'category_name_clean' => 'security',
'category_desc' => '',
--- 605,611 ----
'parent_id' => 2,
'left_id' => 7,
'right_id' => 8,
! 'category_type' => 1,
'category_name' => 'CAT_SECURITY',
'category_name_clean' => 'security',
'category_desc' => '',
***************
*** 616,622 ****
'parent_id' => 2,
'left_id' => 9,
'right_id' => 10,
! 'category_type' => 2,
'category_name' => 'CAT_COMMUNICATION',
'category_name_clean' => 'communication',
'category_desc' => '',
--- 616,622 ----
'parent_id' => 2,
'left_id' => 9,
'right_id' => 10,
! 'category_type' => 1,
'category_name' => 'CAT_COMMUNICATION',
'category_name_clean' => 'communication',
'category_desc' => '',
***************
*** 627,633 ****
'parent_id' => 2,
'left_id' => 11,
'right_id' => 12,
! 'category_type' => 2,
'category_name' => 'CAT_PROFILE_UCP',
'category_name_clean' => 'profile',
'category_desc' => '',
--- 627,633 ----
'parent_id' => 2,
'left_id' => 11,
'right_id' => 12,
! 'category_type' => 1,
'category_name' => 'CAT_PROFILE_UCP',
'category_name_clean' => 'profile',
'category_desc' => '',
***************
*** 638,644 ****
'parent_id' => 2,
'left_id' => 13,
'right_id' => 14,
! 'category_type' => 2,
'category_name' => 'CAT_ADDONS',
'category_name_clean' => 'addons',
'category_desc' => '',
--- 638,644 ----
'parent_id' => 2,
'left_id' => 13,
'right_id' => 14,
! 'category_type' => 1,
'category_name' => 'CAT_ADDONS',
'category_name_clean' => 'addons',
'category_desc' => '',
***************
*** 649,655 ****
'parent_id' => 2,
'left_id' => 15,
'right_id' => 16,
! 'category_type' => 2,
'category_name' => 'CAT_ANTI_SPAM',
'category_name_clean' => 'anti-spam',
'category_desc' => '',
--- 649,655 ----
'parent_id' => 2,
'left_id' => 15,
'right_id' => 16,
! 'category_type' => 1,
'category_name' => 'CAT_ANTI_SPAM',
'category_name_clean' => 'anti-spam',
'category_desc' => '',
***************
*** 660,666 ****
'parent_id' => 2,
'left_id' => 17,
'right_id' => 18,
! 'category_type' => 2,
'category_name' => 'CAT_ENTERTAINMENT',
'category_name_clean' => 'entertainment',
'category_desc' => '',
--- 660,666 ----
'parent_id' => 2,
'left_id' => 17,
'right_id' => 18,
! 'category_type' => 1,
'category_name' => 'CAT_ENTERTAINMENT',
'category_name_clean' => 'entertainment',
'category_desc' => '',
***************
*** 683,689 ****
$mod = array(array(
'contrib_id' => 1,
'contrib_user_id' => phpbb::$user->data['user_id'],
! 'contrib_type' => 2,
'contrib_name' => 'Nub Mod',
'contrib_name_clean' => 'nub_mod',
'contrib_desc' => 'This mod will turn all users into nubs.',
--- 683,689 ----
$mod = array(array(
'contrib_id' => 1,
'contrib_user_id' => phpbb::$user->data['user_id'],
! 'contrib_type' => 1,
'contrib_name' => 'Nub Mod',
'contrib_name_clean' => 'nub_mod',
'contrib_desc' => 'This mod will turn all users into nubs.',
Modified: trunk/titania/language/en/common.php
==============================================================================
*** trunk/titania/language/en/common.php (original)
--- trunk/titania/language/en/common.php Mon Sep 14 17:45:56 2009
***************
*** 40,45 ****
--- 40,46 ----
'BAD_RATING' => 'Rating attempt failed.',
'CONTRIBUTION' => 'Contribution',
+ 'MULTI_SELECT_EXPLAIN' => 'Hold down CTRL and click to select multiple.',
'CACHE_PURGED' => 'Cache has been successfully purged',
'CATEGORY' => 'Category',
'CAT_ADDONS' => 'Add-ons',
Modified: trunk/titania/language/en/contributions.php
==============================================================================
*** trunk/titania/language/en/contributions.php (original)
--- trunk/titania/language/en/contributions.php Mon Sep 14 17:45:56 2009
***************
*** 70,75 ****
--- 70,77 ----
'LOGIN_EXPLAIN_CONTRIB' => 'In order to create a new contribution you need to be registered',
+ 'NO_CATEGORY' => 'The selected category does not exist',
+ 'WRONG_CATEGORY' => 'You can only put this contribution in the same category type as the contribution type.',
'NEW_TOPIC' => 'New Topic',
'NEW_CONTRIBUTION' => 'New Contribution',
'EDIT_CONTRIBUTION' => 'Edit Contribution',
Removed: trunk/titania/styles/default/template/contributions/contribution_create.html
==============================================================================
*** trunk/titania/styles/default/template/contributions/contribution_create.html (original)
--- trunk/titania/styles/default/template/contributions/contribution_create.html (removed)
***************
*** 1,51 ****
- <!-- INCLUDE contributions/contribution_header.html -->
-
- <h2 class="section-title">{PAGE_TITLE} :: {L_NEW_CONTRIBUTION}</h2>
-
- <!-- IF ERROR_MSG --><p class="error">{ERROR_MSG}</p><!-- ENDIF -->
-
- <form action="{U_ACTION}" method="post">
- <fieldset>
- <dl style="clear: left;">
- <dt><label for="contrib_type">{L_CONTRIB_TYPE}:</label></dt>
- <dd>
- <select name="contrib_type" id="contrib_type">
- <!-- BEGIN type_select -->
- <option value="{type_select.VALUE}"<!-- IF type_select.S_IS_SELECTED --> selected="selected"<!-- ENDIF -->>{type_select.NAME}</option>
- <!-- END type_select -->
- </select>
- </dd>
- </dl>
- <dl style="clear: left;">
- <dt><label for="contrib_category">{L_CONTRIB_CATEGORY}:</label></dt>
- <dd>
- <select name="contrib_category[]" id="contrib_category" multiple="multiple" size="4">
- <!-- BEGIN category_select -->
- <option value="{category_select.VALUE}"<!-- IF category_select.S_IS_SELECTED --> selected="selected"<!-- ENDIF -->>{category_select.NAME}</option>
- <!-- END category_select -->
- </select>
- </dd>
- </dl>
- <dl style="clear: left;">
- <dt><label for="name">{L_CONTRIB_NAME}:</label></dt>
- <dd><input type="text" name="name" id="name" size="45" maxlength="60" tabindex="1" value="{CONTRIB_NAME}" class="inputbox autowidth" /></dd>
- </dl>
- <dl style="clear: left;">
- <dt><label for="permalink">{L_CONTRIB_PERMALINK}:</label></dt>
- <dd><input type="text" name="permalink" id="permalink" size="45" maxlength="60" tabindex="1" value="{CONTRIB_PERMALINK}" class="inputbox autowidth" /></dd>
- </dl>
- <dl style="clear: left;">
- <dt><label for="description">{L_CONTRIB_DESCRIPTION}:</label></dt>
- <dd><textarea name="description" id="description" class="inputbox" cols="40" rows="5">{CONTRIB_DESC}</textarea></dd>
- </dl>
- </fieldset>
-
- <fieldset class="submit-buttons">
- <input type="reset" value="{L_RESET}" name="reset" class="button2" />
- <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
- {S_FORM_TOKEN}
- </fieldset>
- </form>
-
-
- <!-- INCLUDE contributions/contribution_footer.html -->
\ No newline at end of file
--- 0 ----
Modified: trunk/titania/styles/default/template/contributions/contribution_manage.html
==============================================================================
*** trunk/titania/styles/default/template/contributions/contribution_manage.html (original)
--- trunk/titania/styles/default/template/contributions/contribution_manage.html Mon Sep 14 17:45:56 2009
***************
*** 1,6 ****
<!-- INCLUDE contributions/contribution_header.html -->
! <h2 class="section-title">{CONTRIB_NAME} :: {PAGE_TITLE}</h2>
<!-- IF ERROR_MSG --><p class="error">{ERROR_MSG}</p><!-- ENDIF -->
--- 1,6 ----
<!-- INCLUDE contributions/contribution_header.html -->
! <h2 class="section-title"><!-- IF CONTRIB_NAME -->{CONTRIB_NAME} :: {PAGE_TITLE}<!-- ELSE -->{PAGE_TITLE}<!-- ENDIF --></h2>
<!-- IF ERROR_MSG --><p class="error">{ERROR_MSG}</p><!-- ENDIF -->
***************
*** 17,27 ****
</dd>
</dl>
<dl style="clear: left;">
! <dt><label for="contrib_category">{L_CONTRIB_CATEGORY}:</label></dt>
<dd>
! <select name="contrib_category[]" id="contrib_category" multiple="multiple" size="4">
<!-- BEGIN category_select -->
! <option value="{category_select.VALUE}"<!-- IF category_select.S_IS_SELECTED --> selected="selected"<!-- ENDIF -->>{category_select.NAME}</option>
<!-- END category_select -->
</select>
</dd>
--- 17,29 ----
</dd>
</dl>
<dl style="clear: left;">
! <dt><label for="contrib_category">{L_CONTRIB_CATEGORY}:</label><br /><span>{L_MULTI_SELECT_EXPLAIN}</span></dt>
<dd>
! <select name="contrib_category[]" id="contrib_category" multiple="multiple" size="5">
<!-- BEGIN category_select -->
! <option value="{category_select.VALUE}"<!-- IF category_select.S_SELECTED --> selected="selected"<!-- ENDIF --><!-- IF category_select.S_DISABLED --> disabled="disabled"<!-- ENDIF -->>
! <!-- BEGIN level --> <!-- END level -->{category_select.NAME}
! </option>
<!-- END category_select -->
</select>
</dd>
***************
*** 30,37 ****
<dt><label for="name">{L_CONTRIB_NAME}:</label></dt>
<dd><input type="text" name="{POSTING_SUBJECT_NAME}" id="{POSTING_SUBJECT_NAME}" size="45" maxlength="60" value="{CONTRIB_NAME}" class="inputbox autowidth" /></dd>
</dl>
! <!-- INCLUDE posting/posting_basic_editor.html -->
</fieldset>
<fieldset class="submit-buttons">
<input type="reset" value="{L_RESET}" name="reset" class="button2" />
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
--- 32,49 ----
<dt><label for="name">{L_CONTRIB_NAME}:</label></dt>
<dd><input type="text" name="{POSTING_SUBJECT_NAME}" id="{POSTING_SUBJECT_NAME}" size="45" maxlength="60" value="{CONTRIB_NAME}" class="inputbox autowidth" /></dd>
</dl>
! <!-- IF S_CREATE -->
! <dl style="clear: left;">
! <dt><label for="permalink">{L_CONTRIB_PERMALINK}:</label></dt>
! <dd><input type="text" name="permalink" id="permalink" size="45" maxlength="60" tabindex="1" value="{CONTRIB_PERMALINK}" class="inputbox autowidth" /></dd>
! </dl>
! <!-- ENDIF -->
! <dl style="clear: left;">
! <dt><label for="{POSTING_TEXT_NAME}">{L_CONTRIB_DESCRIPTION}:</label></dt>
! <dd></dd>
! </dl>
</fieldset>
+ <!-- INCLUDE posting/posting_basic_editor.html -->
<fieldset class="submit-buttons">
<input type="reset" value="{L_RESET}" name="reset" class="button2" />
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
More information about the customisationdb-commits
mailing list