Example #1
0
 public function getSidebarContent()
 {
     global $SHOW_COUNTER, $controller;
     $indifacts = array();
     // The individual’s own facts
     foreach ($controller->record->getFacts() as $fact) {
         if (self::showFact($fact)) {
             $indifacts[] = $fact;
         }
     }
     ob_start();
     if (!$indifacts) {
         echo WT_I18N::translate('There are no facts for this individual.');
     } else {
         foreach ($indifacts as $fact) {
             print_fact($fact, $controller->record);
         }
     }
     echo '<div id="hitcounter">';
     if ($SHOW_COUNTER && empty($SEARCH_SPIDER)) {
         //print indi counter only if displaying a non-private person
         require WT_ROOT . 'includes/hitcount.php';
         echo WT_I18N::translate('Hit count:') . ' ' . $hitCount;
     }
     echo '</div>';
     // close #hitcounter
     return strip_tags(ob_get_clean(), '<a><div><span>');
 }
Example #2
0
 public static function statusName($status_code)
 {
     switch ($status_code) {
         case 'BIC':
             return WT_I18N::translate('Born in the covenant');
         case 'CANCELED':
             return WT_I18N::translate('Sealing cancelled (divorce)');
         case 'CHILD':
             return WT_I18N::translate('Died as a child: exempt');
         case 'CLEARED':
             // This status appears in PGV, but not in the GEDCOM 5.5.1 specification.
             return WT_I18N::translate('Cleared but not yet completed');
         case 'COMPLETED':
             return WT_I18N::translate('Completed; date unknown');
         case 'DNS':
             return WT_I18N::translate('Do not seal: unauthorized');
         case 'DNS/CAN':
             return WT_I18N::translate('Do not seal, previous sealing cancelled');
         case 'EXCLUDED':
             return WT_I18N::translate('Excluded from this submission');
         case 'INFANT':
             return WT_I18N::translate('Died as an infant: exempt');
         case 'PRE-1970':
             return WT_I18N::translate('Completed before 1970; date not available');
         case 'STILLBORN':
             return WT_I18N::translate('Stillborn: exempt');
         case 'SUBMITTED':
             return WT_I18N::translate('Submitted but not yet cleared');
         case 'UNCLEARED':
             return WT_I18N::translate('Uncleared: insufficient data');
         default:
             return $status_code;
     }
 }
Example #3
0
 /**
  * get edit menu
  */
 function getEditMenu()
 {
     if (!$this->record || $this->record->isOld()) {
         return null;
     }
     // edit menu
     $menu = new WT_Menu(WT_I18N::translate('Edit'), '#', 'menu-note');
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit note'), '#', 'menu-note-edit');
         $submenu->addOnclick('return edit_note(\'' . $this->record->getXref() . '\');');
         $menu->addSubmenu($submenu);
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-note-del');
         $submenu->addOnclick("return delete_note('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $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-note-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);
     }
     //-- get the link for the first submenu and set it as the link for the main menu
     if (isset($menu->submenus[0])) {
         $link = $menu->submenus[0]->onclick;
         $menu->addOnclick($link);
     }
     return $menu;
 }
Example #4
0
 protected function formatLongYear()
 {
     if ($this->y < 0) {
         return WT_I18N::translate('%s&nbsp;BCE', WT_I18N::digits(-$this->y));
     } else {
         if ($this->new_old_style) {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits(sprintf('%d/%02d', $this->y - 1, $this->y % 100)));
         } else {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits($this->y));
         }
     }
 }
Example #5
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());
 }
Example #6
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;
     }
 }
Example #7
0
 public function modAction($mod_action)
 {
     switch ($mod_action) {
         case 'admin_batch_update':
             $controller = new WT_Controller_Page();
             $controller->setPageTitle(WT_I18N::translate('Batch update'))->restrictAccess(Auth::isAdmin())->pageHeader();
             // TODO: these files should be methods in this class
             require WT_ROOT . WT_MODULES_DIR . $this->getName() . '/' . $mod_action . '.php';
             $mod = new batch_update();
             echo $mod->main();
             break;
         default:
             header('HTTP/1.0 404 Not Found');
     }
 }
Example #8
0
 public static function getValue($type)
 {
     switch ($type) {
         case '3':
             return WT_I18N::translate('primary evidence');
         case '2':
             return WT_I18N::translate('secondary evidence');
         case '1':
             return WT_I18N::translate('questionable evidence');
         case '0':
             return WT_I18N::translate('unreliable evidence');
         default:
             return $type;
     }
 }
