Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $PEDIGREE_FULL_DETAILS = get_gedcom_setting(WT_GED_ID, 'PEDIGREE_FULL_DETAILS');
     $MAX_DESCENDANCY_GENERATIONS = get_gedcom_setting(WT_GED_ID, 'MAX_DESCENDANCY_GENERATIONS');
     // Extract the request parameters
     $this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
     $this->show_spouse = WT_Filter::getInteger('show_spouse', 0, 1);
     $this->descent = WT_Filter::getInteger('descent', 0, 9, 5);
     $this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 2);
     $this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
     // Box sizes are set globally in the theme.  Modify them here.
     global $bwidth, $bheight, $cbwidth, $cbheight, $Dbwidth, $bhalfheight, $Dbheight;
     $Dbwidth = $this->box_width * $bwidth / 100;
     //$Dbheight=$this->box_width * $bheight / 100;
     $bwidth = $Dbwidth;
     $bheight = $Dbheight;
     // -- adjust size of the compact box
     if (!$this->show_full) {
         $bwidth = $this->box_width * $cbwidth / 100;
         $bheight = $cbheight;
     }
     $bhalfheight = $bheight / 2;
     if ($this->root && $this->root->canShowName()) {
         $this->setPageTitle(WT_I18N::translate('Family book of %s', $this->root->getFullName()));
     } else {
         $this->setPageTitle(WT_I18N::translate('Family book'));
     }
     //Checks how many generations of descendency is for the person for formatting purposes
     $this->dgenerations = $this->max_descendency_generations($this->pid, 0);
     if ($this->dgenerations < 1) {
         $this->dgenerations = 1;
     }
 }
Ejemplo n.º 2
0
 public function getBlock($block_id, $template = true, $cfg = null)
 {
     global $ctype;
     switch (WT_Filter::get('action')) {
         case 'deletenews':
             $news_id = WT_Filter::getInteger('news_id');
             if ($news_id) {
                 deleteNews($news_id);
             }
             break;
     }
     $block = get_block_setting($block_id, 'block', true);
     if ($cfg) {
         foreach (array('block') as $name) {
             if (array_key_exists($name, $cfg)) {
                 ${$name} = $cfg[$name];
             }
         }
     }
     $usernews = getUserNews(WT_USER_ID);
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = '';
     $title .= $this->getTitle();
     $content = '';
     if (count($usernews) == 0) {
         $content .= WT_I18N::translate('You have not created any journal items.');
     }
     foreach ($usernews as $key => $news) {
         $day = date('j', $news['date']);
         $mon = date('M', $news['date']);
         $year = date('Y', $news['date']);
         $content .= "<div class=\"journal_box\">";
         $content .= "<div class=\"news_title\">" . $news['title'] . '</div>';
         $content .= "<div class=\"news_date\">" . format_timestamp($news['date']) . '</div>';
         if ($news["text"] == strip_tags($news["text"])) {
             // No HTML?
             $news["text"] = nl2br($news["text"], false);
         }
         $content .= $news["text"] . "<br><br>";
         $content .= "<a href=\"#\" onclick=\"window.open('editnews.php?news_id='+" . $key . ", '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Edit') . "</a> | ";
         $content .= "<a href=\"index.php?action=deletenews&amp;news_id={$key}&amp;ctype={$ctype}\" onclick=\"return confirm('" . WT_I18N::translate('Are you sure you want to delete this journal entry?') . "');\">" . WT_I18N::translate('Delete') . "</a><br>";
         $content .= "</div><br>";
     }
     if (WT_USER_ID) {
         $content .= "<br><a href=\"#\" onclick=\"window.open('editnews.php?user_id='+WT_USER_ID, '_blank', indx_window_specs); return false;\">" . WT_I18N::translate('Add a new journal entry') . "</a>";
     }
     if ($template) {
         if ($block) {
             require WT_THEME_DIR . 'templates/block_small_temp.php';
         } else {
             require WT_THEME_DIR . 'templates/block_main_temp.php';
         }
     } else {
         return $content;
     }
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     global $Dbwidth, $bwidth, $pbwidth, $pbheight, $bheight;
     $bwidth = $Dbwidth;
     $pbwidth = $bwidth + 12;
     $pbheight = $bheight + 14;
     $xref = WT_Filter::get('famid', WT_REGEX_XREF);
     $this->record = WT_Family::getInstance($xref);
     parent::__construct();
 }
Ejemplo n.º 4
0
 public static function send(WT_Tree $tree, $to_email, $to_name, $replyto_email, $replyto_name, $subject, $message)
 {
     try {
         $mail = new Zend_Mail('UTF-8');
         $mail->setSubject($subject)->setBodyHtml($message)->setBodyText(WT_Filter::unescapeHtml($message))->setFrom(WT_Site::getPreference('SMTP_FROM_NAME'), $tree->preference('title'))->addTo($to_email, $to_name)->setReplyTo($replyto_email, $replyto_name)->send(WT_Mail::transport());
     } catch (Exception $ex) {
         Log::addErrorLog('Mail: ' . $ex->getMessage());
         return false;
     }
     return true;
 }
Ejemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
     // Extract the request parameters
     $this->show_thumbs = WT_Filter::getBool('show_thumbs');
     if ($this->root && $this->root->canShowName()) {
         $this->setPageTitle(WT_I18N::translate('Compact tree of %s', $this->root->getFullName()));
     } else {
         $this->setPageTitle(WT_I18N::translate('Compact tree'));
     }
     $this->treeid = ancestry_array($this->rootid, 5);
 }
Ejemplo n.º 6
0
 /**
  * Create a name for this note - apply (and remove) markup, then take
  * a maximum of 100 characters from the first line.
  */
 public function extractNames()
 {
     global $WT_TREE;
     $text = $this->getNote();
     switch ($WT_TREE->preference('FORMAT_TEXT')) {
         case 'markdown':
             $text = WT_Filter::markdown($text);
             $text = strip_tags($text);
             break;
     }
     list($text) = explode("\n", $text);
     $this->_addName('NOTE', strlen($text) > 100 ? mb_substr($text, 0, 100) . WT_I18N::translate('…') : $text, $this->getGedcom());
 }
Ejemplo n.º 7
0
 /**
  * Generate a filtered, sourced, privacy-checked list of media objects - for the media list.
  *
  * @param string $folder     folder to search
  * @param string $subfolders either "include" or "exclude"
  * @param string $sort       either "file" or "title"
  * @param string $filter     optional search string
  *
  * @return WT_Media[]
  * @throws Exception
  */
 public static function mediaList($folder, $subfolders, $sort, $filter)
 {
     // All files in the folder, plus external files
     $sql = "SELECT m_id AS xref, m_file AS gedcom_id, m_gedcom AS gedcom" . " FROM `##media`" . " WHERE m_file=?";
     $args = array(WT_GED_ID);
     // Only show external files when we are looking at the root folder
     if ($folder == '') {
         $sql_external = " OR m_filename LIKE 'http://%' OR m_filename LIKE 'https://%'";
     } else {
         $sql_external = "";
     }
     // Include / exclude subfolders (but always include external)
     switch ($subfolders) {
         case 'include':
             $sql .= " AND (m_filename LIKE CONCAT(?, '%') {$sql_external})";
             $args[] = WT_Filter::escapeLike($folder);
             break;
         case 'exclude':
             $sql .= " AND (m_filename LIKE CONCAT(?, '%')  AND m_filename NOT LIKE CONCAT(?, '%/%') {$sql_external})";
             $args[] = WT_Filter::escapeLike($folder);
             $args[] = WT_Filter::escapeLike($folder);
             break;
         default:
             throw new Exception('Bad argument (subfolders=' . $subfolders . ') in WT_Query_Media::mediaList()');
     }
     // Apply search terms
     if ($filter) {
         $sql .= " AND (SUBSTRING_INDEX(m_filename, '/', -1) LIKE CONCAT('%', ?, '%') OR m_titl LIKE CONCAT('%', ?, '%'))";
         $args[] = WT_Filter::escapeLike($filter);
         $args[] = WT_Filter::escapeLike($filter);
     }
     switch ($sort) {
         case 'file':
             $sql .= " ORDER BY m_filename";
             break;
         case 'title':
             $sql .= " ORDER BY m_titl";
             break;
         default:
             throw new Exception('Bad argument (sort=' . $sort . ') in WT_Query_Media::mediaList()');
     }
     $rows = WT_DB::prepare($sql)->execute($args)->fetchAll();
     $list = array();
     foreach ($rows as $row) {
         $media = WT_Media::getInstance($row->xref, $row->gedcom_id, $row->gedcom);
         if ($media->canShow()) {
             $list[] = $media;
         }
     }
     return $list;
 }
Ejemplo n.º 8
0
 private function __construct($tree_id, $tree_name, $tree_title, $imported)
 {
     if (strpos($tree_title, '%') === false) {
         // Allow users to translate tree titles.
         //$tree_title=WT_I18N::Translate($tree_title);
     }
     $this->tree_id = $tree_id;
     $this->tree_name = $tree_name;
     $this->tree_name_url = rawurlencode($tree_name);
     $this->tree_name_html = WT_Filter::escapeHtml($tree_name);
     $this->tree_title = $tree_title;
     $this->tree_title_html = '<span dir="auto">' . WT_Filter::escapeHtml($tree_title) . '</span>';
     $this->imported = $imported;
 }
Ejemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
     $default_generations = get_gedcom_setting(WT_GED_ID, 'DEFAULT_PEDIGREE_GENERATIONS');
     // Extract the request parameters
     $this->fan_style = WT_Filter::getInteger('fan_style', 2, 4, 3);
     $this->fan_width = WT_Filter::getInteger('fan_width', 50, 300, 100);
     $this->generations = WT_Filter::getInteger('generations', 2, 9, $default_generations);
     if ($this->root && $this->root->canShowName()) {
         $this->setPageTitle(WT_I18N::translate('Fan chart of %s', $this->root->getFullName()));
     } else {
         $this->setPageTitle(WT_I18N::translate('Fan chart'));
     }
 }
