• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Controller\PageController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Fisharebest\Webtrees\Controller\PageController的典型用法代码示例。如果您正苦于以下问题:PHP PageController类的具体用法?PHP PageController怎么用?PHP PageController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PageController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * SosaStats@index
  */
 public function index()
 {
     global $WT_TREE;
     $controller = new PageController();
     $controller->setPageTitle(I18N::translate('Sosa Statistics'))->addInlineJavascript('$(".help_tooltip").tooltip();');
     $view_bag = new ViewBag();
     $view_bag->set('title', $controller->getPageTitle());
     $view_bag->set('is_setup', false);
     if ($this->sosa_provider->isSetup()) {
         $view_bag->set('is_setup', true);
         $view_bag->set('root_indi', $this->sosa_provider->getRootIndi());
         $sosaCount = $this->sosa_provider->getSosaCount();
         $diffSosaCount = $this->sosa_provider->getDifferentSosaCount();
         $general_stats = array('sosa_count' => $sosaCount, 'distinct_count' => $diffSosaCount, 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime());
         $view_bag->set('general_stats', $general_stats);
         $stats_gen = $this->sosa_provider->getStatisticsByGeneration();
         $view_bag->set('missinganc_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaList@missing&ged=' . $WT_TREE->getNameUrl() . '&gen=');
         $view_bag->set('sosaanc_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaList&ged=' . $WT_TREE->getNameUrl() . '&gen=');
         $gen_theoretical = 1;
         $total_theoretical = 0;
         $prev_diff = 0;
         $prev_known = 0.5;
         $gen_equiv = 0;
         $generation_stats = array();
         foreach ($stats_gen as $gen => $tab) {
             $genY1 = I18N::translate('-');
             $genY2 = I18N::translate('-');
             if ($tab['firstBirth'] > 0) {
                 $genY1 = $tab['firstBirth'];
             }
             if ($tab['lastBirth'] > 0) {
                 $genY2 = $tab['lastBirth'];
             }
             $total_theoretical += $gen_theoretical;
             $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical);
             $gen_equiv += $perc_sosa_count_theor;
             $missing = 2 * $prev_known - $tab['sosaCount'];
             $gen_diff = $tab['diffSosaTotalCount'] - $prev_diff;
             $generation_stats[$gen] = array('gen_min_birth' => $genY1, 'gen_max_birth' => $genY2, 'theoretical' => $gen_theoretical, 'known' => $tab['sosaCount'], 'perc_known' => $perc_sosa_count_theor, 'missing' => $missing, 'perc_missing' => 1 - Functions::safeDivision($tab['sosaCount'], 2 * $prev_known), 'total_known' => $tab['sosaTotalCount'], 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), 'different' => $gen_diff, 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), 'total_different' => $tab['diffSosaTotalCount'], 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']));
             $gen_theoretical = $gen_theoretical * 2;
             $prev_known = $tab['sosaCount'];
             $prev_diff = $tab['diffSosaTotalCount'];
         }
         $view_bag->set('generation_stats', $generation_stats);
         $view_bag->set('equivalent_gen', $gen_equiv);
         $view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2());
         $view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3());
     }
     ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render();
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:53,代码来源:SosaStatsController.php