Example #9
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;
     }
 }
Example #10
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-repo');
     if (WT_USER_CAN_EDIT) {
         $fact = $this->record->getFirstFact('NAME');
         $submenu = new WT_Menu(WT_I18N::translate('Edit repository'), '#', 'menu-repo-edit');
         if ($fact) {
             // Edit existing name
             $submenu->addOnclick('return edit_record(\'' . $this->record->getXref() . '\', \'' . $fact->getFactId() . '\');');
         } else {
             // Add new name
             $submenu->addOnclick('return add_fact(\'' . $this->record->getXref() . '\', \'NAME\');');
         }
         $menu->addSubmenu($submenu);
     }
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-repo-del');
         $submenu->addOnclick("return delete_repository('" . WT_I18N::translate('Are you sure you want to delete “%s”?', 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-repo-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-repo-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);
     }
     //-- get the link for the first submenu and set it as the link for the main menu
     if (isset($menu->submenus[0])) {
         $link = $menu->submenus[0]->onclick;
         $menu->addOnclick($link);
     }
     return $menu;
 }
Example #11
0
 public function __construct()
 {
     // Automatically fix broken links
     if ($this->record && $this->record->canEdit()) {
         $broken_links = 0;
         foreach ($this->record->getFacts('HUSB|WIFE|CHIL|FAMS|FAMC|REPO') as $fact) {
             if (!$fact->isOld() && $fact->getTarget() === null) {
                 $this->record->deleteFact($fact->getFactId(), false);
                 WT_FlashMessages::addMessage(WT_I18N::translate('The link from “%1$s” to “%2$s” has been deleted.', $this->record->getFullName(), $fact->getValue()));
                 $broken_links = true;
             }
         }
         foreach ($this->record->getFacts('NOTE|SOUR|OBJE') as $fact) {
             // These can be links or inline.  Only delete links.
             if (!$fact->isOld() && $fact->getTarget() === null && preg_match('/^@.*@$/', $fact->getValue())) {
                 $this->record->deleteFact($fact->getFactId(), false);
                 WT_FlashMessages::addMessage(WT_I18N::translate('The link from “%1$s” to “%2$s” has been deleted.', $this->record->getFullName(), $fact->getValue()));
                 $broken_links = true;
             }
         }
         if ($broken_links) {
             // Reload the updated family
             $this->record = WT_GedcomRecord::getInstance($this->record->getXref());
         }
     }
     parent::__construct();
     // We want robots to index this page
     $this->setMetaRobots('index,follow');
     // Set a page title
     if ($this->record) {
         $this->setCanonicalUrl($this->record->getHtmlUrl());
         if ($this->record->canShowName()) {
             // e.g. "John Doe" or "1881 Census of Wales"
             $this->setPageTitle($this->record->getFullName());
         } else {
             // e.g. "Individual" or "Source"
             $record = $this->record;
             $this->setPageTitle(WT_Gedcom_Tag::getLabel($record::RECORD_TYPE));
         }
     } else {
         // No such record
         $this->setPageTitle(WT_I18N::translate('Private'));
     }
 }
Example #12
0
 public function getBlock($block_id, $template = true, $cfg = null)
 {
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = '<span dir="auto">' . WT_I18N::translate('Welcome %s', Auth::user()->getRealName()) . '</span>';
     $content = '<table><tr>';
     if (Auth::user()->getSetting('editaccount')) {
         $content .= '<td><a href="edituser.php"><i class="icon-mypage"></i><br>' . WT_I18N::translate('My account') . '</a></td>';
     }
     if (WT_USER_GEDCOM_ID) {
         $content .= '<td><a href="pedigree.php?rootid=' . WT_USER_GEDCOM_ID . '&amp;ged=' . WT_GEDURL . '"><i class="icon-pedigree"></i><br>' . WT_I18N::translate('My pedigree') . '</a></td>';
         $content .= '<td><a href="individual.php?pid=' . WT_USER_GEDCOM_ID . '&amp;ged=' . WT_GEDURL . '"><i class="icon-indis"></i><br>' . WT_I18N::translate('My individual record') . '</a></td>';
     }
     $content .= '</tr></table>';
     if ($template) {
         require WT_THEME_DIR . 'templates/block_main_temp.php';
     } else {
         return $content;
     }
 }
