feature 3010 : replace trigger_action/event by trigger_notify/change

git-svn-id: http://piwigo.org/svn/trunk@28587 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2014-06-02 07:55:46 +00:00
parent f98edc7a2e
commit 4bd32005b5
62 changed files with 322 additions and 344 deletions
+3 -3
View File
@@ -83,7 +83,7 @@ SELECT id, file, path, representative_ext
pwg_mail_group(
$_POST['group'],
array(
'subject' => l10n('[%s] Visit album %s', $conf['gallery_title'], trigger_event('render_category_name', $category['name'], 'admin_cat_list')),
'subject' => l10n('[%s] Visit album %s', $conf['gallery_title'], trigger_change('render_category_name', $category['name'], 'admin_cat_list')),
// TODO : change this language variable to 'Visit album %s'
// TODO : 'language_selected' => ....
),
@@ -91,11 +91,11 @@ SELECT id, file, path, representative_ext
'filename' => 'cat_group_info',
'assign' => array(
'IMG_URL' => $img_url,
'CAT_NAME' => trigger_event('render_category_name', $category['name'], 'admin_cat_list'),
'CAT_NAME' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'),
'LINK' => make_index_url(array(
'category' => array(
'id' => $category['id'],
'name' => trigger_event('render_category_name', $category['name'], 'admin_cat_list'),
'name' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'),
'permalink' => $category['permalink']
)
)),
+1 -1
View File
@@ -301,7 +301,7 @@ SELECT id
break;
}
$filter_sets = trigger_event('perform_batch_manager_prefilters', $filter_sets, $_SESSION['bulk_manager_filter']['prefilter']);
$filter_sets = trigger_change('perform_batch_manager_prefilters', $filter_sets, $_SESSION['bulk_manager_filter']['prefilter']);
}
if (isset($_SESSION['bulk_manager_filter']['category']))
+4 -4
View File
@@ -40,7 +40,7 @@ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
check_status(ACCESS_ADMINISTRATOR);
trigger_action('loc_begin_element_set_global');
trigger_notify('loc_begin_element_set_global');
check_input_parameter('del_tags', $_POST, true, PATTERN_ID);
check_input_parameter('associate', $_POST, false, PATTERN_ID);
@@ -404,7 +404,7 @@ DELETE
}
}
trigger_action('element_set_global_action', $action, $collection);
trigger_notify('element_set_global_action', $action, $collection);
}
// +-----------------------------------------------------------------------+
@@ -429,7 +429,7 @@ if ($conf['enable_synchronization'])
$prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album'));
}
$prefilters = trigger_event('get_batch_manager_prefilters', $prefilters);
$prefilters = trigger_change('get_batch_manager_prefilters', $prefilters);
usort($prefilters, 'UC_name_compare');
$template->assign(
@@ -674,7 +674,7 @@ $template->assign(array(
'CACHE_KEYS' => get_admin_client_cache_keys(array('tags', 'categories')),
));
trigger_action('loc_end_element_set_global');
trigger_notify('loc_end_element_set_global');
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'batch_manager_global');
+2 -2
View File
@@ -39,7 +39,7 @@ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
trigger_action('loc_begin_element_set_unit');
trigger_notify('loc_begin_element_set_unit');
// +-----------------------------------------------------------------------+
// | unit mode form submission |
@@ -254,7 +254,7 @@ SELECT
));
}
trigger_action('loc_end_element_set_unit');
trigger_notify('loc_end_element_set_unit');
// +-----------------------------------------------------------------------+
// | sending html code |
+3 -3
View File
@@ -33,7 +33,7 @@ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
trigger_action('loc_begin_cat_list');
trigger_notify('loc_begin_cat_list');
if (!empty($_POST) or isset($_GET['delete']))
{
@@ -324,7 +324,7 @@ foreach ($categories as $category)
$tpl_cat =
array(
'NAME' =>
trigger_event(
trigger_change(
'render_category_name',
$category['name'],
'admin_cat_list'
@@ -363,7 +363,7 @@ foreach ($categories as $category)
$template->append('categories', $tpl_cat);
}
trigger_action('loc_end_cat_list');
trigger_notify('loc_end_cat_list');
// +-----------------------------------------------------------------------+
// | sending html code |
+2 -2
View File
@@ -103,7 +103,7 @@ SELECT galleries_url
// +-----------------------------------------------------------------------+
check_status(ACCESS_ADMINISTRATOR);
trigger_action('loc_begin_cat_modify');
trigger_notify('loc_begin_cat_modify');
//---------------------------------------------------------------- verification
if ( !isset( $_GET['cat_id'] ) || !is_numeric( $_GET['cat_id'] ) )
@@ -368,7 +368,7 @@ if ($category['is_virtual'])
$template->assign('parent_category', empty($category['id_uppercat']) ? array() : array($category['id_uppercat']));
}
trigger_action('loc_end_cat_modify');
trigger_notify('loc_end_cat_modify');
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'album_properties');
+2 -2
View File
@@ -200,9 +200,9 @@ while ($row = pwg_db_fetch_assoc($result))
'U_PICTURE' => get_root_url().'admin.php?page=photo-'.$row['image_id'],
'ID' => $row['id'],
'TN_SRC' => $thumb,
'AUTHOR' => trigger_event('render_comment_author', $author_name),
'AUTHOR' => trigger_change('render_comment_author', $author_name),
'DATE' => format_date($row['date'], true),
'CONTENT' => trigger_event('render_comment_content',$row['content']),
'CONTENT' => trigger_change('render_comment_content',$row['content']),
'IS_PENDING' => ('false' == $row['validated']),
)
);
+1 -1
View File
@@ -46,7 +46,7 @@ $tabsheet->set_id('help');
$tabsheet->select($selected);
$tabsheet->assign();
trigger_action('loc_end_help');
trigger_notify('loc_end_help');
$template->set_filenames(array('help' => 'help.tpl'));
+3 -3
View File
@@ -216,7 +216,7 @@ INSERT INTO '.SEARCH_TABLE.'
}
/*TODO - no need to get a huge number of rows from db (should take only what needed for display + SQL_CALC_FOUND_ROWS*/
$data = trigger_event('get_history', array(), $page['search'], $types);
$data = trigger_change('get_history', array(), $page['search'], $types);
usort($data, 'history_compare');
$page['nb_lines'] = count($data);
@@ -316,7 +316,7 @@ SELECT
$result = pwg_query($query);
while ($row=pwg_db_fetch_assoc($result))
{
$name_of_tag[ $row['id'] ] = '<a href="'.make_index_url( array('tags'=>array($row))).'">'.trigger_event("render_tag_name", $row['name'], $row).'</a>';
$name_of_tag[ $row['id'] ] = '<a href="'.make_index_url( array('tags'=>array($row))).'">'.trigger_change("render_tag_name", $row['name'], $row).'</a>';
}
}
@@ -408,7 +408,7 @@ SELECT
if (isset($image_infos[$line['image_id']]['label']))
{
$image_title.= ' '.trigger_event('render_element_description', $image_infos[$line['image_id']]['label']);
$image_title.= ' '.trigger_change('render_element_description', $image_infos[$line['image_id']]['label']);
}
else
{
+1 -1
View File
@@ -66,7 +66,7 @@ class check_integrity
$this->retrieve_list = array();
$this->build_ignore_list = array();
trigger_action('list_check_integrity', $this);
trigger_notify('list_check_integrity', $this);
// Information
if (count($this->retrieve_list) > 0)
+9 -9
View File
@@ -162,7 +162,7 @@ DELETE FROM '.USER_CACHE_CATEGORIES_TABLE.'
WHERE cat_id IN ('.implode(',',$ids).')';
pwg_query($query);
trigger_action('delete_categories', $ids);
trigger_notify('delete_categories', $ids);
}
/**
@@ -250,7 +250,7 @@ function delete_elements($ids, $physical_deletion=false)
{
return 0;
}
trigger_action('begin_delete_elements', $ids);
trigger_notify('begin_delete_elements', $ids);
if ($physical_deletion)
{
@@ -325,7 +325,7 @@ SELECT
update_category($category_ids);
}
trigger_action('delete_elements', $ids);
trigger_notify('delete_elements', $ids);
return count($ids);
}
@@ -383,7 +383,7 @@ DELETE FROM '.USERS_TABLE.'
;';
pwg_query($query);
trigger_action('delete_user', $user_id);
trigger_notify('delete_user', $user_id);
}
/**
@@ -1573,7 +1573,7 @@ SELECT id
;';
if (count($existing_tags = array_from_query($query, 'id')) == 0)
{
$url_name = trigger_event('render_tag_url', $tag_name);
$url_name = trigger_change('render_tag_url', $tag_name);
// search existing by url name
$query = '
SELECT id
@@ -1841,7 +1841,7 @@ UPDATE '.USER_CACHE_TABLE.'
SET need_update = \'true\';';
pwg_query($query);
}
trigger_action('invalidate_user_cache', $full);
trigger_notify('invalidate_user_cache', $full);
}
/**
@@ -1976,7 +1976,7 @@ SELECT id
TAGS_TABLE,
array(
'name' => $tag_name,
'url_name' => trigger_event('render_tag_url', $tag_name),
'url_name' => trigger_change('render_tag_url', $tag_name),
)
);
@@ -2326,7 +2326,7 @@ function get_taglist($query, $only_user_language=true)
while ($row = pwg_db_fetch_assoc($result))
{
$raw_name = $row['name'];
$name = trigger_event('render_tag_name', $raw_name, $row);
$name = trigger_change('render_tag_name', $raw_name, $row);
$taglist[] = array(
'name' => $name,
@@ -2335,7 +2335,7 @@ function get_taglist($query, $only_user_language=true)
if (!$only_user_language)
{
$alt_names = trigger_event('get_tag_alt_names', array(), $raw_name);
$alt_names = trigger_change('get_tag_alt_names', array(), $raw_name);
foreach( array_diff( array_unique($alt_names), array($name) ) as $alt)
{
+1 -1
View File
@@ -177,6 +177,6 @@ SELECT
}
add_event_handler('get_history', 'get_history', EVENT_HANDLER_PRIORITY_NEUTRAL, 3);
trigger_action('functions_history_included');
trigger_notify('functions_history_included');
?>
+1 -1
View File
@@ -64,7 +64,7 @@ class pwg_image
{
$this->source_filepath = $source_filepath;
trigger_action('load_image_library', array(&$this) );
trigger_notify('load_image_library', array(&$this) );
if (is_object($this->image))
{
+1 -1
View File
@@ -88,7 +88,7 @@ class tabsheet
*/
function select($name)
{
$this->sheets = trigger_event('tabsheet_before_select', $this->sheets, $this->uniqid);
$this->sheets = trigger_change('tabsheet_before_select', $this->sheets, $this->uniqid);
if (!array_key_exists($name, $this->sheets))
{
$keys = array_keys($this->sheets);
+1 -1
View File
@@ -220,7 +220,7 @@ else
$advanced_features = array();
//$advanced_features is array of array composed of CAPTION & URL
$advanced_features = trigger_event(
$advanced_features = trigger_change(
'get_admin_advanced_features_links',
$advanced_features
);
+3 -3
View File
@@ -253,7 +253,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
}
$customize_mail_content =
trigger_event('nbm_render_global_customize_mail_content', $customize_mail_content);
trigger_change('nbm_render_global_customize_mail_content', $customize_mail_content);
// Prepare message after change language
@@ -340,7 +340,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
}
$nbm_user_customize_mail_content =
trigger_event('nbm_render_user_customize_mail_content',
trigger_change('nbm_render_user_customize_mail_content',
$customize_mail_content, $nbm_user);
if (!empty($nbm_user_customize_mail_content))
{
@@ -482,7 +482,7 @@ check_status(get_tab_status($page['mode']));
// | Add event handler |
// +-----------------------------------------------------------------------+
add_event_handler('nbm_render_global_customize_mail_content', 'render_global_customize_mail_content');
trigger_action('nbm_event_handler_added');
trigger_notify('nbm_event_handler_added');
// +-----------------------------------------------------------------------+
+1 -1
View File
@@ -415,7 +415,7 @@ $template->assign(array(
'CACHE_KEYS' => get_admin_client_cache_keys(array('tags', 'categories')),
));
trigger_action('loc_end_picture_modify');
trigger_notify('loc_end_picture_modify');
//----------------------------------------------------------- sending html code
+1 -1
View File
@@ -55,7 +55,7 @@ if
$help_content = '';
}
$help_content = trigger_event(
$help_content = trigger_change(
'get_popup_help_content', $help_content, $_GET['page']);
}
else
+1 -1
View File
@@ -176,7 +176,7 @@ while ($row = pwg_db_fetch_assoc($result))
$plugin_links = array();
//$plugin_links is array of array composed of U_HREF, U_HINT & U_CAPTION
$plugin_links =
trigger_event('get_admins_site_links',
trigger_change('get_admins_site_links',
$plugin_links, $row['id'], $is_remote);
$tpl_var['plugin_links'] = $plugin_links;
+6 -6
View File
@@ -76,7 +76,7 @@ SELECT id, name
$updates[] = array(
'id' => $tag_id,
'name' => addslashes($tag_name),
'url_name' => trigger_event('render_tag_url', $tag_name),
'url_name' => trigger_change('render_tag_url', $tag_name),
);
}
}
@@ -133,7 +133,7 @@ SELECT id, name
TAGS_TABLE,
array(
'name' => $tag_name,
'url_name' => trigger_event('render_tag_url', $tag_name),
'url_name' => trigger_change('render_tag_url', $tag_name),
)
);
@@ -218,7 +218,7 @@ SELECT
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
$name_of_tag[ $row['id'] ] = trigger_event('render_tag_name', $row['name'], $row);
$name_of_tag[ $row['id'] ] = trigger_change('render_tag_name', $row['name'], $row);
}
$tag_ids_to_delete = array_diff(
@@ -358,7 +358,7 @@ $orphan_tags = get_orphan_tags();
$orphan_tag_names = array();
foreach ($orphan_tags as $tag)
{
$orphan_tag_names[] = trigger_event('render_tag_name', $tag['name'], $tag);
$orphan_tag_names[] = trigger_change('render_tag_name', $tag['name'], $tag);
}
if (count($orphan_tag_names) > 0)
@@ -393,12 +393,12 @@ $all_tags = array();
while ($tag = pwg_db_fetch_assoc($result))
{
$raw_name = $tag['name'];
$tag['name'] = trigger_event('render_tag_name', $raw_name, $tag);
$tag['name'] = trigger_change('render_tag_name', $raw_name, $tag);
$tag['counter'] = intval(@$tag_counters[ $tag['id'] ]);
$tag['U_VIEW'] = make_index_url(array('tags'=>array($tag)));
$tag['U_EDIT'] = 'admin.php?page=batch_manager&amp;filter=tag-'.$tag['id'];
$alt_names = trigger_event('get_tag_alt_names', array(), $raw_name);
$alt_names = trigger_change('get_tag_alt_names', array(), $raw_name);
$alt_names = array_diff( array_unique($alt_names), array($tag['name']) );
if (count($alt_names))
{
+1 -1
View File
@@ -172,7 +172,7 @@ $template->assign(
)
);
trigger_action('loc_end_themes_installed');
trigger_notify('loc_end_themes_installed');
$template->set_filenames(array('themes' => 'themes_installed.tpl'));
$template->assign_var_from_handle('ADMIN_CONTENT', 'themes');