Ejemplo n.º 10
0
 public function modAction($modAction)
 {
     global $controller;
     switch ($modAction) {
         case 'menu-add-favorite':
             // Process the "add to user favorites" menu item on indi/fam/etc. pages
             $record = WT_GedcomRecord::getInstance(WT_Filter::post('xref', WT_REGEX_XREF));
             if (WT_USER_ID && $record->canShowName()) {
                 self::addFavorite(array('user_id' => WT_USER_ID, 'gedcom_id' => $record->getGedcomId(), 'gid' => $record->getXref(), 'type' => $record::RECORD_TYPE, 'url' => null, 'note' => null, 'title' => null));
                 WT_FlashMessages::addMessage(WT_I18N::translate('“%s” has been added to your favorites.', $record->getFullName()));
             }
             break;
     }
 }
Ejemplo n.º 11
0
 function __construct($rootid = '', $show_full = 1)
 {
     global $bheight, $bwidth, $cbwidth, $cbheight, $bhalfheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS;
     global $TEXT_DIRECTION, $show_full;
     parent::__construct();
     // Extract parameters from from
     $this->pid = WT_Filter::get('rootid', WT_REGEX_XREF);
     $this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
     $this->show_spouse = WT_Filter::getInteger('show_spouse', 0, 1, 0);
     $this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, 3);
     $this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
     // This is passed as a global.  A parameter would be better...
     $show_full = $this->show_full;
     if (!empty($rootid)) {
         $this->pid = $rootid;
     }
     //-- flip the arrows for RTL languages
     if ($TEXT_DIRECTION == 'ltr') {
         $this->left_arrow = 'icon-larrow';
         $this->right_arrow = 'icon-rarrow';
     } else {
         $this->left_arrow = 'icon-larrow';
         $this->right_arrow = 'icon-larrow';
     }
     // -- size of the detailed boxes based upon optional width parameter
     $Dbwidth = $this->box_width * $bwidth / 100;
     $Dbheight = $this->box_width * $bheight / 100;
     $bwidth = $Dbwidth;
     $bheight = $Dbheight;
     // -- adjust size of the compact box
     if (!$this->show_full) {
         $bwidth = $this->box_width * $cbwidth / 100;
         $bheight = $cbheight;
     }
     $bhalfheight = (int) ($bheight / 2);
     // Validate parameters
     $this->hourPerson = WT_Individual::getInstance($this->pid);
     if (!$this->hourPerson) {
         $this->hourPerson = $this->getSignificantIndividual();
         $this->pid = $this->hourPerson->getXref();
     }
     $this->name = $this->hourPerson->getFullName();
     //Checks how many generations of descendency is for the person for formatting purposes
     $this->dgenerations = $this->max_descendency_generations($this->pid, 0);
     if ($this->dgenerations < 1) {
         $this->dgenerations = 1;
     }
     $this->setPageTitle(WT_I18N::translate('Hourglass chart of %s', $this->name));
 }
Ejemplo n.º 12
0
 public function __construct()
 {
     parent::__construct();
     $this->rootid = WT_Filter::get('rootid', WT_REGEX_XREF);
     if ($this->rootid) {
         $this->root = WT_Individual::getInstance($this->rootid);
     } else {
         // Missing rootid parameter?  Do something.
         $this->root = $this->getSignificantIndividual();
         $this->rootid = $this->root->getXref();
     }
     if (!$this->root || !$this->root->canShowName()) {
         header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
         $this->error_message = WT_I18N::translate('This individual does not exist or you do not have permission to view it.');
         $this->rootid = null;
     }
 }
Ejemplo n.º 13
0
 public function __construct()
 {
     parent::__construct();
     $this->surname = WT_Filter::get('surname');
     $this->soundex_std = WT_Filter::getBool('soundex_std');
     $this->soundex_dm = WT_Filter::getBool('soundex_dm');
     if ($this->surname) {
         $this->setPageTitle(WT_I18N::translate('Branches of the %s family', WT_Filter::escapeHtml($this->surname)));
         $this->loadIndividuals();
         $self = WT_Individual::getInstance(WT_USER_GEDCOM_ID);
         if ($self) {
             $this->loadAncestors(WT_Individual::getInstance(WT_USER_GEDCOM_ID), 1);
         }
     } else {
         $this->setPageTitle(WT_I18N::translate('Branches'));
     }
 }
Ejemplo n.º 14
0
 public function getSidebarAjaxContent()
 {
     $alpha = WT_Filter::get('alpha');
     // All surnames beginning with this letter where "@"=unknown and ","=none
     $surname = WT_Filter::get('surname');
     // All indis with this surname.
     $search = WT_Filter::get('search');
     if ($search) {
         return $this->search($search);
     } elseif ($alpha == '@' || $alpha == ',' || $surname) {
         return $this->getSurnameIndis($alpha, $surname);
     } elseif ($alpha) {
         return $this->getAlphaSurnames($alpha, $surname);
     } else {
         return '';
     }
 }
Ejemplo n.º 15
0
 public function modAction($modAction)
 {
     Zend_Session::writeClose();
     header('Content-Type: text/html; charset=UTF-8');
     switch ($modAction) {
         case 'search':
             $search = WT_Filter::get('search');
             echo $this->search($search);
             break;
         case 'descendants':
             $individual = WT_Individual::getInstance(WT_Filter::get('xref', WT_REGEX_XREF));
             if ($individual) {
                 echo $this->loadSpouses($individual, 1);
             }
             break;
         default:
             header('HTTP/1.0 404 Not Found');
             break;
     }
     exit;
 }
