Exemplo n.º 1
0
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'edit_interface.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$action = WT_Filter::post('action', null, WT_Filter::get('action'));
$controller = new WT_Controller_Simple();
$controller->restrictAccess(Auth::isEditor())->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->addInlineJavascript('
	var locale_date_format="' . preg_replace('/[^DMY]/', '', str_replace(array('J', 'F'), array('D', 'M'), strtoupper($DATE_FORMAT))) . '";
');
switch ($action) {
    ////////////////////////////////////////////////////////////////////////////////
    case 'editraw':
        $xref = WT_Filter::get('xref', WT_REGEX_XREF);
        $record = WT_GedcomRecord::getInstance($xref);
        check_record_access($record);
        $controller->setPageTitle($record->getFullName() . ' - ' . WT_I18N::translate('Edit raw GEDCOM'))->pageHeader()->addInlineJavascript('jQuery("#raw-gedcom-list").sortable({opacity: 0.7, cursor: "move", axis: "y"});');
        ?>
	<div id="edit_interface-page">
		<h4>
			<?php 
        echo $controller->getPageTitle();
        ?>
Exemplo n.º 2
0
foreach (WT_Tree::getAll() as $tree) {
    $WT_TREE = $tree;
    if ($WT_TREE->tree_name == $GEDCOM && ($WT_TREE->imported || Auth::isAdmin())) {
        break;
    }
}
// These attributes of the currently-selected tree are used frequently
if ($WT_TREE) {
    define('WT_GEDCOM', $WT_TREE->tree_name);
    define('WT_GED_ID', $WT_TREE->tree_id);
    define('WT_GEDURL', $WT_TREE->tree_name_url);
    define('WT_TREE_TITLE', $WT_TREE->tree_title_html);
    define('WT_IMPORTED', $WT_TREE->imported);
    define('WT_USER_GEDCOM_ADMIN', Auth::isManager($WT_TREE));
    define('WT_USER_CAN_ACCEPT', Auth::isModerator($WT_TREE));
    define('WT_USER_CAN_EDIT', Auth::isEditor($WT_TREE));
    define('WT_USER_CAN_ACCESS', Auth::isMember($WT_TREE));
    define('WT_USER_GEDCOM_ID', $WT_TREE->userPreference(WT_USER_ID, 'gedcomid'));
    define('WT_USER_ROOT_ID', $WT_TREE->userPreference(WT_USER_ID, 'rootid') ? $WT_TREE->userPreference(WT_USER_ID, 'rootid') : WT_USER_GEDCOM_ID);
    define('WT_USER_PATH_LENGTH', $WT_TREE->userPreference(WT_USER_ID, 'RELATIONSHIP_PATH_LENGTH'));
    if (WT_USER_GEDCOM_ADMIN) {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_NONE);
    } elseif (WT_USER_CAN_ACCESS) {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_USER);
    } else {
        define('WT_USER_ACCESS_LEVEL', WT_PRIV_PUBLIC);
    }
    load_gedcom_settings(WT_GED_ID);
} else {
    define('WT_GEDCOM', '');
    define('WT_GED_ID', null);
Exemplo n.º 3
0
// (at your option) any later version.
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'inverselink.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Simple();
$controller->restrictAccess(Auth::isEditor())->setPageTitle(WT_I18N::translate('Link to an existing media object'))->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->pageHeader();
//-- page parameters and checking
$linktoid = WT_Filter::get('linktoid', WT_REGEX_XREF);
$mediaid = WT_Filter::get('mediaid', WT_REGEX_XREF);
$linkto = WT_Filter::get('linkto', 'person|source|family|manage|repository|note');
$action = WT_Filter::get('action', 'choose|update', 'choose');
// If GedFAct_assistant/_MEDIA/ installed ======================
if ($linkto == 'manage' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
    require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/_MEDIA/media_0_inverselink.php';
} else {
    //-- check for admin
    $paramok = true;
    if (!empty($linktoid)) {
        $paramok = WT_GedcomRecord::getInstance($linktoid)->canShow();
    }
    if ($action == "choose" && $paramok) {