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

PHP Webtrees\Site类代码示例

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

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



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

示例1: upgrade

 /**
  * Upgrade to to the next version
  */
 public function upgrade()
 {
     $index_dir = Site::getPreference('INDEX_DIRECTORY');
     // Due to the language code changes in 1.7.0, we need to update some other settings
     foreach ($this->languages as $old => $new) {
         try {
             Database::prepare("UPDATE `##site_setting` SET setting_name = REPLACE(setting_name, :old, :new) " . "WHERE setting_name LIKE 'WELCOME_TEXT_AUTH_MODE_%'")->execute(array('old' => $old, 'new' => $new));
         } catch (PDOException $ex) {
             // Duplicate key? Already done?
         }
         Database::prepare("UPDATE `##block_setting` SET setting_value = REPLACE(setting_value, :old, :new) " . "WHERE setting_name = 'languages'")->execute(array('old' => $old, 'new' => $new));
         // Historical fact files
         if (file_exists($index_dir . 'histo.' . $old . '.php') && !file_exists($index_dir . 'histo.' . $new . '.php')) {
             rename($index_dir . 'histo.' . $old . '.php', $index_dir . 'histo.' . $new . '.php');
         }
         // Language files
         if (file_exists($index_dir . 'language/' . $old . '.php') && !file_exists($index_dir . 'language/' . $new . '.php')) {
             rename($index_dir . 'language/' . $old . '.php', $index_dir . 'language/' . $new . '.php');
         }
         if (file_exists($index_dir . 'language/' . $old . '.csv') && !file_exists($index_dir . 'language/' . $new . '.csv')) {
             rename($index_dir . 'language/' . $old . '.csv', $index_dir . 'language/' . $new . '.csv');
         }
         if (file_exists($index_dir . 'language/' . $old . '.mo') && !file_exists($index_dir . 'language/' . $new . '.mo')) {
             rename($index_dir . 'language/' . $old . '.mo', $index_dir . 'language/' . $new . '.mo');
         }
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:30,代码来源:Migration31.php


示例2: cookieWarning

 /** {@inheritdoc} */
 public function cookieWarning()
 {
     if (empty($_SERVER['HTTP_DNT']) && empty($_COOKIE['cookie']) && (Site::getPreference('GOOGLE_ANALYTICS_ID') || Site::getPreference('PIWIK_SITE_ID') || Site::getPreference('STATCOUNTER_PROJECT_ID'))) {
         $cookie_warning = '<div class="cookie-warning">' . I18N::translate('Cookies') . ' - ' . I18N::translate('This website uses cookies to learn about visitor behaviour.') . '</div>';
         return $this->htmlAlert($cookie_warning, 'info', true);
     } else {
         return '';
     }
 }
开发者ID:bxbroze,项目名称:justlight,代码行数:10,代码来源:theme.php


示例3: upgrade

 /**
  * Upgrade to to the next version
  */
 public function upgrade()
 {
     Database::exec("CREATE TABLE IF NOT EXISTS `##gedcom` (" . " gedcom_id     INTEGER AUTO_INCREMENT NOT NULL," . " gedcom_name   VARCHAR(255)           NOT NULL," . " sort_order    INTEGER                NOT NULL DEFAULT 0," . " PRIMARY KEY                (gedcom_id)," . " UNIQUE  KEY `##gedcom_ix1` (gedcom_name)," . "         KEY `##gedcom_ix2` (sort_order)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##site_setting` (" . " setting_name  VARCHAR(32)  NOT NULL," . " setting_value VARCHAR(255) NOT NULL," . " PRIMARY KEY (setting_name)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##gedcom_setting` (" . " gedcom_id     INTEGER      NOT NULL," . " setting_name  VARCHAR(32)  NOT NULL," . " setting_value VARCHAR(255) NOT NULL," . " PRIMARY KEY                        (gedcom_id, setting_name)," . " FOREIGN KEY `##gedcom_setting_fk1` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##user` (" . " user_id   INTEGER AUTO_INCREMENT NOT NULL," . " user_name VARCHAR(32)            NOT NULL," . " real_name VARCHAR(64)            NOT NULL," . " email     VARCHAR(64)            NOT NULL," . " password  VARCHAR(128)           NOT NULL," . " PRIMARY KEY              (user_id)," . " UNIQUE  KEY `##user_ix1` (user_name)," . " UNIQUE  KEY `##user_ix2` (email)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##user_setting` (" . " user_id       INTEGER      NOT NULL," . " setting_name  VARCHAR(32)  NOT NULL," . " setting_value VARCHAR(255) NOT NULL," . " PRIMARY KEY                      (user_id, setting_name)," . " FOREIGN KEY `##user_setting_fk1` (user_id) REFERENCES `##user` (user_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##user_gedcom_setting` (" . " user_id       INTEGER      NOT NULL," . " gedcom_id     INTEGER      NOT NULL," . " setting_name  VARCHAR(32)  NOT NULL," . " setting_value VARCHAR(255) NOT NULL," . " PRIMARY KEY                             (user_id, gedcom_id, setting_name)," . " FOREIGN KEY `##user_gedcom_setting_fk1` (user_id)   REFERENCES `##user` (user_id) /* ON DELETE CASCADE */," . " FOREIGN KEY `##user_gedcom_setting_fk2` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##log` (" . " log_id      INTEGER AUTO_INCREMENT NOT NULL," . " log_time    TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP," . " log_type    ENUM('auth', 'config', 'debug', 'edit', 'error', 'media', 'search') NOT NULL," . " log_message TEXT         NOT NULL," . " ip_address  VARCHAR(40)  NOT NULL," . " user_id     INTEGER          NULL," . " gedcom_id   INTEGER          NULL," . " PRIMARY KEY             (log_id)," . "         KEY `##log_ix1` (log_time)," . "         KEY `##log_ix2` (log_type)," . "         KEY `##log_ix3` (ip_address)," . " FOREIGN KEY `##log_fk1` (user_id)   REFERENCES `##user`(user_id) /* ON DELETE SET NULL */," . " FOREIGN KEY `##log_fk2` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE SET NULL */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##change` (" . " change_id      INTEGER AUTO_INCREMENT                  NOT NULL," . " change_time    TIMESTAMP                               NOT NULL DEFAULT CURRENT_TIMESTAMP," . " status         ENUM('accepted', 'pending', 'rejected') NOT NULL DEFAULT 'pending'," . " gedcom_id      INTEGER                                 NOT NULL," . " xref           VARCHAR(20)                             NOT NULL," . " old_gedcom     MEDIUMTEXT                              NOT NULL," . " new_gedcom     MEDIUMTEXT                              NOT NULL," . " user_id        INTEGER                                 NOT NULL," . " PRIMARY KEY                (change_id)," . "         KEY `##change_ix1` (gedcom_id, status, xref)," . " FOREIGN KEY `##change_fk1` (user_id)   REFERENCES `##user` (user_id) /* ON DELETE RESTRICT */," . " FOREIGN KEY `##change_fk2` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##message` (" . " message_id INTEGER AUTO_INCREMENT NOT NULL," . " sender     VARCHAR(64)            NOT NULL," . " ip_address VARCHAR(40)            NOT NULL," . " user_id    INTEGER                NOT NULL," . " subject    VARCHAR(255)           NOT NULL," . " body       TEXT                   NOT NULL," . " created    TIMESTAMP              NOT NULL DEFAULT CURRENT_TIMESTAMP," . " PRIMARY KEY                 (message_id)," . " FOREIGN KEY `##message_fk1` (user_id)   REFERENCES `##user` (user_id) /* ON DELETE RESTRICT */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##default_resn` (" . " default_resn_id INTEGER AUTO_INCREMENT                             NOT NULL," . " gedcom_id       INTEGER                                            NOT NULL," . " xref            VARCHAR(20)                                            NULL," . " tag_type        VARCHAR(15)                                            NULL," . " resn            ENUM ('none', 'privacy', 'confidential', 'hidden') NOT NULL," . " comment         VARCHAR(255)                                           NULL," . " updated         TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP," . " PRIMARY KEY                      (default_resn_id)," . " UNIQUE  KEY `##default_resn_ix1` (gedcom_id, xref, tag_type)," . " FOREIGN KEY `##default_resn_fk1` (gedcom_id)  REFERENCES `##gedcom` (gedcom_id)" . ") ENGINE=InnoDB COLLATE=utf8_unicode_ci");
     Database::exec("CREATE TABLE IF NOT EXISTS `##individuals` (" . " i_id     VARCHAR(20)         NOT NULL," . " i_file   INTEGER             NOT NULL," . " i_rin    VARCHAR(20)         NOT NULL," . " i_sex    ENUM('U', 'M', 'F') NOT NULL," . " i_gedcom MEDIUMTEXT          NOT NULL," . " PRIMARY KEY                     (i_id, i_file)," . " UNIQUE  KEY `##individuals_ix1` (i_file, i_id)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##families` (" . " f_id      VARCHAR(20)  NOT NULL," . " f_file    INTEGER      NOT NULL," . " f_husb    VARCHAR(20)      NULL," . " f_wife    VARCHAR(20)      NULL," . " f_gedcom  MEDIUMTEXT   NOT NULL," . " f_numchil INTEGER      NOT NULL," . " PRIMARY KEY                  (f_id, f_file)," . " UNIQUE  KEY `##families_ix1` (f_file, f_id)," . "         KEY `##families_ix2` (f_husb)," . "         KEY `##families_ix3` (f_wife)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##places` (" . " p_id          INTEGER AUTO_INCREMENT NOT NULL," . " p_place       VARCHAR(150)               NULL," . " p_parent_id   INTEGER                    NULL," . " p_file        INTEGER               NOT  NULL," . " p_std_soundex TEXT                       NULL," . " p_dm_soundex  TEXT                       NULL," . " PRIMARY KEY                (p_id)," . "         KEY `##places_ix1` (p_file, p_place)," . " UNIQUE  KEY `##places_ix2` (p_parent_id, p_file, p_place)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##placelinks` (" . " pl_p_id INTEGER NOT NULL," . " pl_gid  VARCHAR(20)  NOT NULL," . " pl_file INTEGER  NOT NULL," . " PRIMARY KEY                    (pl_p_id, pl_gid, pl_file)," . "         KEY `##placelinks_ix1` (pl_p_id)," . "         KEY `##placelinks_ix2` (pl_gid)," . "         KEY `##placelinks_ix3` (pl_file)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##dates` (" . " d_day        TINYINT     NOT NULL," . " d_month      CHAR(5)         NULL," . " d_mon        TINYINT     NOT NULL," . " d_year       SMALLINT    NOT NULL," . " d_julianday1 MEDIUMINT   NOT NULL," . " d_julianday2 MEDIUMINT   NOT NULL," . " d_fact       VARCHAR(15) NOT NULL," . " d_gid        VARCHAR(20) NOT NULL," . " d_file       INTEGER     NOT NULL," . " d_type       ENUM ('@#DGREGORIAN@', '@#DJULIAN@', '@#DHEBREW@', '@#DFRENCH R@', '@#DHIJRI@', '@#DROMAN@', '@#DJALALI@') NOT NULL," . " KEY `##dates_ix1` (d_day)," . " KEY `##dates_ix2` (d_month)," . " KEY `##dates_ix3` (d_mon)," . " KEY `##dates_ix4` (d_year)," . " KEY `##dates_ix5` (d_julianday1)," . " KEY `##dates_ix6` (d_julianday2)," . " KEY `##dates_ix7` (d_gid)," . " KEY `##dates_ix8` (d_file)," . " KEY `##dates_ix9` (d_type)," . " KEY `##dates_ix10` (d_fact, d_gid)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##media` (" . " m_id       VARCHAR(20)            NOT NULL," . " m_ext      VARCHAR(6)                 NULL," . " m_type     VARCHAR(20)                NULL," . " m_titl     VARCHAR(255)               NULL," . " m_filename VARCHAR(512)               NULL," . " m_file     INTEGER                NOT NULL," . " m_gedcom   MEDIUMTEXT                 NULL," . " PRIMARY KEY               (m_file, m_id)," . " UNIQUE  KEY `##media_ix1` (m_id, m_file)," . "         KEY `##media_ix2` (m_ext, m_type)," . "         KEY `##media_ix3` (m_titl)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##next_id` (" . " gedcom_id   INTEGER     NOT NULL," . " record_type VARCHAR(15) NOT NULL," . " next_id     DECIMAL(20) NOT NULL," . " PRIMARY KEY                 (gedcom_id, record_type)," . " FOREIGN KEY `##next_id_fk1` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##other` (" . " o_id     VARCHAR(20) NOT NULL," . " o_file   INTEGER     NOT NULL," . " o_type   VARCHAR(15) NOT NULL," . " o_gedcom MEDIUMTEXT      NULL," . " PRIMARY KEY               (o_id, o_file)," . " UNIQUE  KEY `##other_ix1` (o_file, o_id)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##sources` (" . " s_id     VARCHAR(20)    NOT NULL," . " s_file   INTEGER        NOT NULL," . " s_name   VARCHAR(255)   NOT NULL," . " s_gedcom MEDIUMTEXT     NOT NULL," . " PRIMARY KEY                 (s_id, s_file)," . " UNIQUE  KEY `##sources_ix1` (s_file, s_id)," . "         KEY `##sources_ix2` (s_name)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##link` (" . " l_file    INTEGER     NOT NULL," . " l_from    VARCHAR(20) NOT NULL," . " l_type    VARCHAR(15) NOT NULL," . " l_to      VARCHAR(20) NOT NULL," . " PRIMARY KEY              (l_from, l_file, l_type, l_to)," . " UNIQUE  KEY `##link_ix1` (l_to, l_file, l_type, l_from)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##name` (" . " n_file             INTEGER      NOT NULL," . " n_id               VARCHAR(20)  NOT NULL," . " n_num              INTEGER      NOT NULL," . " n_type             VARCHAR(15)  NOT NULL," . " n_sort             VARCHAR(255) NOT NULL," . " n_full             VARCHAR(255) NOT NULL," . " n_surname          VARCHAR(255)     NULL," . " n_surn             VARCHAR(255)     NULL," . " n_givn             VARCHAR(255)     NULL," . " n_soundex_givn_std VARCHAR(255)     NULL," . " n_soundex_surn_std VARCHAR(255)     NULL," . " n_soundex_givn_dm  VARCHAR(255)     NULL," . " n_soundex_surn_dm  VARCHAR(255)     NULL," . " PRIMARY KEY              (n_id, n_file, n_num)," . "         KEY `##name_ix1` (n_full, n_id, n_file)," . "         KEY `##name_ix2` (n_surn, n_file, n_type, n_id)," . "         KEY `##name_ix3` (n_givn, n_file, n_type, n_id)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##module` (" . " module_name   VARCHAR(32)                 NOT NULL," . " status        ENUM('enabled', 'disabled') NOT NULL DEFAULT 'enabled'," . " tab_order     INTEGER                         NULL, " . " menu_order    INTEGER                         NULL, " . " sidebar_order INTEGER                         NULL," . " PRIMARY KEY (module_name)" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##module_setting` (" . " module_name   VARCHAR(32) NOT NULL," . " setting_name  VARCHAR(32) NOT NULL," . " setting_value MEDIUMTEXT  NOT NULL," . " PRIMARY KEY                        (module_name, setting_name)," . " FOREIGN KEY `##module_setting_fk1` (module_name) REFERENCES `##module` (module_name) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##module_privacy` (" . " module_name   VARCHAR(32) NOT NULL," . " gedcom_id     INTEGER     NOT NULL," . " component     ENUM('block', 'chart', 'menu', 'report', 'sidebar', 'tab', 'theme') NOT NULL," . " access_level  TINYINT     NOT NULL," . " PRIMARY KEY                        (module_name, gedcom_id, component)," . " FOREIGN KEY `##module_privacy_fk1` (module_name) REFERENCES `##module` (module_name) /* ON DELETE CASCADE */," . " FOREIGN KEY `##module_privacy_fk2` (gedcom_id)   REFERENCES `##gedcom` (gedcom_id)   /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##block` (" . " block_id    INTEGER AUTO_INCREMENT NOT NULL," . " gedcom_id   INTEGER                    NULL," . " user_id     INTEGER                    NULL," . " xref        VARCHAR(20)                NULL," . " location    ENUM('main', 'side')       NULL," . " block_order INTEGER                NOT NULL," . " module_name VARCHAR(32)            NOT NULL," . " PRIMARY KEY               (block_id)," . " FOREIGN KEY `##block_fk1` (gedcom_id)   REFERENCES `##gedcom` (gedcom_id),  /* ON DELETE CASCADE */" . " FOREIGN KEY `##block_fk2` (user_id)     REFERENCES `##user`   (user_id),    /* ON DELETE CASCADE */" . " FOREIGN KEY `##block_fk3` (module_name) REFERENCES `##module` (module_name) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##block_setting` (" . " block_id      INTEGER     NOT NULL," . " setting_name  VARCHAR(32) NOT NULL," . " setting_value TEXT        NOT NULL," . " PRIMARY KEY                       (block_id, setting_name)," . " FOREIGN KEY `##block_setting_fk1` (block_id) REFERENCES `##block` (block_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     Database::exec("CREATE TABLE IF NOT EXISTS `##hit_counter` (" . " gedcom_id      INTEGER     NOT NULL," . " page_name      VARCHAR(32) NOT NULL," . " page_parameter VARCHAR(32) NOT NULL," . " page_count     INTEGER     NOT NULL," . " PRIMARY KEY                     (gedcom_id, page_name, page_parameter)," . " FOREIGN KEY `##hit_counter_fk1` (gedcom_id) REFERENCES `##gedcom` (gedcom_id) /* ON DELETE CASCADE */" . ") COLLATE utf8_unicode_ci ENGINE=InnoDB");
     // Set the default site preferences
     Site::setPreference('INDEX_DIRECTORY', 'data/');
     Site::setPreference('USE_REGISTRATION_MODULE', '1');
     Site::setPreference('ALLOW_USER_THEMES', '1');
     Site::setPreference('ALLOW_CHANGE_GEDCOM', '1');
     Site::setPreference('SESSION_TIME', '7200');
     Site::setPreference('SMTP_ACTIVE', 'internal');
     Site::setPreference('SMTP_HOST', 'localhost');
     Site::setPreference('SMTP_PORT', '25');
     Site::setPreference('SMTP_AUTH', '1');
     Site::setPreference('SMTP_AUTH_USER', '');
     Site::setPreference('SMTP_AUTH_PASS', '');
     Site::setPreference('SMTP_SSL', 'none');
     Site::setPreference('SMTP_HELO', $_SERVER['SERVER_NAME']);
     Site::setPreference('SMTP_FROM_NAME', $_SERVER['SERVER_NAME']);
     // Search for all installed modules, and enable them.
     Module::getInstalledModules('enabled');
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:50,代码来源:Migration0.php


示例4: fetchLatestVersion

 /**
  * Check with the webtrees.net server for the latest version of webtrees.
  * Fetching the remote file can be slow, so check infrequently, and cache the result.
  * Pass the current versions of webtrees, PHP and MySQL, as the response
  * may be different for each.  The server logs are used to generate
  * installation statistics which can be found at http://svn.webtrees.net/statistics.html
  *
  * @return null|string
  */
 public static function fetchLatestVersion()
 {
     $last_update_timestamp = Site::getPreference('LATEST_WT_VERSION_TIMESTAMP');
     if ($last_update_timestamp < WT_TIMESTAMP - 24 * 60 * 60) {
         $row = Database::prepare("SHOW VARIABLES LIKE 'version'")->fetchOneRow();
         $params = '?w=' . WT_VERSION . '&p=' . PHP_VERSION . '&m=' . $row->value . '&o=' . (DIRECTORY_SEPARATOR === '/' ? 'u' : 'w');
         $latest_version_txt = File::fetchUrl('http://dev.webtrees.net/build/latest-version.txt' . $params);
         if ($latest_version_txt) {
             Site::setPreference('LATEST_WT_VERSION', $latest_version_txt);
             Site::setPreference('LATEST_WT_VERSION_TIMESTAMP', WT_TIMESTAMP);
             return $latest_version_txt;
         } else {
             // Cannot connect to server - use cached version (if we have one)
             return Site::getPreference('LATEST_WT_VERSION');
         }
     } else {
         return Site::getPreference('LATEST_WT_VERSION');
     }
 }
开发者ID:jflash,项目名称:webtrees,代码行数:28,代码来源:Functions.php


示例5: activeLocales

 /**
  * The prefered locales for this site, or a default list if no preference.
  *
  * @return LocaleInterface[]
  */
 public static function activeLocales()
 {
     $code_list = Site::getPreference('LANGUAGES');
     if ($code_list) {
         $codes = explode(',', $code_list);
     } else {
         $codes = array('ar', 'bg', 'bs', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'et', 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it', 'ka', 'lt', 'mr', 'nb', 'nl', 'nn', 'pl', 'pt', 'ru', 'sk', 'sv', 'tr', 'uk', 'vi', 'zh-Hans');
     }
     $locales = array();
     foreach ($codes as $code) {
         if (file_exists(WT_ROOT . 'language/' . $code . '.mo')) {
             try {
                 $locales[] = Locale::create($code);
             } catch (\Exception $ex) {
                 // No such locale exists?
             }
         }
     }
     usort($locales, '\\Fisharebest\\Localization\\Locale::compare');
     return $locales;
 }
开发者ID:bxbroze,项目名称:webtrees,代码行数:26,代码来源:I18N.php


示例6: getBlock

 /**
  * Generate the HTML content of this block.
  *
  * @param int      $block_id
  * @param bool     $template
  * @param string[] $cfg
  *
  * @return string
  */
 public function getBlock($block_id, $template = true, $cfg = array())
 {
     global $controller, $WT_TREE;
     $indi_xref = $controller->getSignificantIndividual()->getXref();
     $id = $this->getName() . $block_id;
     $class = $this->getName() . '_block';
     $title = $WT_TREE->getTitleHtml();
     $content = '<table><tr>';
     $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-pedigree"></i><br>' . I18N::translate('Default chart') . '</a></td>';
     $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&amp;ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-indis"></i><br>' . I18N::translate('Default individual') . '</a></td>';
     if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) {
         $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . I18N::translate('Request new user account') . '</a></td>';
     }
     $content .= "</tr>";
     $content .= "</table>";
     if ($template) {
         return Theme::theme()->formatBlock($id, $title, $class, $content);
     } else {
         return $content;
     }
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:30,代码来源:WelcomeBlockModule.php


示例7: array

    echo I18N::translate('members');
    ?>
</span>
			</div>
		</div>
		<div class="col-sm-8">
			<?php 
    echo FunctionsEdit::selectEditControl('REQUIRE_AUTHENTICATION', array('0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')), null, $WT_TREE->getPreference('REQUIRE_AUTHENTICATION'), 'class="form-control"');
    ?>
			<p class="small text-muted">
				<?php 
    echo I18N::translate('Enabling this option will force all visitors to sign in before they can view any data on the website.');
    ?>
			</p>
			<?php 
    if (Site::getPreference('USE_REGISTRATION_MODULE')) {
        ?>
			<p class="small text-muted">
				<?php 
        echo I18N::translate('If visitors can not see the family tree, they will not be able to sign up for an account. You will need to add their account manually.');
        ?>
			</p>
			<?php 
    }
    ?>
		</div>
	</div>

	<!-- SHOW_DEAD_PEOPLE -->
	<div class="form-group">
		<div class="control-label col-sm-4">
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_trees_config.php


示例8: historicalFacts

 /**
  * Get any historical events.
  *
  * @param Individual $person
  *
  * @return Fact[]
  */
 private static function historicalFacts(Individual $person)
 {
     $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS');
     $facts = array();
     if ($SHOW_RELATIVES_EVENTS) {
         // Only include events between birth and death
         $birt_date = $person->getEstimatedBirthDate();
         $deat_date = $person->getEstimatedDeathDate();
         if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) {
             $histo = array();
             require Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php';
             foreach ($histo as $hist) {
                 // Earlier versions of the WIKI encouraged people to use HTML entities,
                 // rather than UTF8 encoding.
                 $hist = html_entity_decode($hist, ENT_QUOTES, 'UTF-8');
                 $fact = new Fact($hist, $person, 'histo');
                 $sdate = $fact->getDate();
                 if ($sdate->isOK() && Date::compare($birt_date, $sdate) <= 0 && Date::compare($sdate, $deat_date) <= 0) {
                     $facts[] = $fact;
                 }
             }
         }
     }
     return $facts;
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:32,代码来源:IndividualFactsTabModule.php


示例9: menuThemes

 /**
  * Themes menu.
  *
  * @return Menu|null
  */
 public function menuThemes()
 {
     if ($this->tree && Site::getPreference('ALLOW_USER_THEMES') && $this->tree->getPreference('ALLOW_THEME_DROPDOWN')) {
         $submenus = array();
         foreach (Theme::installedThemes() as $theme) {
             $class = 'menu-theme-' . $theme->themeId() . ($theme === $this ? ' active' : '');
             $submenus[] = new Menu($theme->themeName(), '#', $class, array('onclick' => 'return false;', 'data-theme' => $theme->themeId()));
         }
         usort($submenus, function (Menu $x, Menu $y) {
             return I18N::strcasecmp($x->getLabel(), $y->getLabel());
         });
         $menu = new Menu(I18N::translate('Theme'), '#', 'menu-theme', array(), $submenus);
         return $menu;
     } else {
         return null;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:22,代码来源:AbstractTheme.php


示例10: transport

 /**
  * Create a transport mechanism for sending mail
  *
  * @return Swift_Transport
  */
 public static function transport()
 {
     switch (Site::getPreference('SMTP_ACTIVE')) {
         case 'internal':
             return Swift_MailTransport::newInstance();
         case 'external':
             $transport = Swift_SmtpTransport::newInstance()->setHost(Site::getPreference('SMTP_HOST'))->setPort(Site::getPreference('SMTP_PORT'))->setLocalDomain(Site::getPreference('SMTP_HELO'));
             if (Site::getPreference('SMTP_AUTH')) {
                 $transport->setUsername(Site::getPreference('SMTP_AUTH_USER'))->setPassword(Site::getPreference('SMTP_AUTH_PASS'));
             }
             if (Site::getPreference('SMTP_SSL') !== 'none') {
                 $transport->setEncryption(Site::getPreference('SMTP_SSL'));
             }
             return $transport;
         default:
             // For testing
             return Swift_NullTransport::newInstance();
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:24,代码来源:Mail.php


示例11:

?>
				</label>
			</div>
			<div class="value">
				<input type="email" id="form_email" name="form_email" value="<?php 
echo Filter::escapeHtml(Auth::user()->getEmail());
?>
" size="50">
				<p class="small text-muted">
					<?php 
echo I18N::translate('This email address will be used to send password reminders, website notifications, and messages from other family members who are registered on the website.');
?>
				</p>
			</div>
			<?php 
if (Site::getPreference('ALLOW_USER_THEMES')) {
    ?>

			<div class="label">
				<label for="form_theme">
					<?php 
    echo I18N::translate('Theme');
    ?>
				</label>
			</div>
			<div class="value">
				<select id="form_theme" name="form_theme">
					<option value="">
						<?php 
    echo Filter::escapeHtml(I18N::translate('<default theme>'));
    ?>
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:31,代码来源:edituser.php


示例12:

                        }
                    }
                }
            }
        } else {
            http_response_code(406);
        }
        break;
    case 'reject-changes':
        // Reject all the pending changes for a record
        $record = GedcomRecord::getInstance(Filter::post('xref', WT_REGEX_XREF), $WT_TREE);
        if ($record && $record->canEdit() && Auth::isModerator($record->getTree())) {
            FlashMessages::addMessage(I18N::translate('The changes to “%s” have been rejected.', $record->getFullName()));
            FunctionsImport::rejectAllChanges($record);
        } else {
            http_response_code(406);
        }
        break;
    case 'theme':
        // Change the current theme
        $theme = Filter::post('theme');
        if (Site::getPreference('ALLOW_USER_THEMES') && array_key_exists($theme, Theme::themeNames())) {
            Session::put('theme_id', $theme);
            // Remember our selection
            Auth::user()->setPreference('theme', $theme);
        } else {
            // Request for a non-existant theme.
            http_response_code(406);
        }
        break;
}
开发者ID:josefpavlik,项目名称:webtrees,代码行数:31,代码来源:action.php


示例13: updateSchema

 /**
  * Run a series of scripts to bring the database schema up to date.
  *
  * @param string $namespace      Where to find our MigrationXXX classes
  * @param string $schema_name    Where to find our MigrationXXX classes
  * @param int    $target_version updade/downgrade to this version
  *
  * @throws PDOException
  *
  * @return bool  Were any updates applied
  */
 public static function updateSchema($namespace, $schema_name, $target_version)
 {
     try {
         $current_version = (int) Site::getPreference($schema_name);
     } catch (PDOException $e) {
         // During initial installation, the site_preference table won’t exist.
         $current_version = 0;
     }
     $updates_applied = false;
     try {
         // Update the schema, one version at a time.
         while ($current_version < $target_version) {
             $class = $namespace . '\\Migration' . $current_version;
             /** @var MigrationInterface $migration */
             $migration = new $class();
             $migration->upgrade();
             Site::setPreference($schema_name, ++$current_version);
             $updates_applied = true;
         }
     } catch (PDOException $ex) {
         // The schema update scripts should never fail. If they do, there is no clean recovery.
         FlashMessages::addMessage($ex->getMessage(), 'danger');
         header('Location: ' . WT_BASE_URL . 'site-unavailable.php');
         throw $ex;
     }
     return $updates_applied;
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:38,代码来源:Database.php


示例14: IN

Database::exec("DELETE FROM `##user` WHERE user_id>0");
////////////////////////////////////////////////////////////////////////////////
echo '<p>', $INDEX_DIRECTORY, 'config.php => wt_site_setting…</p>';
Site::setPreference('USE_REGISTRATION_MODULE', $USE_REGISTRATION_MODULE);
Site::setPreference('ALLOW_USER_THEMES', $ALLOW_USER_THEMES);
Site::setPreference('ALLOW_CHANGE_GEDCOM', $ALLOW_CHANGE_GEDCOM);
Site::setPreference('SESSION_TIME', $PGV_SESSION_TIME);
Site::setPreference('SMTP_ACTIVE', $PGV_SMTP_ACTIVE ? 'external' : 'internal');
Site::setPreference('SMTP_HOST', $PGV_SMTP_HOST);
Site::setPreference('SMTP_HELO', $PGV_SMTP_HELO);
Site::setPreference('SMTP_PORT', $PGV_SMTP_PORT);
Site::setPreference('SMTP_AUTH', $PGV_SMTP_AUTH);
Site::setPreference('SMTP_AUTH_USER', $PGV_SMTP_AUTH_USER);
Site::setPreference('SMTP_AUTH_PASS', $PGV_SMTP_AUTH_PASS);
Site::setPreference('SMTP_SSL', $PGV_SMTP_SSL);
Site::setPreference('SMTP_FROM_NAME', $PGV_SMTP_FROM_NAME);
////////////////////////////////////////////////////////////////////////////////
echo '<p>pgv_site_setting => wt_site_setting…</p>';
Database::prepare("REPLACE INTO `##site_setting` (setting_name, setting_value)" . " SELECT site_setting_name, site_setting_value FROM `{$DBNAME}`.`{$TBLPREFIX}site_setting`" . " WHERE site_setting_name IN ('DEFAULT_GEDCOM', 'LAST_CHANGE_EMAIL')")->execute();
////////////////////////////////////////////////////////////////////////////////
if ($PGV_SCHEMA_VERSION >= 12) {
    echo '<p>pgv_gedcom => wt_gedcom…</p>';
    Database::prepare("INSERT INTO `##gedcom` (gedcom_id, gedcom_name)" . " SELECT gedcom_id, gedcom_name FROM `{$DBNAME}`.`{$TBLPREFIX}gedcom`")->execute();
    echo '<p>pgv_gedcom_setting => wt_gedcom_setting…</p>';
    Database::prepare("INSERT INTO `##gedcom_setting` (gedcom_id, setting_name, setting_value)" . " SELECT gedcom_id, setting_name," . "  CASE setting_name" . "  WHEN 'THEME_DIR' THEN" . "   CASE setting_value" . "   WHEN ''                    THEN ''" . "   WHEN 'themes/cloudy/'      THEN 'clouds'" . "   WHEN 'themes/minimal/'     THEN 'minimal'" . "   WHEN 'themes/simplyblue/'  THEN 'colors'" . "   WHEN 'themes/simplygreen/' THEN 'colors'" . "   WHEN 'themes/simplyred/'   THEN 'colors'" . "   WHEN 'themes/xenea/'       THEN 'xenea'" . "   ELSE 'themes/webtrees/'" . "  END" . "  WHEN 'LANGUAGE' THEN" . "   CASE setting_value" . "   WHEN 'arabic'     THEN 'ar'" . "   WHEN 'catalan'    THEN 'ca'" . "   WHEN 'chinese'    THEN 'zh_CN'" . "   WHEN 'croatian'   THEN 'hr'" . "   WHEN 'danish'     THEN 'da'" . "   WHEN 'dutch'      THEN 'nl'" . "   WHEN 'english'    THEN 'en_US'" . "   WHEN 'english-uk' THEN 'en_GB'" . "   WHEN 'estonian'   THEN 'et'" . "   WHEN 'finnish'    THEN 'fi'" . "   WHEN 'french'     THEN 'fr'" . "   WHEN 'german'     THEN 'de'" . "   WHEN 'greek'      THEN 'el'" . "   WHEN 'hebrew'     THEN 'he'" . "   WHEN 'hungarian'  THEN 'hu'" . "   WHEN 'indonesian' THEN 'id'" . "   WHEN 'italian'    THEN 'it'" . "   WHEN 'lithuanian' THEN 'lt'" . "   WHEN 'norwegian'  THEN 'nn'" . "   WHEN 'polish'     THEN 'pl'" . "   WHEN 'portuguese' THEN 'pt'" . "   WHEN 'romainian'  THEN 'ro'" . "   WHEN 'russian'    THEN 'ru'" . "   WHEN 'serbian-la' THEN 'sr@Latn'" . "   WHEN 'slovak'     THEN 'sk'" . "   WHEN 'slovenian'  THEN 'sl'" . "   WHEN 'spanish'    THEN 'es'" . "   WHEN 'spanish-ar' THEN 'es'" . "   WHEN 'swedish'    THEN 'sv'" . "   WHEN 'turkish'    THEN 'tr'" . "   WHEN 'vietnamese' THEN 'vi'" . "   ELSE 'en_US'" . "  END" . "  ELSE setting_value" . "  END" . " FROM `{$DBNAME}`.`{$TBLPREFIX}gedcom_setting`" . " WHERE setting_name NOT IN ('HOME_SITE_TEXT', 'HOME_SITE_URL')")->execute();
    echo '<p>pgv_user => wt_user…</p>';
    try {
        // "INSERT IGNORE" is needed to allow for PhpGedView users with duplicate emails. Only the first will be imported.
        Database::prepare("INSERT IGNORE INTO `##user` (user_id, user_name, real_name, email, password)" . " SELECT user_id, user_name, CONCAT_WS(' ', us1.setting_value, us2.setting_value), us3.setting_value, password FROM `{$DBNAME}`.`{$TBLPREFIX}user`" . " LEFT JOIN `{$DBNAME}`.`{$TBLPREFIX}user_setting` us1 USING (user_id)" . " LEFT JOIN `{$DBNAME}`.`{$TBLPREFIX}user_setting` us2 USING (user_id)" . " JOIN `{$DBNAME}`.`{$TBLPREFIX}user_setting` us3 USING (user_id)" . " WHERE us1.setting_name='firstname'" . " AND us2.setting_name='lastname'" . " AND us3.setting_name='email'")->execute();
    } catch (PDOException $ex) {
        // Ignore duplicates
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:admin_pgv_to_wt.php


示例15: transport

 /**
  * Create a transport mechanism for sending mail
  *
  * @return Zend_Mail_Transport_File|Zend_Mail_Transport_Smtp
  */
 public static function transport()
 {
     switch (Site::getPreference('SMTP_ACTIVE')) {
         case 'internal':
             return new Zend_Mail_Transport_Sendmail();
         case 'external':
             $config = array('name' => Site::getPreference('SMTP_HELO'), 'port' => Site::getPreference('SMTP_PORT'));
             if (Site::getPreference('SMTP_AUTH')) {
                 $config['auth'] = 'login';
                 $config['username'] = Site::getPreference('SMTP_AUTH_USER');
                 $config['password'] = Site::getPreference('SMTP_AUTH_PASS');
             }
             if (Site::getPreference('SMTP_SSL') !== 'none') {
                 $config['ssl'] = Site::getPreference('SMTP_SSL');
             }
             return new Zend_Mail_Transport_Smtp(Site::getPreference('SMTP_HOST'), $config);
         default:
             // For testing
             return new Zend_Mail_Transport_File();
     }
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:26,代码来源:Mail.php


示例16:

			<div class="label">
				<?php 
    echo I18N::translate('Associates');
    ?>
			</div>
			<div class="value">
				<input type="checkbox" name="showasso" value="on" <?php 
    echo $controller->showasso === 'on' ? 'checked' : '';
    ?>
>
				<?php 
    echo I18N::translate('Show related individuals/families');
    ?>
			</div>
			<?php 
    if (count(Tree::getAll()) > 1 && Site::getPreference('ALLOW_CHANGE_GEDCOM')) {
        ?>
				<?php 
        if (count(Tree::getAll()) > 3) {
            ?>
					<div class="label"></div>
					<div class="value">
						<input type="button" value="<?php 
            echo I18N::translate('select all');
            ?>
" onclick="jQuery('#search_trees :checkbox').each(function(){jQuery(this).attr('checked', true);});return false;">
						<input type="button" value="<?php 
            echo I18N::translate('select none');
            ?>
" onclick="jQuery('#search_trees :checkbox').each(function(){jQuery(this).attr('checked', false);});return false;">
						<?php 
开发者ID:tronsmit,项目名称:webtrees,代码行数:31,代码来源:search.php


示例17: AdministrationTheme

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Webtrees\Theme类代码示例发布时间:2022-05-23
下一篇:
PHP Webtrees\Module类代码示例发布时间: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