Example #13
0
 public function getBlock($block_id, $template = true, $cfg = null)
 {
     global $controller;
     $indi_xref = $controller->getSignificantIndividual()->getXref();
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = '<span dir="auto">' . WT_TREE_TITLE . '</span>';
     $content = '<table><tr>';
     $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&amp;ged=' . WT_GEDURL . '"><i class="icon-pedigree"></i><br>' . WT_I18N::translate('Default chart') . '</a></td>';
     $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&amp;ged=' . WT_GEDURL . '"><i class="icon-indis"></i><br>' . WT_I18N::translate('Default individual') . '</a></td>';
     if (WT_Site::preference('USE_REGISTRATION_MODULE') && WT_USER_ID == false) {
         $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . WT_I18N::translate('Request new user account') . '</a></td>';
     }
     $content .= "</tr>";
     $content .= "</table>";
     if ($template) {
         require WT_THEME_DIR . 'templates/block_main_temp.php';
     } else {
         return $content;
     }
 }
Example #14
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-note');
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Edit note'), '#', 'menu-note-edit');
         $submenu->addOnclick('return edit_note(\'' . $this->record->getXref() . '\');');
         $menu->addSubmenu($submenu);
     }
     // edit raw
     /* Does not currently work - NOTE records do not contain nice level 1 facts
     		if (Auth::isAdmin() || WT_USER_CAN_EDIT && $SHOW_GEDCOM_RECORD) {
     			$submenu = new WT_Menu(WT_I18N::translate('Edit raw GEDCOM'), '#', 'menu-note-editraw');
     			$submenu->addOnclick("return edit_raw('" . $this->record->getXref() . "');");
     			$menu->addSubmenu($submenu);
     		}
     		 */
     // delete
     if (WT_USER_CAN_EDIT) {
         $submenu = new WT_Menu(WT_I18N::translate('Delete'), '#', 'menu-note-del');
         $submenu->addOnclick("return delete_note('" . WT_I18N::translate('Are you sure you want to delete “%s”?', strip_tags($this->record->getFullName())) . "', '" . $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-note-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);
     }
     //-- get the link for the first submenu and set it as the link for the main menu
     if (isset($menu->submenus[0])) {
         $link = $menu->submenus[0]->onclick;
         $menu->addOnclick($link);
     }
     return $menu;
 }
Example #15
0
 public static function getValue($type, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'BOTH':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by both parents');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by both parents');
                 default:
                     return WT_I18N::translate('Adopted by both parents');
             }
         case 'HUSB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by father');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by father');
                 default:
                     return WT_I18N::translate('Adopted by father');
             }
         case 'WIFE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by mother');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by mother');
                 default:
                     return WT_I18N::translate('Adopted by mother');
             }
         default:
             return $type;
     }
 }
Example #16
0
function color_theme_dropdown()
{
    global $COLOR_THEME_LIST, $WT_SESSION, $subColor;
    $menu = new WT_Menu(WT_I18N::translate('Palette'), '#', 'menu-color');
    uasort($COLOR_THEME_LIST, array('WT_I18N', 'strcasecmp'));
    foreach ($COLOR_THEME_LIST as $colorChoice => $colorName) {
        $submenu = new WT_Menu($colorName, get_query_url(array('themecolor' => $colorChoice), '&amp;'), 'menu-color-' . $colorChoice);
        if (isset($WT_SESSION->subColor)) {
            if ($WT_SESSION->subColor == $colorChoice) {
                $submenu->addClass('', '', 'theme-active');
            }
        } elseif (WT_Site::preference('DEFAULT_COLOR_PALETTE') == $colorChoice) {
            /* here when visitor changes palette from default */
            $submenu->addClass('', '', 'theme-active');
        } elseif ($subColor == 'ash') {
            /* here when site has different theme as default and user switches to colors */
            if ($subColor == $colorChoice) {
                $submenu->addClass('', '', 'theme-active');
            }
        }
        $menu->addSubMenu($submenu);
    }
    return $menu->getMenuAsList();
}
Example #17
0
 static function monthNameInstrumentalCase($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Muharram');
         case 2:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Safar');
         case 3:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rabi’ al-awwal');
         case 4:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rabi’ al-thani');
         case 5:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Jumada al-awwal');
         case 6:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Jumada al-thani');
         case 7:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rajab');
         case 8:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Sha’aban');
         case 9:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Ramadan');
         case 10:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Shawwal');
         case 11:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Dhu al-Qi’dah');
         case 12:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Dhu al-Hijjah');
         default:
             return '';
     }
 }
