plugin_config = &$config; } public function render_element_content($content, $picture) { global $template; if (!$this->plugin_config->hasPermission('add')) { return $content; } load_language('plugin.lang', T4U_PLUGIN_LANG); $template->assign('T4U_JS', T4U_JS); $template->assign('T4U_CSS', T4U_CSS); $template->assign('T4U_IMGS', T4U_IMGS); $template->assign('T4U_PERMISSION_DELETE', $this->plugin_config->hasPermission('delete')); $template->assign('T4U_UPDATE_SCRIPT', get_root_url().'ws.php?format=json&method='.T4U_WS.'update'); $template->assign('T4U_UPDATE_METHOD', T4U_WS.'update'); $template->assign('T4U_GET_SCRIPT', get_root_url().'ws.php?format=json&method='.T4U_WS.'list'); $template->assign('T4U_IMAGE_ID', $picture['id']); $template->assign('T4U_REFERER', urlencode($picture['url'])); $template->assign('T4U_PERMISSION_DELETE', $this->plugin_config->hasPermission('delete')); $related_tags = array(); if (!empty($template->smarty->_tpl_vars['related_tags'])) { foreach ($template->smarty->_tpl_vars['related_tags'] as $id => $tag_infos) { $related_tags['~~'.$tag_infos['id'].'~~'] = $tag_infos['name']; } } $template->assign('T4U_RELATED_TAGS', $related_tags); $template->set_filename('add_tags', T4U_TEMPLATE.'/add_tags.tpl'); $plugin_picture_before = $template->get_template_vars('PLUGIN_PICTURE_BEFORE'); $plugin_picture_before .= $template->parse('add_tags', true); $template->append('PLUGIN_PICTURE_BEFORE', $plugin_picture_before); return $content; } } ?>