예제 #1
0
/**
* "Generic" plugin API: Delete item
*
* To be called (eventually) whenever Geeklog removes an item from the database.
* Plugins can define their own 'itemdeleted' function to be notified whenever
* an item is deleted.
*
* @param    string  $id     ID of the item
* @param    string  $type   type of the item, e.g. 'article'
* @return   void
* @since    Geeklog 1.6.0
*
*/
function PLG_itemDeleted($id, $type)
{
    global $_CONF, $_PLUGINS;
    $t = explode('.', $type);
    $plg_type = $t[0];
    // Treat template system like a plugin (since belong to core group)
    $plugintypes[] = 'template';
    require_once $_CONF['path_system'] . 'lib-template.php';
    $plugintypes = array_merge($plugintypes, $_PLUGINS);
    foreach ($plugintypes as $pi_name) {
        if ($pi_name != $plg_type) {
            $function = 'plugin_itemdeleted_' . $pi_name;
            if (function_exists($function)) {
                $function($id, $type);
            }
        }
    }
    if (function_exists('CUSTOM_itemdeleted')) {
        CUSTOM_itemdeleted($id, $type);
    }
}
예제 #2
0
/**
* "Generic" plugin API: Delete item
*
* To be called whenever glFusion removes an item from the database.
* Plugins can define their own 'itemdeleted' function to be notified whenever
* an item is deleted.
*
* @param    string  $id     ID of the item
* @param    string  $type   type of the item, e.g. 'article'
* @return   void
* @since    glFusion v1.1.6
*
*/
function PLG_itemDeleted($id, $type)
{
    global $_PLUGINS;
    $t = explode('.', $type);
    $plg_type = $t[0];
    $plugins = count($_PLUGINS);
    for ($del = 0; $del < $plugins; $del++) {
        if ($_PLUGINS[$del] != $plg_type) {
            $function = 'plugin_itemdeleted_' . $_PLUGINS[$del];
            if (function_exists($function)) {
                $function($id, $type);
            }
        }
    }
    if (function_exists('CUSTOM_itemdeleted')) {
        CUSTOM_itemdeleted($id, $type);
    }
}