Example #18
0
    // Insert the label into the submenu
    if (is_array($menu->submenus)) {
        array_unshift($menu->submenus, $tmp);
    } else {
        $menu->addSubmenu($tmp);
    }
    // Neutralise the top-level menu
    $menu->label = '';
    $menu->onclick = '';
    $menu->iconclass = '';
    return $menu->getMenuAsList();
}
// Theme name - this needs double quotes, as file is scanned/parsed by script
$theme_name = "clouds";
/* I18N: Name of a theme. */
WT_I18N::translate('clouds');
// A version number in the path prevents browser-cache problems during upgrade
define('WT_CSS_URL', WT_THEME_URL . 'css-1.5.4/');
$headerfile = WT_THEME_DIR . 'header.php';
$footerfile = WT_THEME_DIR . 'footer.php';
$WT_IMAGES = array('dline' => WT_CSS_URL . 'images/dline.png', 'dline2' => WT_CSS_URL . 'images/dline2.png', 'hline' => WT_CSS_URL . 'images/hline.png', 'spacer' => WT_CSS_URL . 'images/spacer.png', 'vline' => WT_CSS_URL . 'images/vline.png', 'add' => WT_CSS_URL . 'images/add.png', 'button_family' => WT_CSS_URL . 'images/buttons/family.png', 'minus' => WT_CSS_URL . 'images/minus.png', 'plus' => WT_CSS_URL . 'images/plus.png', 'remove' => WT_CSS_URL . 'images/delete.png', 'search' => WT_CSS_URL . 'images/go.png', 'default_image_F' => WT_CSS_URL . 'images/silhouette_female.png', 'default_image_M' => WT_CSS_URL . 'images/silhouette_male.png', 'default_image_U' => WT_CSS_URL . 'images/silhouette_unknown.png');
// Variables for the Fan chart
$fanChart = array('font' => WT_ROOT . 'includes/fonts/DejaVuSans.ttf', 'size' => 7, 'color' => '#000000', 'bgColor' => '#eeeeee', 'bgMColor' => '#b1cff0', 'bgFColor' => '#e9daf1');
// This section defines variables for the charts
$bwidth = 250;
// width of boxes on all person-box based charts
$bheight = 80;
// height of boxes on all person-box based chart
$baseyoffset = 10;
// position the timeline chart relative to the top of the page
$basexoffset = 10;
Example #19
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=' . rawurlencode($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=' . rawurlencode($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>';
}
Example #20
0
 static function dayNames($n)
 {
     switch ($n) {
         case 0:
             return WT_I18N::translate('Primidi');
         case 1:
             return WT_I18N::translate('Duodi');
         case 2:
             return WT_I18N::translate('Tridi');
         case 3:
             return WT_I18N::translate('Quartidi');
         case 4:
             return WT_I18N::translate('Quintidi');
         case 5:
             return WT_I18N::translate('Sextidi');
         case 6:
             return WT_I18N::translate('Septidi');
         case 7:
             return WT_I18N::translate('Octidi');
         case 8:
             return WT_I18N::translate('Nonidi');
         case 9:
             return WT_I18N::translate('Decidi');
     }
 }
Example #21
0
    echo WT_GEDCOM;
    ?>
">
				<input type="hidden" name="topsearch" value="yes">
				<input type="search" name="query" size="25" placeholder="<?php 
    echo WT_I18N::translate('Search');
    ?>
">
				<input type="image" class="image" src="<?php 
    echo $WT_IMAGES['search'];
    ?>
" alt="<?php 
    echo WT_I18N::translate('Search');
    ?>
" title="<?php 
    echo WT_I18N::translate('Search');
    ?>
">
			</form>
		</div>
		<div id="topMenu">
			<ul id="main-menu">
				<?php 
    echo WT_MenuBar::getGedcomMenu();
    ?>
				<?php 
    echo WT_MenuBar::getMyPageMenu();
    ?>
				<?php 
    echo WT_MenuBar::getChartsMenu();
    ?>
Example #22
0
 public function getDescription()
 {
     // This text also appears in the .XML file - update both together
     return WT_I18N::translate('A report of an individual’s descendants, in a narrative style.');
 }