Ejemplo n.º 16
0
 function __construct()
 {
     global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS, $show_full;
     parent::__construct();
     // Extract parameters from form
     $this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
     $this->chart_style = WT_Filter::getInteger('chart_style', 0, 3, 0);
     $this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
     $this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
     // This is passed as a global.  A parameter would be better...
     $show_full = $this->show_full;
     if (!isset($this->personcount)) {
         $this->personcount = 1;
     }
     // -- size of the detailed boxes based upon optional width parameter
     $Dbwidth = $this->box_width * $bwidth / 100;
     $Dbheight = $this->box_width * $bheight / 100;
     $bwidth = $Dbwidth;
     $bheight = $Dbheight;
     // -- adjust size of the compact box
     if (!$this->show_full) {
         $bwidth = $cbwidth;
         $bheight = $cbheight;
     }
     $pbwidth = $bwidth + 12;
     $pbheight = $bheight + 14;
     // Validate form variables
     if (strlen($this->name) < 30) {
         $this->cellwidth = 420;
     } else {
         $this->cellwidth = strlen($this->name) * 14;
     }
     if ($this->root && $this->root->canShowName()) {
         $this->setPageTitle(WT_I18N::translate('Descendants of %s', $this->root->getFullName()));
     } else {
         $this->setPageTitle(WT_I18N::translate('Descendants'));
     }
 }
Ejemplo n.º 17
0
 function __construct()
 {
     global $bwidth, $bheight, $cbwidth, $cbheight, $pbwidth, $pbheight, $PEDIGREE_FULL_DETAILS;
     global $DEFAULT_PEDIGREE_GENERATIONS, $PEDIGREE_GENERATIONS, $MAX_PEDIGREE_GENERATIONS, $OLD_PGENS, $box_width, $Dbwidth, $Dbheight;
     global $show_full;
     parent::__construct();
     // Extract form parameters
     $this->show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS);
     $this->show_cousins = WT_Filter::getInteger('show_cousins', 0, 1);
     $this->chart_style = WT_Filter::getInteger('chart_style', 0, 3);
     $box_width = WT_Filter::getInteger('box_width', 50, 300, 100);
     $PEDIGREE_GENERATIONS = WT_Filter::getInteger('PEDIGREE_GENERATIONS', 2, $MAX_PEDIGREE_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS);
     // This is passed as a global.  A parameter would be better...
     $show_full = $this->show_full;
     $OLD_PGENS = $PEDIGREE_GENERATIONS;
     // -- size of the detailed boxes based upon optional width parameter
     $Dbwidth = $box_width * $bwidth / 100;
     $Dbheight = $box_width * $bheight / 100;
     $bwidth = $Dbwidth;
     $bheight = $Dbheight;
     // -- adjust size of the compact box
     if (!$this->show_full) {
         $bwidth = $cbwidth;
         $bheight = $cbheight;
     }
     $pbwidth = $bwidth + 12;
     $pbheight = $bheight + 14;
     if ($this->root && $this->root->canShowName()) {
         $this->setPageTitle(WT_I18N::translate('Ancestors of %s', $this->root->getFullName()));
     } else {
         $this->setPageTitle(WT_I18N::translate('Ancestors'));
     }
     if (strlen($this->name) < 30) {
         $this->cellwidth = "420";
     } else {
         $this->cellwidth = strlen($this->name) * 14;
     }
 }
Ejemplo n.º 18
0
			list3.selectedIndex = -1;
		}
		if (list_name=="available_select") {
			list1.selectedIndex = -1;
			list3.selectedIndex = -1;
		}
		if (list_name=="right_select") {
			list1.selectedIndex = -1;
			list2.selectedIndex = -1;
		}
	}
	var block_descr = new Array();
	');
// Load Block Description array for use by javascript
foreach ($all_blocks as $block_name => $block) {
    $controller->addInlineJavascript('block_descr["' . $block_name . '"] = "' . WT_Filter::escapeJs($block->getDescription()) . '";');
}
$controller->addInlineJavascript('block_descr["advice1"] = "' . WT_I18N::translate('Highlight a  block name and then click on one of the arrow icons to move that highlighted block in the indicated direction.') . '";');
?>
<form name="config_setup" method="post" action="index_edit.php?action=update" onsubmit="select_options(); return modalDialogSubmitAjax(this);" >
<input type="hidden" name="user_id"   value="<?php 
echo $user_id;
?>
">
<input type="hidden" name="gedcom_id" value="<?php 
echo $gedcom_id;
?>
">
<table border="1" id="change_blocks">
<?php 
// NOTE: Row 1: Column legends
Ejemplo n.º 19
0
    ?>
	<div id="header">
		<div class="header_img">
			<img src="<?php 
    echo WT_CSS_URL;
    ?>
images/webtrees.png" width="242" height="50" alt="<?php 
    echo WT_WEBTREES;
    ?>
">
		</div>
		<ul id="extra-menu" class="makeMenu">
			<li>
				<?php 
    if (WT_USER_ID) {
        echo '<a href="edituser.php">', WT_I18N::translate('Logged in as '), ' ', WT_Filter::escapeHtml(Auth::user()->getRealName()), '</a></li> <li>', logout_link();
    } else {
        echo login_link();
    }
    ?>
			</li>
			<?php 
    echo WT_MenuBar::getFavoritesMenu();
    ?>
			<?php 
    echo WT_MenuBar::getThemeMenu();
    ?>
			<?php 
    echo WT_MenuBar::getLanguageMenu();
    ?>
		</ul>
