/** * Init tabsheet for history pages * @ignore */ function history_tabsheet() { global $page, $link_start; // TabSheet $tabsheet = new tabsheet(); $tabsheet->set_id('history'); $tabsheet->select($page['page']); $tabsheet->assign(); }
// | the Free Software Foundation | // | | // | This program is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ if (!defined("PHPWG_ROOT_PATH")) { die("Hacking attempt!"); } include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $my_base_url = get_root_url() . 'admin.php?page=languages'; if (isset($_GET['tab'])) { $page['tab'] = $_GET['tab']; } else { $page['tab'] = 'installed'; } $tabsheet = new tabsheet(); $tabsheet->set_id('languages'); $tabsheet->select($page['tab']); $tabsheet->assign(); if ($page['tab'] == 'update') { include PHPWG_ROOT_PATH . 'admin/updates_ext.php'; } else { include PHPWG_ROOT_PATH . 'admin/languages_' . $page['tab'] . '.php'; }
//------------------------------------------------------ $conf reinitialization load_conf_from_db(); } // restore default derivatives settings if ('sizes' == $page['section'] and isset($_GET['action']) and 'restore_settings' == $_GET['action']) { ImageStdParams::set_and_save(ImageStdParams::get_default_sizes()); pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param = \'disabled_derivatives\''); clear_derivative_cache(); $page['infos'][] = l10n('Your configuration settings are saved'); } //----------------------------------------------------- template initialization $template->set_filename('config', 'configuration_' . $page['section'] . '.tpl'); // TabSheet $tabsheet = new tabsheet(); $tabsheet->set_id('configuration'); $tabsheet->select($page['section']); $tabsheet->assign(); $action = get_root_url() . 'admin.php?page=configuration'; $action .= '&section=' . $page['section']; $template->assign(array('U_HELP' => get_root_url() . 'admin/popuphelp.php?page=configuration', 'F_ACTION' => $action)); switch ($page['section']) { case 'main': function order_by_is_local() { @(include PHPWG_ROOT_PATH . 'local/config/config.inc.php'); if (isset($conf['local_dir_site'])) { @(include PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'config/config.inc.php'); } return isset($conf['order_by']) or isset($conf['order_by_inside_category']); } if (order_by_is_local()) {
// | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ if (!defined("PHPWG_ROOT_PATH")) { die("Hacking attempt!"); } include_once PHPWG_ROOT_PATH . 'admin/include/functions.php'; // +-----------------------------------------------------------------------+ // | tabs | // +-----------------------------------------------------------------------+ include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $my_base_url = get_root_url() . 'admin.php?page='; $tabsheet = new tabsheet(); $tabsheet->set_id('groups'); $tabsheet->select('group_list'); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | Check Access and exit when user status is not ok | // +-----------------------------------------------------------------------+ check_status(ACCESS_ADMINISTRATOR); if (!empty($_POST) or isset($_GET['delete']) or isset($_GET['toggle_is_default'])) { check_pwg_token(); } // +-----------------------------------------------------------------------+ // | add a group | // +-----------------------------------------------------------------------+ if (isset($_POST['submit_add'])) { if (empty($_POST['groupname'])) { $page['errors'][] = l10n('The name of a group must not contain " or \' or be empty.'); }
if (isset($_POST['submit'])) { check_pwg_token(); $offsetX = trim($_POST['offsetX']); $offsetY = trim($_POST['offsetY']); if (strlen($offsetX) === 0 || strlen($offsetY) === 0 || !is_numeric($offsetX) || !is_numeric($offsetY)) { $page['errors'][] = 'Invalid offset value'; } if (count($page['errors']) === 0) { $stereoTable = $prefixeTable . 'stereo'; if (isset($picture['x'])) { $query = "UPDATE {$stereoTable}\n\t\t\t\tSET x={$offsetX}, y={$offsetY}\n\t\t\t\tWHERE media_id = {$id};"; } else { $picture['x'] = $offsetX; $picture['y'] = $offsetY; $query = "INSERT INTO {$stereoTable} (media_id, x, y)\n\t\t\t\tVALUES ({$id}, {$offsetX}, {$offsetY})"; } pwg_query($query); array_push($page['infos'], l10n('STEREO_EDIT_SUCCESS')); } } // needed for the photo tabsheet $admin_photo_base_url = get_root_url() . 'admin.php?page=photo-' . $id; $self_url = Stereo_get_admin_url($id); include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('photo'); $tabsheet->select('stereo'); $tabsheet->assign(); $template->assign(array('PWG_TOKEN' => get_pwg_token(), 'F_ACTION' => $self_url, 'TITLE' => render_element_name($picture), 'PICTURE' => Stereo_render_element_content('', $picture), 'OFFSET_X' => empty($picture['x']) ? 0 : $picture['x'], 'OFFSET_Y' => empty($picture['y']) ? 0 : $picture['y'])); $template->set_filename('plugin_admin_content', STEREO_PATH . 'admin.tpl'); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
// | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ /** * Add users and manage users list */ // +-----------------------------------------------------------------------+ // | tabs | // +-----------------------------------------------------------------------+ include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $my_base_url = get_root_url() . 'admin.php?page='; $tabsheet = new tabsheet(); $tabsheet->set_id('users'); $tabsheet->select('user_list'); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | groups list | // +-----------------------------------------------------------------------+ $groups = array(); $query = ' SELECT id, name FROM ' . GROUPS_TABLE . ' ORDER BY name ASC ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { $groups[$row['id']] = $row['name']; } // +-----------------------------------------------------------------------+
// | General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ include_once PHPWG_ROOT_PATH . 'admin/include/functions.php'; include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; // +-----------------------------------------------------------------------+ // | Check Access and exit when user status is not ok | // +-----------------------------------------------------------------------+ check_status(ACCESS_ADMINISTRATOR); $help_link = get_root_url() . 'admin.php?page=help§ion='; $selected = null; if (!isset($_GET['section'])) { $selected = 'add_photos'; } else { $selected = $_GET['section']; } $tabsheet = new tabsheet(); $tabsheet->set_id('help'); $tabsheet->select($selected); $tabsheet->assign(); trigger_notify('loc_end_help'); $template->set_filenames(array('help' => 'help.tpl')); $template->assign(array('HELP_CONTENT' => load_language('help/help_' . $tabsheet->selected . '.html', '', array('return' => true)), 'HELP_SECTION_TITLE' => $tabsheet->sheets[$tabsheet->selected]['caption'])); // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'help');
// | | // | This program is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ defined('PHPWG_ROOT_PATH') or die("Hacking attempt!"); include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('rating'); $tabsheet->select('rating_user'); $tabsheet->assign(); $filter_min_rates = 2; if (isset($_GET['f_min_rates'])) { $filter_min_rates = (int) $_GET['f_min_rates']; } $consensus_top_number = $conf['top_number']; if (isset($_GET['consensus_top_number'])) { $consensus_top_number = (int) $_GET['consensus_top_number']; } // build users global $conf; $query = 'SELECT DISTINCT u.' . $conf['user_fields']['id'] . ' AS id, u.' . $conf['user_fields']['username'] . ' AS name, ui.status
<?php defined('URLUPLOADER_PATH') or die('Hacking attempt!'); global $template, $page, $conf; load_language('plugin.lang', URLUPLOADER_PATH); // +-----------------------------------------------------------------------+ // | URL Uploader tab | // +-----------------------------------------------------------------------+ define('PHOTOS_ADD_BASE_URL', get_root_url() . 'admin.php?page=photos_add'); include_once PHPWG_ROOT_PATH . 'admin/include/functions.php'; include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; include_once PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('photos_add'); $tabsheet->select('url_uploader'); $tabsheet->assign(); $page['active_menu'] = get_active_menu('photo'); // +-----------------------------------------------------------------------+ // | prepare form | // +-----------------------------------------------------------------------+ include PHPWG_ROOT_PATH . 'admin/include/photos_add_direct_prepare.inc.php'; $template->set_filename('urluploader_content', realpath(URLUPLOADER_PATH . 'template/photos_add.tpl')); // template vars $template->assign(array('URLUPLOADER_PATH' => get_root_url() . URLUPLOADER_PATH, 'URLUPLOADER_ADMIN' => URLUPLOADER_ADMIN)); // send page content $template->assign_var_from_handle('ADMIN_CONTENT', 'urluploader_content');
} } } // +-----------------------------------------------------------------------+ // | template init | // +-----------------------------------------------------------------------+ $template->set_filenames(array('comments' => 'comments.tpl')); $template->assign(array('F_ACTION' => get_root_url() . 'admin.php?page=comments')); // +-----------------------------------------------------------------------+ // | Tabs | // +-----------------------------------------------------------------------+ include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $my_base_url = get_root_url() . 'admin.php?page='; $tabsheet = new tabsheet(); $tabsheet->set_id('comments'); $tabsheet->select(''); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | comments display | // +-----------------------------------------------------------------------+ $nb_total = 0; $nb_pending = 0; $query = ' SELECT COUNT(*) AS counter, validated FROM ' . COMMENTS_TABLE . ' GROUP BY validated ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) {
case 'send': if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content'])) { $check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content'])); do_timeout_treatment('send_selection', $check_key_treated); } } // +-----------------------------------------------------------------------+ // | template initialization | // +-----------------------------------------------------------------------+ $template->set_filenames(array('double_select' => 'double_select.tpl', 'notification_by_mail' => 'notification_by_mail.tpl')); $template->assign(array('U_HELP' => get_root_url() . 'admin/popuphelp.php?page=notification_by_mail', 'F_ACTION' => $base_url . get_query_string_diff(array()))); if (is_autorize_status(ACCESS_WEBMASTER)) { // TabSheet $tabsheet = new tabsheet(); $tabsheet->set_id('nbm'); $tabsheet->select($page['mode']); $tabsheet->assign(); } if ($must_repost) { // Get name of submit button $repost_submit_name = ''; if (isset($_POST['falsify'])) { $repost_submit_name = 'falsify'; } elseif (isset($_POST['trueify'])) { $repost_submit_name = 'trueify'; } elseif (isset($_POST['send_submit'])) { $repost_submit_name = 'send_submit'; } $template->assign('REPOST_SUBMIT_NAME', $repost_submit_name); } switch ($page['mode']) {
check_status(ACCESS_ADMINISTRATOR); if (!isset($_GET['image_id']) or !isset($_GET['section'])) { die('Invalid data!'); } check_input_parameter('image_id', $_GET, false, PATTERN_ID); $admin_photo_base_url = get_root_url() . 'admin.php?page=photo-' . $_GET['image_id']; $self_url = get_root_url() . 'admin.php?page=plugin&section=piwigo-videojs/admin/admin_photo.php&image_id=' . $_GET['image_id']; $sync_url = get_root_url() . 'admin.php?page=plugin&section=piwigo-videojs/admin/admin_photo.php&sync_metadata=1&image_id=' . $_GET['image_id']; $delete_url = get_root_url() . 'admin.php?page=plugin&section=piwigo-videojs/admin/admin_photo.php&delete_extra=1&image_id=' . $_GET['image_id'] . '&pwg_token=' . get_pwg_token(); load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); load_language('plugin.lang', VIDEOJS_PATH); global $template, $page, $conf; include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('photo'); $tabsheet->select('videojs'); $tabsheet->assign(); $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin_photo.tpl')); // Generate default value $sync_options = array('mediainfo' => 'mediainfo', 'ffmpeg' => 'ffmpeg', 'metadata' => true, 'poster' => true, 'postersec' => 4, 'output' => 'jpg', 'posteroverlay' => false, 'posteroverwrite' => true, 'thumb' => false, 'thumbsec' => 5, 'thumbsize' => "120x68", 'simulate' => true, 'cat_id' => 0, 'subcats_included' => true); // Override default value from configuration if (isset($conf['vjs_sync'])) { $sync_options = unserialize($conf['vjs_sync']); } // Do the Check dependencies, MediaInfo & FFMPEG, share with batch manager & photo edit & admin sync require_once dirname(__FILE__) . '/../include/function_dependencies.php'; $query = "SELECT * FROM " . IMAGES_TABLE . " WHERE " . SQL_VIDEOS . " AND id = " . $_GET['image_id'] . ";"; $picture = pwg_db_fetch_assoc(pwg_query($query)); //if (!$sync_options['metadata'] or !isset($picture['path'])) { if (!isset($picture['path'])) { //print_r($sync_options);
$update_query = 'latitude=NULL, longitude=NULL'; } else { $page['errors'][] = 'Both latitude/longitude must be empty or not empty'; } if (isset($update_query)) { $update_query = 'UPDATE ' . IMAGES_TABLE . ' SET ' . $update_query . ' WHERE id = ' . $_GET['image_id'] . ';'; pwg_query($update_query); } if (count($page['errors']) == 0) { array_push($page['infos'], l10n('The photo was updated')); } } include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('photo'); $tabsheet->select('openstreetmap'); $tabsheet->assign(); $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin_photo.tpl')); include_once dirname(__FILE__) . '/../include/functions_map.php'; // Retrieving direct information about picture $query = "SELECT *,\nIF(i.representative_ext IS NULL,\n CONCAT(SUBSTRING_INDEX(TRIM(LEADING '.' FROM i.path), '.', 1 ), '-sq.', SUBSTRING_INDEX(TRIM(LEADING '.' FROM i.path), '.', -1 )),\n TRIM(LEADING '.' FROM\n REPLACE(i.path, TRIM(TRAILING '.' FROM SUBSTRING_INDEX(i.path, '/', -1 )),\n CONCAT('pwg_representative/',\n CONCAT(\n TRIM(TRAILING '.' FROM SUBSTRING_INDEX( SUBSTRING_INDEX(i.path, '/', -1 ) , '.', 1 )),\n CONCAT('-sq.', i.representative_ext)\n )\n )\n )\n )\n ) AS `pathurl` FROM " . IMAGES_TABLE . " AS i WHERE id = " . $_GET['image_id'] . ";"; $picture = pwg_db_fetch_assoc(pwg_query($query)); $lat = isset($picture['latitude']) ? $picture['latitude'] : 0; $lon = isset($picture['longitude']) ? $picture['longitude'] : 0; // Load parameter, fallback to default if unset $zoom = isset($conf['osm_conf']['right_panel']['zoom']) ? $conf['osm_conf']['right_panel']['zoom'] : '18'; $baselayer = isset($conf['osm_conf']['map']['baselayer']) ? $conf['osm_conf']['map']['baselayer'] : 'mapnik'; $custombaselayer = isset($conf['osm_conf']['map']['custombaselayer']) ? $conf['osm_conf']['map']['custombaselayer'] : ''; $custombaselayerurl = isset($conf['osm_conf']['map']['custombaselayerurl']) ? $conf['osm_conf']['map']['custombaselayerurl'] : ''; $noworldwarp = isset($conf['osm_conf']['map']['noworldwarp']) ? $conf['osm_conf']['map']['noworldwarp'] : 'false'; $attrleaflet = isset($conf['osm_conf']['map']['attrleaflet']) ? $conf['osm_conf']['map']['attrleaflet'] : 'false';
// | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ if (!defined('PHPWG_ROOT_PATH')) { die("Hacking attempt!"); } include_once PHPWG_ROOT_PATH . 'admin/include/functions.php'; // +-----------------------------------------------------------------------+ // | Check Access and exit when user status is not ok | // +-----------------------------------------------------------------------+ check_status(ACCESS_ADMINISTRATOR); include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'; $tabsheet = new tabsheet(); $tabsheet->set_id('rating'); $tabsheet->select('rating'); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | initialization | // +-----------------------------------------------------------------------+ if (isset($_GET['start']) and is_numeric($_GET['start'])) { $start = $_GET['start']; } else { $start = 0; } $elements_per_page = 10; if (isset($_GET['display']) and is_numeric($_GET['display'])) { $elements_per_page = $_GET['display']; } $order_by_index = 0; if (isset($_GET['order_by']) and is_numeric($_GET['order_by'])) {
/* Update the database - No action done on the video */ $rotation_code = pwg_image::get_rotation_code_from_angle($_POST['angle']); $query = "UPDATE " . IMAGES_TABLE . " SET rotation='" . $rotation_code . "', `date_metadata_update`=CURDATE() WHERE `id`=" . $_GET['image_id'] . ";"; pwg_query($query); /* Retrieve direct information about picture */ $query = "SELECT id,path,representative_ext FROM " . IMAGES_TABLE . " WHERE " . SQL_VIDEOS . " AND id = " . $_GET['image_id'] . ";"; $row = pwg_db_fetch_assoc(pwg_query($query)); /* Delete previous derivatives */ delete_element_derivatives($row); array_push($page['infos'], l10n('The photo was updated')); } // +-----------------------------------------------------------------------+ // | Tabs | // +-----------------------------------------------------------------------+ $tabsheet = new tabsheet(); $tabsheet->set_id('photo'); $tabsheet->select('rotate'); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | template init | // +-----------------------------------------------------------------------+ $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin_rotate.tpl')); // Retrieve direct information about picture $query = "SELECT * FROM " . IMAGES_TABLE . " WHERE " . SQL_VIDEOS . " AND id = " . $_GET['image_id'] . ";"; $row = pwg_db_fetch_assoc(pwg_query($query)); $angles = array(array('value' => 270, 'name' => l10n('90° right')), array('value' => 90, 'name' => l10n('90° left')), array('value' => 180, 'name' => l10n('180°'))); $template->assign(array('F_ACTION' => $self_url, 'TN_SRC' => DerivativeImage::thumb_url($row), 'TITLE' => render_element_name($row), 'angles' => $angles, 'angle_selected' => pwg_image::get_rotation_angle_from_code($row['rotation']), 'library' => pwg_image::get_library(), 'PWG_TOKEN' => get_pwg_token())); // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');