Example #23
0
echo '<a onclick="move_left_right_block(\'right_select\', \'available_select\');" title="', WT_I18N::translate('Remove'), '"class="', $IconLarrow, '"></a>';
echo '<br>';
echo '<a onclick="move_left_right_block(\'available_select\', \'right_select\');" title="', WT_I18N::translate('Add'), '"class="', $IconRarrow, '"></a>';
echo '<br><br>';
echo help_link('block_move_right');
echo '</td>';
// NOTE: Row 2 column 6: Right block list
echo '<td class="optionbox center">';
echo '<select multiple="multiple" id="right_select" name="right[]" size="10" onchange="show_description(\'right_select\');">';
foreach ($blocks['side'] as $block_id => $block_name) {
    echo '<option value="', $block_id, '">', $all_blocks[$block_name]->getTitle(), '</option>';
}
echo '</select>';
echo '</td>';
// NOTE: Row 2 column 7: Up/Down buttons for right block list
echo '<td class="optionbox center vmiddle">';
echo '<a onclick="move_up_block(\'right_select\');" title="', WT_I18N::translate('Move up'), '"class="', $IconUarrow, '"></a>';
echo '<br>';
echo '<a onclick="move_down_block(\'right_select\');" title="', WT_I18N::translate('Move down'), '"class="', $IconDarrow, '"></a>';
echo '<br><br>';
echo help_link('block_move_up');
echo '</td>';
echo '</tr>';
// NOTE: Row 3 columns 1-7: Summary description of currently selected block
echo '<tr><td class="descriptionbox wrap" colspan="7"><div id="instructions">';
echo 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.');
echo '</div></td></tr>';
echo '<tr><td class="topbottombar" colspan="7">';
echo '<input type="submit" value="', WT_I18N::translate('save'), '">';
echo '</td></tr></table>';
echo '</form>';
Example #24
0
                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> ';
        }
        echo '</p><p>';
        //upper case special characters
        foreach ($ucspecialchars as $key => $value) {
            echo '<a class="largechars" href="#" onclick="return window.opener.paste_char(\'', $value, '\');">', $key, '</a> ';
        }
        echo '</p><p>';
        // other special characters (not letters)
        foreach ($otherspecialchars as $key => $value) {
            echo '<a class="largechars" href="#" onclick="return window.opener.paste_char(\'', $value, '\');">', $key, '</a> ';
        }
        echo '</p></div>';
    }
}
echo '<button onclick="window.close();">', WT_I18N::translate('close'), '</button>';
echo "</div>";
Example #25
0
 /**
  * get image properties
  *
  * @param string $which     specify either 'main' or 'thumb'
  * @param int    $addWidth  amount to add to width
  * @param int    $addHeight amount to add to height
  *
  * @return array
  */
 public function getImageAttributes($which = 'main', $addWidth = 0, $addHeight = 0)
 {
     global $THUMBNAIL_WIDTH;
     $var = $which . 'imagesize';
     if (!empty($this->{$var})) {
         return $this->{$var};
     }
     $imgsize = array();
     if ($this->fileExists($which)) {
         $imgsize = @getimagesize($this->getServerFilename($which));
         // [0]=width [1]=height [2]=filetype ['mime']=mimetype
         if (is_array($imgsize) && !empty($imgsize['0'])) {
             // this is an image
             $imgsize[0] = $imgsize[0] + 0;
             $imgsize[1] = $imgsize[1] + 0;
             $imgsize['adjW'] = $imgsize[0] + $addWidth;
             // adjusted width
             $imgsize['adjH'] = $imgsize[1] + $addHeight;
             // adjusted height
             $imageTypes = array('', 'GIF', 'JPG', 'PNG', 'SWF', 'PSD', 'BMP', 'TIFF', 'TIFF', 'JPC', 'JP2', 'JPX', 'JB2', 'SWC', 'IFF', 'WBMP', 'XBM');
             $imgsize['ext'] = $imageTypes[0 + $imgsize[2]];
             // this is for display purposes, always show non-adjusted info
             $imgsize['WxH'] = WT_I18N::translate('%1$s × %2$s pixels', WT_I18N::number($imgsize['0']), WT_I18N::number($imgsize['1']));
             $imgsize['imgWH'] = ' width="' . $imgsize['adjW'] . '" height="' . $imgsize['adjH'] . '" ';
             if ($which == 'thumb' && $imgsize['0'] > $THUMBNAIL_WIDTH) {
                 // don’t let large images break the dislay
                 $imgsize['imgWH'] = ' width="' . $THUMBNAIL_WIDTH . '" ';
             }
         }
     }
     if (!is_array($imgsize) || empty($imgsize['0'])) {
         // this is not an image, OR the file doesn’t exist OR it is a url
         $imgsize[0] = 0;
         $imgsize[1] = 0;
         $imgsize['adjW'] = 0;
         $imgsize['adjH'] = 0;
         $imgsize['ext'] = '';
         $imgsize['mime'] = '';
         $imgsize['WxH'] = '';
         $imgsize['imgWH'] = '';
         if ($this->isExternal($which)) {
             // don’t let large external images break the dislay
             $imgsize['imgWH'] = ' width="' . $THUMBNAIL_WIDTH . '" ';
         }
     }
     if (empty($imgsize['mime'])) {
         // this is not an image, OR the file doesn’t exist OR it is a url
         // set file type equal to the file extension - can’t use parse_url because this may not be a full url
         $exp = explode('?', $this->file);
         $pathinfo = pathinfo($exp[0]);
         $imgsize['ext'] = @strtoupper($pathinfo['extension']);
         // all mimetypes we wish to serve with the media firewall must be added to this array.
         $mime = array('DOC' => 'application/msword', 'MOV' => 'video/quicktime', 'MP3' => 'audio/mpeg', 'PDF' => 'application/pdf', 'PPT' => 'application/vnd.ms-powerpoint', 'RTF' => 'text/rtf', 'SID' => 'image/x-mrsid', 'TXT' => 'text/plain', 'XLS' => 'application/vnd.ms-excel', 'WMV' => 'video/x-ms-wmv');
         if (empty($mime[$imgsize['ext']])) {
             // if we don’t know what the mimetype is, use something ambiguous
             $imgsize['mime'] = 'application/octet-stream';
             if ($this->fileExists($which)) {
                 // alert the admin if we cannot determine the mime type of an existing file
                 // as the media firewall will be unable to serve this file properly
                 Log::addMediaLog('Media Firewall error: >Unknown Mimetype< for file >' . $this->file . '<');
             }
         } else {
             $imgsize['mime'] = $mime[$imgsize['ext']];
         }
     }
     $this->{$var} = $imgsize;
     return $this->{$var};
 }