Ejemplo n.º 20
0
 public function displayImage()
 {
     if ($this->isExternal() || !file_exists($this->getServerFilename('thumb'))) {
         // Use an icon
         $mime_type = str_replace('/', '-', $this->mimeType());
         $image = '<i' . ' dir="' . 'auto' . '"' . ' class="' . 'icon-mime-' . $mime_type . '"' . ' title="' . strip_tags($this->getFullName()) . '"' . '></i>';
     } else {
         $imgsize = getimagesize($this->getServerFilename('thumb'));
         // Use a thumbnail image
         $image = '<img' . ' dir="' . 'auto' . '"' . ' src="' . $this->getHtmlUrlDirect('thumb') . '"' . ' alt="' . strip_tags($this->getFullName()) . '"' . ' title="' . strip_tags($this->getFullName()) . '"' . ' ' . $imgsize[3] . '>';
     }
     return '<a' . ' class="' . 'gallery' . '"' . ' href="' . $this->getHtmlUrlDirect('main') . '"' . ' type="' . $this->mimeType() . '"' . ' data-obje-url="' . $this->getHtmlUrl() . '"' . ' data-obje-note="' . WT_Filter::escapeHtml($this->getNote()) . '"' . ' data-title="' . WT_Filter::escapeHtml($this->getFullName()) . '"' . '>' . $image . '</a>';
 }
Ejemplo n.º 21
0
 public function __construct()
 {
     $xref = WT_Filter::get('rid', WT_REGEX_XREF);
     $this->record = WT_Repository::getInstance($xref);
     parent::__construct();
 }
Ejemplo n.º 22
0
    public function downloadForm($clip_ctrl)
    {
        global $GEDCOM_MEDIA_PATH;
        $pid = WT_Filter::get('pid', WT_REGEX_XREF);
        $out = '<script>';
        $out .= 'function cancelDownload() {
				var link = "module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=clippings&pid=' . $pid . '";
				jQuery("#sb_clippings_content").load(link);
			}';
        $out .= '</script>';
        $out .= '<form method="get" action="module.php">
		<input type="hidden" name="mod" value="clippings">
		<input type="hidden" name="mod_action" value="index">
		<input type="hidden" name="pid" value="' . $pid . '">
		<input type="hidden" name="action" value="download">
		<table>
		<tr><td colspan="2" class="topbottombar"><h2>' . WT_I18N::translate('Download') . '</h2></td></tr>
		<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Zip file(s)') . help_link('zip') . '</td>
		<td class="optionbox"><input type="checkbox" name="Zip" value="yes" checked="checked"></td></tr>

		<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Include media (automatically zips files)') . help_link('include_media') . '</td>
		<td class="optionbox"><input type="checkbox" name="IncludeMedia" value="yes" checked="checked"></td></tr>
		';
        if (WT_USER_GEDCOM_ADMIN) {
            $out .= '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . '<td class="optionbox">' . '	<input type="radio" name="privatize_export" value="none" checked="checked"> ' . WT_I18N::translate('None') . '<br>' . '	<input type="radio" name="privatize_export" value="gedadmin"> ' . WT_I18N::translate('Manager') . '<br>' . '	<input type="radio" name="privatize_export" value="user"> ' . WT_I18N::translate('Member') . '<br>' . '	<input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>';
        } elseif (WT_USER_CAN_ACCESS) {
            $out .= '<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Apply privacy settings?') . help_link('apply_privacy') . '</td>' . '<td class="list_value">' . '	<input type="radio" name="privatize_export" value="user" checked="checked"> ' . WT_I18N::translate('Member') . '<br>' . '	<input type="radio" name="privatize_export" value="visitor"> ' . WT_I18N::translate('Visitor') . '</td></tr>';
        }
        $out .= '
		<tr><td class="descriptionbox width50 wrap">' . WT_I18N::translate('Convert from UTF-8 to ANSI (ISO-8859-1)') . help_link('utf8_ansi') . '</td>
		<td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr>

		<tr>
		<td class="descriptionbox width50 wrap">' . WT_I18N::translate('Add the GEDCOM media path to filenames') . help_link('GEDCOM_MEDIA_PATH') . '</td>
		<td class="optionbox">
		<input type="checkbox" name="conv_path" value="' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '">
		<span dir="auto">' . WT_Filter::escapeHtml($GEDCOM_MEDIA_PATH) . '</span></td>
		</tr>

		<input type="hidden" name="conv_path" value="' . $clip_ctrl->conv_path . '">

		</td></tr>

		<tr><td class="topbottombar" colspan="2">
		<input type="button" value="' . WT_I18N::translate('Cancel') . '" onclick="cancelDownload();">
		<input type="submit" value="' . WT_I18N::translate('Download') . '">
		</form>';
        return $out;
    }
Ejemplo n.º 23
0
			jQuery("#fan_chart")
				.click(function(e) {
					jQuery(".fan_chart_menu").hide();
				});
			return "' . strip_tags($controller->root->getFullName()) . '";
		})();
	');