示例2: index

    /**
     * SosaConfig@index
     */
    public function index()
    {
        global $WT_TREE;
        $controller = new PageController();
        $controller->setPageTitle(I18N::translate('Sosa Configuration'))->restrictAccess(Auth::check())->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();')->addInlineJavascript('
            $( document ).ready(function() {
                $("#bt_sosa_compute").click(function() {
                    majComputeSosa($("#maj_sosa_input_userid, #maj-sosa-config-select option:selected").val());
                 });
            });
            
            function majComputeSosa(user_id) {
                jQuery("#bt_sosa_compute").prop( "disabled", true );
                jQuery("#bt_sosa_computing").empty().html("<i class=\\"icon-loading-small\\"></i>&nbsp;' . I18N::translate('Computing...') . '");
                jQuery("#bt_sosa_computing").load(
		          "module.php?mod=' . $this->module->getName() . '&mod_action=SosaConfig@computeAll&ged=' . $WT_TREE->getNameUrl() . '&userid=" + user_id,
		          function() {
			         jQuery("#bt_sosa_compute").prop( "disabled", false );
                  });
            }');
        $action = Filter::post('action');
        if ($action === 'update') {
            $this->update($controller);
        }
        $view_bag = new ViewBag();
        $view_bag->set('title', $controller->getPageTitle());
        $view_bag->set('tree', $WT_TREE);
        $view_bag->set('form_url', 'module.php?mod=' . $this->module->getName() . '&mod_action=SosaConfig&ged=' . $WT_TREE->getNameUrl());
        $users_root = array();
        $users_js_array = 'var users_array = [];';
        if (Auth::check()) {
            $root_id = $WT_TREE->getUserPreference(Auth::user(), 'MAJ_SOSA_ROOT_ID');
            $users_root[] = array('user' => Auth::user(), 'rootid' => $root_id);
            $users_js_array .= 'users_array["' . Auth::user()->getUserId() . '"] = "' . $root_id . '";';
            if (Auth::isManager($WT_TREE)) {
                $default_user = User::find(-1);
                $default_root_id = $WT_TREE->getUserPreference($default_user, 'MAJ_SOSA_ROOT_ID');
                $users_root[] = array('user' => $default_user, 'rootid' => $default_root_id);
                $users_js_array .= 'users_array["' . $default_user->getUserId() . '"] = "' . $default_root_id . '";';
            }
        }
        $view_bag->set('users_settings', $users_root);
        $controller->addInlineJavascript($users_js_array . '            
                $("#maj-sosa-config-select").change(function() {
                    $("#rootid").val(users_array[this.value]);
                });
             ');
        ViewFactory::make('SosaConfig', $this, $controller, $view_bag)->render();
    }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:52,代码来源:SosaConfigController.php


示例3: index

 /**
  * AdminConfig@index
  */
 public function index()
 {
     global $WT_TREE;
     $action = Filter::post('action');
     if ($action == 'update' && Filter::checkCsrf()) {
         $this->update();
     }
     Theme::theme(new AdministrationTheme())->init($WT_TREE);
     $ctrl = new PageController();
     $ctrl->restrictAccess(Auth::isAdmin())->setPageTitle($this->module->getTitle());
     $view_bag = new ViewBag();
     $view_bag->set('title', $ctrl->getPageTitle());
     $view_bag->set('module', $this->module);
     ViewFactory::make('AdminConfig', $this, $ctrl, $view_bag)->render();
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:18,代码来源:AdminConfigController.php


示例4: pageBody

    private function pageBody(PageController $controller)
    {
        ?>
		<!-- ADMIN PAGE CONTENT -->
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>
		<h2><?php 
        echo $controller->getPageTitle();
        ?>
</h2>
		<form class="form-inline" method="post">
			<?php 
        echo Filter::getCsrf();
        ?>
			<input type="hidden" name="save" value="1">
			<!-- SHOW PDF -->
			<div class="form-group">
				<label class="control-label">
					<?php 
        echo I18N::translate('Access level');
        ?>
				</label>
				<?php 
        echo FunctionsEdit::editFieldAccessLevel('NEW_FTV_PDF_ACCESS_LEVEL', $this->getSetting('FTV_PDF_ACCESS_LEVEL'), 'class="form-control"');
        ?>
			</div>
			<!-- BUTTONS -->
			<button class="btn btn-primary" type="submit">
				<i class="fa fa-check"></i>
				<?php 
        echo I18N::translate('save');
        ?>
			</button>
		</form>
		<?php 
    }
开发者ID:JustCarmen,项目名称:fancy_treeview_pdf,代码行数:48,代码来源:AdminTemplate.php


示例5: status

    /**
     * Translation@status
     */
    public function status()
    {
        global $WT_TREE;
        $table_id = \Rhumsaa\Uuid\Uuid::uuid4();
        Theme::theme(new AdministrationTheme())->init($WT_TREE);
        $ctrl = new PageController();
        $ctrl->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Translations status'))->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addExternalJavascript(WT_DATATABLES_BOOTSTRAP_JS_URL)->addInlineJavascript('
                //Datatable initialisation
				jQuery.fn.dataTableExt.oSort["unicode-asc"  ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
				jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
				jQuery.fn.dataTableExt.oSort["num-html-asc" ]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a<b) ? -1 : (a>b ? 1 : 0);};
				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
	
				jQuery("#table_missing_' . $table_id . '").DataTable({
					' . I18N::datatablesI18N() . ',			
					sorting: [[0, "asc"]],                    
					pageLength: 15,
                    columns: [
						/* 0 Message	 	*/ null,
                        /* 1 Reference      */ null
					],
				});
                
                jQuery("#table_nonused_' . $table_id . '").DataTable({
					' . I18N::datatablesI18N() . ',			
					sorting: [[0, "asc"]],                    
					pageLength: 15,
                    columns: [
						/* 0 Message	 	*/ null,
                        /* 1 Reference      */ null
					],
				});
            ');
        $source_code_paths = array(WT_ROOT . 'vendor/jon48/webtrees-lib/src', WT_ROOT . 'vendor/jon48/webtrees-tools/src/app');
        $analyzer = new TranslationsAnalyzer($source_code_paths);
        $analyzer->load();
        $locale = $analyzer->getLocale();
        $view_bag = new ViewBag();
        $view_bag->set('table_id', $table_id);
        $view_bag->set('module', $this->module);
        $view_bag->set('source_code_paths', $source_code_paths);
        $view_bag->set('title', $ctrl->getPageTitle() . ' - ' . I18N::languageName($locale->languageTag()));
        $view_bag->set('missing_translations', $analyzer->getMissingTranslations());
        $view_bag->set('non_used_translations', $analyzer->getMajNonUsedTranslations());
        $view_bag->set('loading_stats', $analyzer->getLoadingStatistics());
        ViewFactory::make('TranslationStatus', $this, $ctrl, $view_bag)->render();
    }
开发者ID:jon48,项目名称:webtrees-tools,代码行数:50,代码来源:TranslationController.php


示例6: index

 /**
  * WelcomeBlock@index
  * 
  * @param PageController $parent_controller
  * @param Tree $tree
  * @param string $block_id
  * @param string $template
  * @return $string
  */
 public function index(PageController $parent_controller, Tree $tree, $block_id, $template)
 {
     $view_bag = new ViewBag();
     if ($parent_controller && $tree) {
         $view_bag->set('tree', $tree);
         $view_bag->set('indi', $parent_controller->getSignificantIndividual());
         $id = $this->module->getName() . $block_id;
         $class = $this->module->getName() . '_block';
         $parent_controller->addInlineJavascript('
             jQuery("#maj-new_passwd").hide();
             jQuery("#maj-passwd_click").click(function()
             {
                 jQuery("#maj-new_passwd").slideToggle(100, function() {
                     jQuery("#maj-new_passwd_username").focus();
 			});
 					return false;
 				  });
 			');
         if (Auth::isAdmin()) {
             $title = '<a class="icon-admin" title="' . I18N::translate('Configure') . '" href="block_edit.php?block_id=' . $block_id . '&amp;ged=' . $tree->getNameHtml() . '&amp;ctype=gedcom"></a>';
         } else {
             $title = '';
         }
         $title .= '<span dir="auto">' . $tree->getTitleHtml() . '</span>';
         $piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false);
         $view_bag->set('piwik_enabled', $piwik_enabled);
         if ($piwik_enabled) {
             $parent_controller->addInlineJavascript('$("#piwik_stats")
                     .load("module.php?mod=' . $this->module->getName() . '&mod_action=Piwik&block_id=' . $block_id . '");');
         }
         $content = ViewFactory::make('WelcomeBlock', $this, new BaseController(), $view_bag)->getHtmlPartial();
         if ($template) {
             return Theme::theme()->formatBlock($id, $title, $class, $content);
         } else {
             return $content;
         }
     }
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:47,代码来源:WelcomeBlockController.php


示例7: PageController

 * Copyright (C) 2015 webtrees development team
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDb;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'sourcelist.php');
require './includes/session.php';
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Sources'));
$controller->pageHeader();
echo '<div id="sourcelist-page">', '<h2>', I18N::translate('Sources'), '</h2>';
echo FunctionsPrintLists::sourceTable(FunctionsDb::getSourceList($WT_TREE));
echo '</div>';
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:sourcelist.php


示例8: PageController

namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsDate;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use PDO;
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_users.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin());
// Valid values for form variables
$ALL_EDIT_OPTIONS = array('none' => I18N::translate('Visitor'), 'access' => I18N::translate('Member'), 'edit' => I18N::translate('Editor'), 'accept' => I18N::translate('Moderator'), 'admin' => I18N::translate('Manager'));
// Form actions
switch (Filter::post('action')) {
    case 'save':
        if (Filter::checkCsrf()) {
            $user_id = Filter::postInteger('user_id');
            $user = User::find($user_id);
            $username = Filter::post('username');
            $real_name = Filter::post('real_name');
            $email = Filter::postEmail('email');
            $pass1 = Filter::post('pass1', WT_REGEX_PASSWORD);
            $pass2 = Filter::post('pass2', WT_REGEX_PASSWORD);
            $theme = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), '');
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_users.php


示例9: header

// Check access.  (1) the block must exist and be enabled, (2) gedcom blocks require
// managers, (3) user blocks require the user or an admin
$blocks = Module::getActiveBlocks($WT_TREE);
if (!$block || !array_key_exists($block->module_name, $blocks) || $block->gedcom_id && !Auth::isManager(Tree::findById($block->gedcom_id)) || $block->user_id && $block->user_id != Auth::id() && !Auth::isAdmin()) {
    header('Location: ' . WT_BASE_URL);
    return;
}
$block = $blocks[$block->module_name];
if (Filter::post('save')) {
    $ctype = Filter::post('ctype', 'user', 'gedcom');
    header('Location: ' . WT_BASE_URL . 'index.php?ctype=' . $ctype . '&ged=' . $WT_TREE->getNameUrl());
    $block->configureBlock($block_id);
    return;
}
$ctype = FIlter::get('ctype', 'user', 'gedcom');
$controller = new PageController();
$controller->setPageTitle(I18N::translate('Configure') . ' — ' . $block->getTitle())->pageHeader();
if (Module::getModuleByName('ckeditor')) {
    CkeditorModule::enableEditor($controller);
}
?>
<h2><?php 
echo $controller->getPageTitle();
?>
</h2>

<form name="block" method="post" action="?block_id=<?php 
echo $block_id;
?>
">
	<input type="hidden" name="save" value="1">
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:block_edit.php


示例10: PageController

 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_site_info.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isAdmin())->setPageTitle(I18N::translate('Server information'))->pageHeader();