Example #26
0
 public function getDescription()
 {
     // This text also appears in the .XML file - update both together
     return WT_I18N::translate('A report of individuals who were born in a given time or place.');
 }
Example #27
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;
 }
Example #28
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;
    }
Example #29
0
    case 'cleanup2':
        foreach (User::all() as $user) {
            if (WT_Filter::post('del_' . $user->getUserId()) == '1') {
                Log::addAuthenticationLog('Deleted user: ' . $user->getUserName());
                echo WT_I18N::translate('Deleted user: '), $user->getUserName(), '<br>';
                $user->delete();
            }
        }
        break;
    case 'listusers':
    default:
        echo '<table id="list">', '<thead>', '<tr>', '<th style="margin:0 -2px 1px 1px; padding:6px 0 5px;"> </th>', '<th> user-id </th>', '<th>', WT_I18N::translate('Username'), '</th>', '<th>', WT_I18N::translate('Real name'), '</th>', '<th>', WT_I18N::translate('Email'), '</th>', '<th> </th>', '<th>', WT_I18N::translate('Language'), '</th>', '<th> date_registered </th>', '<th>', WT_I18N::translate('Date registered'), '</th>', '<th> last_login </th>', '<th>', WT_I18N::translate('Last logged in'), '</th>', '<th>', WT_I18N::translate('Verified'), '</th>', '<th>', WT_I18N::translate('Approved'), '</th>', '<th style="margin:0 -2px 1px 1px; padding:3px 0 4px;"> </th>', '</tr>', '</thead>', '<tbody>', '</tbody>', '</table>';
        $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addExternalJavascript(WT_JQUERY_JEDITABLE_URL)->addInlineJavascript('
			var oTable = jQuery("#list").dataTable({
				dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
				' . WT_I18N::datatablesI18N() . ',
				processing: true,
				serverSide: true,
				ajax: "' . WT_SCRIPT_NAME . '?action=loadrows",
				jQueryUI: true,
				autoWidth: false,
				pageLength: ' . Auth::user()->getSetting('admin_users_page_size', 10) . ',
				pagingType: "full_numbers",
				sorting: [[2,"asc"]],
				columns: [
					/* details           */ { sortable: false, class: "icon-open" },
					/* user-id           */ { visible: false },
					/* user_name         */ null,
					/* real_name         */ null,
					/* email             */ null,
					/* email link        */ { sortable: false },
Example #30
0
 static function calendarName()
 {
     return WT_I18N::translate('Gregorian');
 }