?>
<div id="page-fan">
	<h2><?php 
echo $controller->getPageTitle();
?>
</h2>
	<form name="people" method="get" action="?">
		<input type="hidden" name="ged" value="<?php 
echo WT_Filter::escapeHtml(WT_GEDCOM);
?>
">
		<table class="list_table">
			<tr>
				<td class="descriptionbox">
					<label for="rootid">
						<?php 
echo WT_I18N::translate('Individual');
?>
					</label>
				</td>
				<td class="optionbox">
					<input class="pedigree_form" data-autocomplete-type="INDI" type="text" name="rootid" id="rootid" size="3" value="<?php 
echo $controller->rootid;
?>
Ejemplo n.º 24
0
        }
        // Total filtered/unfiltered rows
        $recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchColumn();
        $recordsTotal = WT_DB::prepare($SELECT2 . $WHERE)->execute($args)->fetchColumn();
        header('Content-type: application/json');
        echo json_encode(array('sEcho' => WT_Filter::getInteger('sEcho'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
        exit;
}
$controller->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
		jQuery("#log_list").dataTable( {
			dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
			processing: true,
			serverSide: true,
			ajax: "' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?action=load_json&from=' . $from . '&to=' . $to . '&type=' . $type . '&text=' . rawurlencode($text) . '&ip=' . rawurlencode($ip) . '&user='******'&gedc=' . rawurlencode($gedc) . '",
			' . WT_I18N::datatablesI18N(array(10, 20, 50, 100, 500, 1000, -1)) . ',
			jQueryUI: true,
			autoWidth: false,
			sorting: [[ 0, "desc" ]],
			pageLength: ' . Auth::user()->getSetting('admin_site_log_page_size', 20) . ',
			pagingType: "full_numbers"
		});
	');
$url = WT_SCRIPT_NAME . '?from=' . rawurlencode($from) . '&amp;to=' . rawurlencode($to) . '&amp;type=' . rawurlencode($type) . '&amp;text=' . rawurlencode($text) . '&amp;ip=' . rawurlencode($ip) . '&amp;user='******'&amp;gedc=' . rawurlencode($gedc);
$users_array = array();
foreach (User::all() as $tmp_user) {
    $users_array[$tmp_user->getUserName()] = $tmp_user->getUserName();
}
echo '<form name="logs" method="get" action="' . WT_SCRIPT_NAME . '">', '<input type="hidden" name="action", value="show">', '<table class="site_logs">', '<tr>', '<td colspan="6">', WT_I18N::translate('From %s to %s', '<input class="log-date" name="from" value="' . WT_Filter::escapeHtml($from) . '">', '<input class="log-date" name="to" value="' . WT_Filter::escapeHtml($to) . '">'), '</td>', '</tr><tr>', '<td>', WT_I18N::translate('Type'), '<br>', select_edit_control('type', array('' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search'), null, $type, ''), '</td>', '<td>', WT_I18N::translate('Message'), '<br><input class="log-filter" name="text" value="', WT_Filter::escapeHtml($text), '"> ', '</td>', '<td>', WT_I18N::translate('IP address'), '<br><input class="log-filter" name="ip" value="', WT_Filter::escapeHtml($ip), '"> ', '</td>', '<td>', WT_I18N::translate('User'), '<br>', select_edit_control('user', $users_array, '', $user, ''), '</td>', '<td>', WT_I18N::translate('Family tree'), '<br>', select_edit_control('gedc', WT_Tree::getNameList(), '', $gedc, Auth::isAdmin() ? '' : 'disabled'), '</td>', '</tr><tr>', '<td colspan="6">', '<input type="submit" value="', WT_I18N::translate('Filter'), '">', '<input type="submit" value="', WT_I18N::translate('Export'), '" onclick="document.logs.action.value=\'export\';return true;" ', $action == 'show' ? '' : 'disabled="disabled"', '>', '<input type="submit" value="', WT_I18N::translate('Delete'), '" onclick="if (confirm(\'', WT_Filter::escapeHtml(WT_I18N::translate('Permanently delete these records?')), '\')) {document.logs.action.value=\'delete\';return true;} else {return false;}" ', $action == 'show' ? '' : 'disabled="disabled"', '>', '</td>', '</tr>', '</table>', '</form>';
if ($action) {
    echo '<br>', '<table id="log_list">', '<thead>', '<tr>', '<th>', WT_I18N::translate('Timestamp'), '</th>', '<th>', WT_I18N::translate('Type'), '</th>', '<th>', WT_I18N::translate('Message'), '</th>', '<th>', WT_I18N::translate('IP address'), '</th>', '<th>', WT_I18N::translate('User'), '</th>', '<th>', WT_I18N::translate('Family tree'), '</th>', '</tr>', '</thead>', '<tbody>', '</tbody>', '</table>';
}
Ejemplo n.º 25
0
    public function pageHeader()
    {
        // Import global variables into the local scope, for the theme’s header.php
        global $SEARCH_SPIDER, $TEXT_DIRECTION, $REQUIRE_AUTHENTICATION, $headerfile, $view;
        // The title often includes the names of records, which may have markup
        // that cannot be used in the page title.
        $title = html_entity_decode(strip_tags($this->page_title), ENT_QUOTES, 'UTF-8');
        // Initialise variables for the theme’s header.php
        $LINK_CANONICAL = $this->canonical_url;
        $META_ROBOTS = $this->meta_robots;
        $META_DESCRIPTION = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_DESCRIPTION') : '';
        if (!$META_DESCRIPTION) {
            $META_DESCRIPTION = strip_tags(WT_TREE_TITLE);
        }
        $META_GENERATOR = WT_WEBTREES . ' ' . WT_VERSION . ' - ' . WT_WEBTREES_URL;
        $META_TITLE = WT_GED_ID ? get_gedcom_setting(WT_GED_ID, 'META_TITLE') : '';
        if ($META_TITLE) {
            $title .= ' - ' . $META_TITLE;
        }
        // This javascript needs to be loaded in the header, *before* the CSS.
        // All other javascript should be defered until the end of the page
        $javascript = '<script src="' . WT_MODERNIZR_URL . '"></script>';
        // Give Javascript access to some PHP constants
        $this->addInlineJavascript('
			var WT_STATIC_URL  = "' . WT_Filter::escapeJs(WT_STATIC_URL) . '";
			var WT_THEME_DIR   = "' . WT_Filter::escapeJs(WT_THEME_DIR) . '";
			var WT_MODULES_DIR = "' . WT_Filter::escapeJs(WT_MODULES_DIR) . '";
			var WT_GEDCOM      = "' . WT_Filter::escapeJs(WT_GEDCOM) . '";
			var WT_GED_ID      = "' . WT_Filter::escapeJs(WT_GED_ID) . '";
			var WT_USER_ID     = "' . WT_Filter::escapeJs(WT_USER_ID) . '";
			var textDirection  = "' . WT_Filter::escapeJs($TEXT_DIRECTION) . '";
			var WT_SCRIPT_NAME = "' . WT_Filter::escapeJs(WT_SCRIPT_NAME) . '";
			var WT_LOCALE      = "' . WT_Filter::escapeJs(WT_LOCALE) . '";
			var WT_CSRF_TOKEN  = "' . WT_Filter::escapeJs(WT_Filter::getCsrfToken()) . '";
		', self::JS_PRIORITY_HIGH);
        // Temporary fix for access to main menu hover elements on android/blackberry touch devices
        $this->addInlineJavascript('
			if(navigator.userAgent.match(/Android|PlayBook/i)) {
				jQuery("#main-menu > li > a").attr("href", "#");
				jQuery("a.icon_arrow").attr("href", "#");
			}
		');
        header('Content-Type: text/html; charset=UTF-8');
        require WT_ROOT . $headerfile;
        // Flush the output, so the browser can render the header and load javascript
        // while we are preparing data for the page
        if (ini_get('output_buffering')) {
            ob_flush();
        }
        flush();
        // Once we've displayed the header, we should no longer write session data.
        Zend_Session::writeClose();
        // We've displayed the header - display the footer automatically
        $this->page_header = true;
        return $this;
    }
Ejemplo n.º 26
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     $SHOW_GEDCOM_RECORD = get_gedcom_setting(WT_GED_ID, 'SHOW_GEDCOM_RECORD');
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-indi');
     $menu->addLabel($menu->label, 'down');
     // What behaviour shall we give the main menu?  If we leave it blank, the framework
     // will copy the first submenu - which may be edit-raw or delete.
     // As a temporary solution, make it edit the name
     $menu->addOnclick("return false;");
     if (WT_USER_CAN_EDIT) {
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'NAME' && $fact->canEdit()) {
                 $menu->addOnclick("return edit_name('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
             }
             break;
         }
         $submenu = new WT_Menu(WT_I18N::translate('Add a new name'), '#', 'menu-indi-addname');
         $submenu->addOnclick("return add_name('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
         $has_sex_record = false;
         $submenu = new WT_Menu(WT_I18N::translate('Edit gender'), '#', 'menu-indi-editsex');
         foreach ($this->record->getFacts() as $fact) {
             if ($fact->getTag() == 'SEX' && $fact->canEdit()) {
                 $submenu->addOnclick("return edit_record('" . $this->record->getXref() . "', '" . $fact->getFactId() . "');");
                 $has_sex_record = true;
                 break;
             }
         }
         if (!$has_sex_record) {
             $submenu->addOnclick("return add_new_record('" . $this->record->getXref() . "', 'SEX');");
         }
         $menu->addSubmenu($submenu);
         if (count($this->record->getSpouseFamilies()) > 1) {
             $submenu = new WT_Menu(WT_I18N::translate('Re-order families'), '#', 'menu-indi-orderfam');
             $submenu->addOnclick("return reorder_families('" . $this->record->getXref() . "');");
             $menu->addSubmenu($submenu);
         }
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-indi-del');
         $submenu->addOnclick("return delete_individual('" . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs(strip_tags($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // edit raw
     if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-indi-editraw');
         $submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
         $menu->addSubmenu($submenu);
     }
     // add to favorites
     if (array_key_exists('user_favorites', WT_Module::getActiveModules())) {
         $submenu = new WT_Menu(WT_I18N::translate('Add to favorites'), '#', 'menu-indi-addfav');
         $submenu->addOnclick("jQuery.post('module.php?mod=user_favorites&amp;mod_action=menu-add-favorite',{xref:'" . $this->record->getXref() . "'},function(){location.reload();})");
         $menu->addSubmenu($submenu);
     }
     return $menu;
 }
Ejemplo n.º 27
0
        }
        echo '</div>';
    }
    // Output Sources
    if ($type == "source") {
        echo '<div id="find-output">';
        if ($filter) {
            $mysourcelist = search_sources($filter_array, array(WT_GED_ID), 'AND', true);
        } else {
            $mysourcelist = get_source_list(WT_GED_ID);
        }
        if ($mysourcelist) {
            usort($mysourcelist, array('WT_GedcomRecord', 'Compare'));
            echo '<ul>';
            foreach ($mysourcelist as $source) {
                echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\', \'', WT_Filter::escapeJs($source->getFullName()), '\');"><span class="list_item">', $source->getFullName(), '</span></a></li>';
            }
            echo '</ul>
			<p>', WT_I18N::translate('Total sources: %s', count($mysourcelist)), '</p>';
        } else {
            echo '<p>', WT_I18N::translate('No results found.'), '</p>';
        }
        echo '</div>';
    }
    // Output Special Characters
    if ($type == "specialchar") {
        echo '<div id="find-output-special"><p>';
        // lower case special characters
        foreach ($lcspecialchars as $key => $value) {
            echo '<a class="largechars" href="#" onclick="return window.opener.paste_char(\'', $value, '\');">', $key, '</a> ';
        }
Ejemplo n.º 28
0
        $module->order = $order;
        // Make the new order take effect immediately
    }
    uasort($modules, function ($x, $y) {
        return $x->order - $y->order;
    });
}
?>
<div id="sidebars" align="center">
	<form method="post" action="<?php 
echo WT_SCRIPT_NAME;
?>
">
		<input type="hidden" name="action" value="update_mods">
		<?php 
echo WT_Filter::getCsrf();
?>
		<table id="sidebars_table" class="modules_table">
			<thead>
				<tr>
					<th><?php 
echo WT_I18N::translate('Sidebar');
?>
</th>
					<th><?php 
echo WT_I18N::translate('Description');
?>
</th>
					<th><?php 
echo WT_I18N::translate('Order');
?>
Ejemplo n.º 29
0
					/* approved          */ { class: "center" },
					/* delete            */ { sortable: false }
				],
				"drawCallback": function() {
					// Our JSON responses include Javascript as well as HTML.  This does not get executed automatically…
					jQuery("#list script").each(function() {
						eval(this.text);
					});
				}
			});

			/* When clicking on the +/- icon, we expand/collapse the details block */
			jQuery("#list tbody").on("click", "td.icon-close", function () {
				var nTr=this.parentNode;
				jQuery(this).removeClass("icon-close");
				oTable.fnClose(nTr);
				jQuery(this).addClass("icon-open");
			});
			jQuery("#list tbody").on("click", "td.icon-open", function () {
				var nTr=this.parentNode;
				jQuery(this).removeClass("icon-open");
				var aData=oTable.fnGetData(nTr);
				jQuery.get("' . WT_SCRIPT_NAME . '?action=load1row&user_id="+aData[1], function(data) {
					oTable.fnOpen(nTr, data, "details");
				});
				jQuery(this).addClass("icon-close");
			});
			oTable.fnFilter("' . WT_Filter::get('filter') . '");
		');
        break;
}
Ejemplo n.º 30
0
 public function configureBlock($block_id)
 {
     if (WT_Filter::postBool('save') && WT_Filter::checkCsrf()) {
         set_block_setting($block_id, 'show_other', WT_Filter::postBool('show_other'));
         set_block_setting($block_id, 'show_unassigned', WT_Filter::postBool('show_unassigned'));
         set_block_setting($block_id, 'show_future', WT_Filter::postBool('show_future'));
         set_block_setting($block_id, 'block', WT_Filter::postBool('block'));
         exit;
     }
     require_once WT_ROOT . 'includes/functions/functions_edit.php';
     $show_other = get_block_setting($block_id, 'show_other', true);
     echo '<tr><td class="descriptionbox wrap width33">';
     echo WT_I18N::translate('Show research tasks that are assigned to other users');
     echo '</td><td class="optionbox">';
     echo edit_field_yes_no('show_other', $show_other);
     echo '</td></tr>';
     $show_unassigned = get_block_setting($block_id, 'show_unassigned', true);
     echo '<tr><td class="descriptionbox wrap width33">';
     echo WT_I18N::translate('Show research tasks that are not assigned to any user');
     echo '</td><td class="optionbox">';
     echo edit_field_yes_no('show_unassigned', $show_unassigned);
     echo '</td></tr>';
     $show_future = get_block_setting($block_id, 'show_future', true);
     echo '<tr><td class="descriptionbox wrap width33">';
     echo WT_I18N::translate('Show research tasks that have a date in the future');
     echo '</td><td class="optionbox">';
     echo edit_field_yes_no('show_future', $show_future);
     echo '</td></tr>';
     $block = get_block_setting($block_id, 'block', true);
     echo '<tr><td class="descriptionbox wrap width33">';
     echo WT_I18N::translate('Add a scrollbar when block contents grow');
     echo '</td><td class="optionbox">';
     echo edit_field_yes_no('block', $block);
     echo '</td></tr>';
 }