$variables = Database::prepare("SHOW VARIABLES")->fetchAssoc();
array_walk($variables, function (&$x) {
    $x = str_replace(',', ', ', $x);
});
ob_start();
phpinfo(INFO_ALL & ~INFO_CREDITS & ~INFO_LICENSE);
preg_match('%<body>(.*)</body>%s', ob_get_clean(), $matches);
$html = $matches[1];
?>

<ol class="breadcrumb small">
	<li><a href="admin.php"><?php 
echo I18N::translate('Control panel');
?>
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:admin_site_info.php


示例11: PageController

 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree   $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
use Fisharebest\Webtrees\Query\QueryName;
define('WT_SCRIPT_NAME', 'indilist.php');
require './includes/session.php';
$controller = new PageController();
// We show three different lists: initials, surnames and individuals
// Note that the data may contain special chars, such as surname="<unknown>",
$alpha = Filter::get('alpha');
// All surnames beginning with this letter where "@"=unknown and ","=none
$surname = Filter::get('surname');
// All indis with this surname
$show_all = Filter::get('show_all', 'no|yes', 'no');
// All indis
// Long lists can be broken down by given name
$show_all_firstnames = Filter::get('show_all_firstnames', 'no|yes', 'no');
if ($show_all_firstnames === 'yes') {
    $falpha = '';
} else {
    $falpha = Filter::get('falpha');
    // All first names beginning with this letter
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:indilist.php


示例12: PageController

 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use PDO;
/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
define('WT_SCRIPT_NAME', 'admin_site_change.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Changes'));
$earliest = Database::prepare("SELECT DATE(MIN(change_time)) FROM `##change`")->execute(array())->fetchOne();
$latest = Database::prepare("SELECT DATE(MAX(change_time)) FROM `##change`")->execute(array())->fetchOne();
// Filtering
$action = Filter::get('action');
$from = Filter::get('from', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $earliest);
$to = Filter::get('to', '\\d\\d\\d\\d-\\d\\d-\\d\\d', $latest);
$type = Filter::get('type', 'accepted|rejected|pending');
$oldged = Filter::get('oldged');
$newged = Filter::get('newged');
$xref = Filter::get('xref', WT_REGEX_XREF);
$user = Filter::get('user');
$search = Filter::get('search');
$search = isset($search['value']) ? $search['value'] : null;
$statuses = array('' => '', 'accepted' => I18N::translate('accepted'), 'rejected' => I18N::translate('rejected'), 'pending' => I18N::translate('pending'));
开发者ID:tunandras,项目名称:webtrees,代码行数:31,代码来源:admin_site_change.php


示例13: PageController

 * 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_trees_manage.php');
require './includes/session.php';
$controller = new PageController();
$controller->addExternalJavascript(WT_ADMIN_JS_URL)->restrictAccess(Auth::isAdmin() || Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Manage family trees'));
// Show a reduced page when there are more than a certain number of trees
$multiple_tree_threshold = Site::getPreference('MULTIPLE_TREE_THRESHOLD') ?: 500;
// Note that glob() returns false instead of an empty array when open_basedir_restriction
// is in force and no files are found.  See PHP bug #47358.
if (defined('GLOB_BRACE')) {
    $gedcom_files = glob(WT_DATA_DIR . '*.{ged,Ged,GED}', GLOB_NOSORT | GLOB_BRACE) ?: array();
} else {
    $gedcom_files = array_merge(glob(WT_DATA_DIR . '*.ged', GLOB_NOSORT) ?: array(), glob(WT_DATA_DIR . '*.Ged', GLOB_NOSORT) ?: array(), glob(WT_DATA_DIR . '*.GED', GLOB_NOSORT) ?: array());
}
// Process POST actions
switch (Filter::post('action')) {
    case 'delete':
        $gedcom_id = Filter::postInteger('gedcom_id');
        if (Filter::checkCsrf() && $gedcom_id) {
开发者ID:AlexSnet,项目名称:webtrees,代码行数:31,代码来源:admin_trees_manage.php


示例14: adminPlaces

    /**
     * Places administration.
     */
    private function adminPlaces()
    {
        global $WT_TREE;
        $action = Filter::get('action');
        $parent = Filter::get('parent');
        $inactive = Filter::getBool('inactive');
        $deleteRecord = Filter::get('deleteRecord');
        if (!isset($parent)) {
            $parent = 0;
        }
        $controller = new PageController();
        $controller->restrictAccess(Auth::isAdmin());
        if ($action == 'ExportFile' && Auth::isAdmin()) {
            $tmp = $this->placeIdToHierarchy($parent);
            $maxLevel = $this->getHighestLevel();
            if ($maxLevel > 8) {
                $maxLevel = 8;
            }
            $tmp[0] = 'places';
            $outputFileName = preg_replace('/[:;\\/\\\\(\\)\\{\\}\\[\\] $]/', '_', implode('-', $tmp)) . '.csv';
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename="' . $outputFileName . '"');
            echo '"', I18N::translate('Level'), '";"', I18N::translate('Country'), '";';
            if ($maxLevel > 0) {
                echo '"', I18N::translate('State'), '";';
            }
            if ($maxLevel > 1) {
                echo '"', I18N::translate('County'), '";';
            }
            if ($maxLevel > 2) {
                echo '"', I18N::translate('City'), '";';
            }
            if ($maxLevel > 3) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 4) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 5) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 6) {
                echo '"', I18N::translate('Place'), '";';
            }
            if ($maxLevel > 7) {
                echo '"', I18N::translate('Place'), '";';
            }
            echo '"', I18N::translate('Longitude'), '";"', I18N::translate('Latitude'), '";';
            echo '"', I18N::translate('Zoom level'), '";"', I18N::translate('Icon'), '";', WT_EOL;
            $this->outputLevel($parent);
            exit;
        }
        $controller->setPageTitle(I18N::translate('Google Maps™'))->pageHeader();
        ?>
		<ol class="breadcrumb small">
			<li><a href="admin.php"><?php 
        echo I18N::translate('Control panel');
        ?>
</a></li>
			<li><a href="admin_modules.php"><?php 
        echo I18N::translate('Module administration');
        ?>
</a></li>
			<li class="active"><?php 
        echo $controller->getPageTitle();
        ?>
</li>
		</ol>

		<ul class="nav nav-tabs nav-justified" role="tablist">
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_config" role="tab">
					<?php 
        echo I18N::translate('Google Maps™ preferences');
        ?>
				</a>
			</li>
			<li role="presentation" class="active">
				<a href="#">
					<?php 
        echo I18N::translate('Geographic data');
        ?>
				</a>
			</li>
			<li role="presentation">
				<a href="?mod=googlemap&amp;mod_action=admin_placecheck">
					<?php 
        echo I18N::translate('Place check');
        ?>
				</a>
			</li>
		</ul>

		<h2><?php 
        echo I18N::translate('Geographic data');
        ?>
</h2>
//.........这里部分代码省略.........
开发者ID:bxbroze,项目名称:webtrees,代码行数:101,代码来源:GoogleMapsModule.php


示例15: missing

 /**
  * SosaList@missing
  */
 public function missing()
 {
     global $WT_TREE;
     $controller = new PageController();
     $controller->setPageTitle(I18N::translate('Missing Ancestors'));
     $this->view_bag->set('title', $controller->getPageTitle());
     if ($this->view_bag->get('is_setup', false)) {
         $this->view_bag->set('url_module', $this->module->getName());
         $this->view_bag->set('url_action', 'SosaList@missing');
         $this->view_bag->set('url_ged', $WT_TREE->getNameUrl());
         $this->view_bag->set('min_gen', 2);
         $missing_list = $this->sosa_provider->getMissingSosaListAtGeneration($this->generation);
         $this->view_bag->set('has_missing', $this->generation > 0 && count($missing_list) > 0);
         $perc_sosa = Functions::safeDivision($this->sosa_provider->getSosaCountAtGeneration($this->generation), pow(2, $this->generation - 1));
         $this->view_bag->set('perc_sosa', $perc_sosa);
         if ($this->view_bag->get('has_missing', false)) {
             $table_id = 'table-sosa-missing-' . Uuid::uuid4();
             $this->view_bag->set('table_id', $table_id);
             $controller->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addInlineJavascript('
 				/* Initialise datatables */
 				jQuery.fn.dataTableExt.oSort["unicode-asc"  ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
 				jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
 				jQuery.fn.dataTableExt.oSort["num-html-asc" ]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a<b) ? -1 : (a>b ? 1 : 0);};
 				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
                 
 				jQuery("#' . $table_id . '").dataTable( {
                     dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
 					' . I18N::datatablesI18N() . ',
 					jQueryUI: true,
 					autoWidth:false,
 					processing: true,
 					retrieve: true,
 					columns: [
 						/* 0-Sosa */  		{ type: "num", class: "center" },
 		                /* 1-ID */ 			{ class: "center" },
 		                /* 2-givn */ 		{ dataSort: 4,  class: "left"},
 						/* 3-surn */ 		{ dataSort: 5},
 						/* 4-GIVN,SURN */ 	{ type: "unicode", visible: false},
 						/* 5-SURN,GIVN */ 	{ type: "unicode", visible: false},
 		                /* PERSO Modify table to include IsSourced module */
 		                /* 6-INDI_SOUR */	{ dataSort : 7, class: "center", visible: ' . (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME) ? 'true' : 'false') . ' },
 	                	/* 7-SORT_INDISC */	{ visible : false},
 		                /* 8-Father */		{ class: "center"},
 		                /* 9-Mother */		{ class: "center"},
 		                /* 10-Birth */		{ dataSort : 11 , class: "center"},
 		                /* 11-SORT_BIRT */	{ visible : false},
 		                /* 12-BIRT_PLAC */	{ type: "unicode", class: "center"},
 		                /* 13-BIRT_SOUR */	{ dataSort : 14, class: "center", visible: ' . (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME) ? 'true' : 'false') . ' },
 	                	/* 14-SORT_BIRTSC */{ visible : false},
 		                /* 15-SEX */		{ visible : false}
 		                /* END PERSO */
 					],
 		            sorting: [[0,"asc"]],
 					displayLength: 20,
 					pagingType: "full_numbers"
 			   });
 			
 				jQuery("#' . $table_id . '")
 				/* Filter buttons in table header */
 				.on("click", "button[data-filter-column]", function() {
 					var btn = jQuery(this);
 					// De-activate the other buttons in this button group
 					btn.siblings().removeClass("ui-state-active");
 					// Apply (or clear) this filter
 					var col = jQuery("#' . $table_id . '").DataTable().column(btn.data("filter-column"));
 					if (btn.hasClass("ui-state-active")) {
 						btn.removeClass("ui-state-active");
 						col.search("").draw();
 					} else {
 						btn.addClass("ui-state-active");
 						col.search(btn.data("filter-value")).draw();
 					}
 				});
                 
 				jQuery(".smissing-list").css("visibility", "visible");
 				jQuery(".loading-image").css("display", "none");
 			');
             $unique_indis = array();
             $sum_missing_different = 0;
             $sum_missing_different_without_hidden = 0;
             foreach ($missing_list as $num => $missing_tab) {
                 if (isset($unique_indis[$missing_tab['indi']])) {
                     unset($missing_list[$num]);
                     continue;
                 }
                 $sum_missing_different += !$missing_tab['has_father'] + !$missing_tab['has_mother'];
                 $person = Individual::getInstance($missing_tab['indi'], $WT_TREE);
                 if (!$person || !$person->canShowName()) {
                     unset($missing_list[$num]);
                     continue;
                 }
                 $sum_missing_different_without_hidden += !$missing_tab['has_father'] + !$missing_tab['has_mother'];
                 $unique_indis[$person->getXref()] = true;
                 $missing_tab['indi'] = $person;
                 $missing_list[$num] = $missing_tab;
             }
             $this->view_bag->set('missing_list', $missing_list);
//.........这里部分代码省略.........
开发者ID:jon48,项目名称:webtrees-lib,代码行数:101,代码来源:SosaListController.php


示例16: checkform

            break;
        case 'delete':
            // An administrator can only be deleted by another administrator
            if (!Auth::user()->getPreference('canadmin')) {
                // Keep a reference to the currently logged in user because after logging out this user,
                // a call to Auth::user() will not return this user anymore
                $currentUser = Auth::user();
                Auth::logout();
                $currentUser->delete();
            }
            break;
    }
    header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
    return;
}
$controller = new PageController();
$controller->setPageTitle(I18N::translate('My account'))->pageHeader()->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)->addInlineJavascript('autocomplete();');
$my_individual_record = Individual::getInstance($WT_TREE->getUserPreference(Auth::user(), 'gedcomid'), $WT_TREE);
$default_individual = Individual::getInstance($WT_TREE->getUserPreference(Auth::user(), 'rootid'), $WT_TREE);
// Form validation
?>
<script>
function checkform(frm) {
	if (frm.form_username.value=="") {
		alert("<?php 
echo I18N::translate('You must enter a user name.');
?>
");
		frm.form_username.focus();
		return false;
	}
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:31,代码来源:edituser.php


示例17: PageController

 * 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, see <http://www.gnu.org/licenses/>.
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\PageController;
define('WT_SCRIPT_NAME', 'admin_trees_renumber.php');
require './includes/session.php';
$controller = new PageController();
$controller->restrictAccess(Auth::isManager($WT_TREE))->setPageTitle(I18N::translate('Renumber family tree') . ' — ' . $WT_TREE->getTitleHtml())->pageHeader();
// Every XREF used by this tree and also used by some other tree
$xrefs = Database::prepare("SELECT xref, type FROM (" . " SELECT i_id AS xref, 'INDI' AS type FROM `##individuals` WHERE i_file = ?" . "  UNION " . " SELECT f_id AS xref, 'FAM' AS type FROM `##families` WHERE f_file = ?" . "  UNION " . " SELECT s_id AS xref, 'SOUR' AS type FROM `##sources` WHERE s_file = ?" . "  UNION " . " SELECT m_id AS xref, 'OBJE' AS type FROM `##media` WHERE m_file = ?" . "  UNION " . " SELECT o_id AS xref, o_type AS type FROM `##other` WHERE o_file = ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS this_tree JOIN (" . " SELECT xref FROM `##change` WHERE gedcom_id <> ?" . "  UNION " . " SELECT i_id AS xref FROM `##individuals` WHERE i_file <> ?" . "  UNION " . " SELECT f_id AS xref FROM `##families` WHERE f_file <> ?" . "  UNION " . " SELECT s_id AS xref FROM `##sources` WHERE s_file <> ?" . "  UNION " . " SELECT m_id AS xref FROM `##media` WHERE m_file <> ?" . "  UNION " . " SELECT o_id AS xref FROM `##other` WHERE o_file <> ? AND o_type NOT IN ('HEAD', 'TRLR')" . ") AS other_trees USING (xref)")->execute(array($WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId(), $WT_TREE->getTreeId()))->fetchAssoc();
echo '<h1>', $controller->getPageTitle(), '</h1>';
if (Filter::get('action') === 'renumber') {
    foreach ($xrefs as $old_xref => $type) {
        Database::beginTransaction();
        Database::exec("LOCK TABLE `##individuals` WRITE," . " `##families` WRITE," . " `##sources` WRITE," . " `##media` WRITE," . " `##other` WRITE," . " `##name` WRITE," . " `##placelinks` WRITE," . " `##change` WRITE," . " `##next_id` WRITE," . " `##dates` WRITE," . " `##default_resn` WRITE," . " `##hit_counter` WRITE," . " `##link` WRITE," . " `##user_gedcom_setting` WRITE");
        $new_xref = $WT_TREE->getNewXref($type);
        switch ($type) {
            case 'INDI':
                Database::prepare("UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?")->execute(array($new_xref, "0 @{$old_xref}@ INDI\n", "0 @{$new_xref}@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " HUSB @{$old_xref}@", " HUSB @{$new_xref}@", $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " WIFE @{$old_xref}@", " WIFE @{$new_xref}@", $WT_TREE->getTreeId()));
                Database::prepare("UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?")->execute(array($old_xref, " CHIL @{$old_xref}@", " CHIL @{$new_xref}@", $WT_TREE->getTreeId()));
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_trees_renumber.php


示例18: PageController

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Functions\Functions类代码示例发布时间:2022-05-23
下一篇:
PHP Webtrees\Tree类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap