当前位置: 首页>>代码示例>>PHP>>正文


PHP Module::getModuleByName方法代码示例

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


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

示例1: getEditMenu

 /**
  * get edit menu
  */
 public function getEditMenu()
 {
     if (!$this->record || $this->record->isPendingDeletion()) {
         return null;
     }
     // edit menu
     $menu = new Menu(I18N::translate('Edit'), '#', 'menu-repo');
     if (Auth::isEditor($this->record->getTree())) {
         $fact = $this->record->getFirstFact('NAME');
         if ($fact) {
             // Edit existing name
             $menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), '#', 'menu-repo-edit', array('onclick' => 'return edit_record("' . $this->record->getXref() . '", "' . $fact->getFactId() . '");')));
         } else {
             // Add new name
             $menu->addSubmenu(new Menu(I18N::translate('Edit the repository'), '#', 'menu-repo-edit', array('onclick' => 'return add_fact("' . $this->record->getXref() . '", "NAME");')));
         }
     }
     // delete
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-repo-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
     }
     // edit raw
     if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), '#', 'menu-repo-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
     }
     // add to favorites
     if (Module::getModuleByName('user_favorites')) {
         $menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-repo-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite" ,{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
     }
     return $menu;
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:34,代码来源:RepositoryController.php

示例2: getEditMenu

 /**
  * get edit menu
  */
 public function getEditMenu()
 {
     if (!$this->record || $this->record->isPendingDeletion()) {
         return null;
     }
     // edit menu
     $menu = new Menu(I18N::translate('Edit'), '#', 'menu-obje');
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit the media object'), '#', 'menu-obje-edit', array('onclick' => 'window.open("addmedia.php?action=editmedia&pid=' . $this->record->getXref() . '", "_blank", edit_window_specs)')));
         // main link displayed on page
         if (Module::getModuleByName('GEDFact_assistant')) {
             $menu->addSubmenu(new Menu(I18N::translate('Manage the links'), '#', 'menu-obje-link', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","manage");')));
         } else {
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","person");')));
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","family");')));
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","source");')));
         }
         // delete
         $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-obje-del', array('onclick' => 'return delete_record("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
     }
     // edit raw
     if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit the raw GEDCOM'), '#', 'menu-obje-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
     }
     return $menu;
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:29,代码来源:MediaController.php

示例3: getEditMenu

 /**
  * get edit menu
  */
 public function getEditMenu()
 {
     if (!$this->record || $this->record->isPendingDeletion()) {
         return null;
     }
     // edit menu
     $menu = new Menu(I18N::translate('Edit'), '#', 'menu-note');
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit note'), '#', 'menu-note-edit', array('onclick' => 'return edit_note("' . $this->record->getXref() . '");')));
     }
     // delete
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-note-del', array('onclick' => 'return delete_note("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJS(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
     }
     // add to favorites
     if (Module::getModuleByName('user_favorites')) {
         $menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-note-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
     }
     // Get the link for the first submenu and set it as the link for the main menu
     if ($menu->getSubmenus()) {
         $submenus = $menu->getSubmenus();
         $menu->setLink($submenus[0]->getLink());
         $menu->setAttrs($submenus[0]->getAttrs());
     }
     return $menu;
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:29,代码来源:NoteController.php

示例4: validatePrerequisites

 /**
  * {@inhericDoc}
  * @see \MyArtJaub\Webtrees\Module\DependentInterface::validatePrerequisites()
  */
 public function validatePrerequisites()
 {
     try {
         Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
         return !is_null(Module::getModuleByName(Constants::MODULE_MAJ_SOSA_NAME));
     } catch (\Exception $ex) {
     }
     return false;
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:13,代码来源:GeoDispersionModule.php

示例5: getTitles

 /**
  * Get an array of the different titles (tag TITL) of an individual
  * 
  * @return array Array of titles
  */
 public function getTitles()
 {
     if (is_null($this->titles) && ($module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME))) {
         $pattern = '/(.*) ((' . $module->getSetting('MAJ_TITLE_PREFIX', '') . ')(.*))/';
         $this->titles = array();
         $titlefacts = $this->gedcomrecord->getFacts('TITL');
         foreach ($titlefacts as $titlefact) {
             $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2);
             if ($ct2 > 0) {
                 $this->titles[$match2[1][0]][] = trim($match2[2][0]);
             } else {
                 $this->titles[$titlefact->getValue()][] = '';
             }
         }
     }
     return $this->titles;
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:22,代码来源:Individual.php

示例6: getPossibleHooks

 /**
  * {@inheritDoc}
  * @see \MyArtJaub\Webtrees\Hook\HookProviderInterface::getPossibleHooks()
  */
 public function getPossibleHooks()
 {
     static $hooks = null;
     if ($hooks === null) {
         $hooks = array();
         // Cannot use the same logic as the core Module loading,
         // as this forces a new include of the module.php file.
         // This causes issue when classes are defined in this file.
         // Cannot use Module::getActiveModules as well, as this is private.
         $module_names = Database::prepare('SELECT SQL_CACHE module_name FROM `##module`')->fetchOneColumn();
         foreach ($module_names as $module_name) {
             $module = Module::getModuleByName($module_name);
             if ($module instanceof HookSubscriberInterface) {
                 $subscribedhooks = $module->getSubscribedHooks();
                 if (is_array($subscribedhooks)) {
                     foreach ($subscribedhooks as $key => $value) {
                         if (is_int($key)) {
                             $hook_item = $value;
                             $priority = self::DEFAULT_PRIORITY;
                         } else {
                             $hook_item = explode('#', $key, 2);
                             $priority = $value;
                         }
                         if ($hook_item && count($hook_item) == 2) {
                             $hook_func = $hook_item[0];
                             $hook_cont = $hook_item[1];
                         } else {
                             $hook_func = $hook_item[0];
                             $hook_cont = 'all';
                         }
                         if (method_exists($module, $hook_func)) {
                             $hooks[$module->getName() . '#' . $hook_func . '#' . $hook_cont] = $priority;
                         }
                     }
                 }
             }
         }
     }
     return $hooks;
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:44,代码来源:HookProvider.php

示例7: getEditMenu

 /**
  * get edit menu
  */
 public function getEditMenu()
 {
     if (!$this->record || $this->record->isPendingDeletion()) {
         return null;
     }
     // edit menu
     $menu = new Menu(I18N::translate('Edit'), '#', 'menu-obje');
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit media object'), '#', 'menu-obje-edit', array('onclick' => 'window.open("addmedia.php?action=editmedia&pid=' . $this->record->getXref() . '", "_blank", edit_window_specs)')));
         // main link displayed on page
         if (Module::getModuleByName('GEDFact_assistant')) {
             $menu->addSubmenu(new Menu(I18N::translate('Manage links'), '#', 'menu-obje-link', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","manage");')));
         } else {
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to an individual'), '#', 'menu-obje-link-indi', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","person");')));
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a family'), '#', 'menu-obje-link-fam', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","family");')));
             $menu->addSubmenu(new Menu(I18N::translate('Link this media object to a source'), '#', 'menu-obje-link-sour', array('onclick' => 'return ilinkitem("' . $this->record->getXref() . '","source");')));
         }
     }
     // delete
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-obje-del', array('onclick' => 'return delete_media("' . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJS(Filter::unescapeHtml($this->record->getFullName()))) . '", "' . $this->record->getXref() . '");')));
     }
     // edit raw
     if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit raw GEDCOM'), '#', 'menu-obje-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
     }
     // add to favorites
     if (Module::getModuleByName('user_favorites')) {
         $menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-obje-addfav', array('onclick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
     }
     // Get the link for the first submenu and set it as the link for the main menu
     if ($menu->getSubmenus()) {
         $submenus = $menu->getSubmenus();
         $menu->setLink($submenus[0]->getLink());
         $menu->setAttrs($submenus[0]->getAttrs());
     }
     return $menu;
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:41,代码来源:MediaController.php

示例8: isOperational

 /**
  * {@inheritDoc}
  * @see \MyArtJaub\Webtrees\Module\ModuleManagerInterface::isOperational()
  */
 public function isOperational($moduleName)
 {
     if (!array_key_exists($moduleName, $this->modules_list)) {
         if ($module = fw\Module::getModuleByName($moduleName)) {
             if ($module instanceof DependentInterface) {
                 if ($module->validatePrerequisites()) {
                     $this->modules_list[$moduleName] = TRUE;
                     return true;
                 } else {
                     // Do not cache the result,
                     // as they could change by the next call to the method
                     return false;
                 }
             } else {
                 $this->modules_list[$moduleName] = TRUE;
                 return true;
             }
         } else {
             $this->modules_list[$moduleName] = FALSE;
         }
     }
     return $this->modules_list[$moduleName];
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:27,代码来源:ModuleManager.php

示例9: getEditMenu

 /**
  * get edit menu
  */
 public function getEditMenu()
 {
     if (!$this->record || $this->record->isPendingDeletion()) {
         return null;
     }
     // edit menu
     $menu = new Menu(I18N::translate('Edit'), '#', 'menu-sour');
     if (Auth::isEditor($this->record->getTree())) {
         $fact = $this->record->getFirstFact('TITL');
         if ($fact) {
             // Edit existing name
             $menu->addSubmenu(new Menu(I18N::translate('Edit source'), '#', 'menu-sour-edit', array('onclick' => 'return edit_record("' . $this->record->getXref() . '", "' . $fact->getFactId() . '");')));
         } else {
             // Add new name
             $menu->addSubmenu(new Menu(I18N::translate('Edit source'), '#', 'menu-sour-edit', array('onclick' => 'return add_fact("' . $this->record->getXref() . '", "TITL");')));
         }
     }
     // delete
     if (Auth::isEditor($this->record->getTree())) {
         $menu->addSubmenu(new Menu(I18N::translate('Delete'), '#', 'menu-sour-del', array('onclick' => "return delete_record('" . I18N::translate('Are you sure you want to delete “%s”?', Filter::escapeJs(Filter::unescapeHtml($this->record->getFullName()))) . "', '" . $this->record->getXref() . "');")));
     }
     // edit raw
     if (Auth::isAdmin() || Auth::isEditor($this->record->getTree()) && $this->record->getTree()->getPreference('SHOW_GEDCOM_RECORD')) {
         $menu->addSubmenu(new Menu(I18N::translate('Edit raw GEDCOM'), '#', 'menu-sour-editraw', array('onclick' => 'return edit_raw("' . $this->record->getXref() . '");')));
     }
     // add to favorites
     if (Module::getModuleByName('user_favorites')) {
         $menu->addSubmenu(new Menu(I18N::translate('Add to favorites'), '#', 'menu-sour-addfav', array('onlick' => 'jQuery.post("module.php?mod=user_favorites&mod_action=menu-add-favorite",{xref:"' . $this->record->getXref() . '"},function(){location.reload();})')));
     }
     // Get the link for the first submenu and set it as the link for the main menu
     if ($menu->getSubmenus()) {
         $submenus = $menu->getSubmenus();
         $menu->setLink($submenus[0]->getLink());
         $menu->setAttrs($submenus[0]->getAttrs());
     }
     return $menu;
 }
开发者ID:josefpavlik,项目名称:webtrees,代码行数:40,代码来源:SourceController.php

示例10: printMainNotes

 /**
  * Print a row for the notes tab on the individual page.
  *
  * @param Fact $fact
  * @param int $level
  */
 public static function printMainNotes(Fact $fact, $level)
 {
     $factrec = $fact->getGedcom();
     $fact_id = $fact->getFactId();
     $parent = $fact->getParent();
     $pid = $parent->getXref();
     if ($fact->isPendingAddition()) {
         $styleadd = ' new';
         $can_edit = $level == 1 && $fact->canEdit();
     } elseif ($fact->isPendingDeletion()) {
         $styleadd = ' old';
         $can_edit = false;
     } else {
         $styleadd = '';
         $can_edit = $level == 1 && $fact->canEdit();
     }
     $ct = preg_match_all("/{$level} NOTE (.*)/", $factrec, $match, PREG_SET_ORDER);
     for ($j = 0; $j < $ct; $j++) {
         // Note object, or inline note?
         if (preg_match("/{$level} NOTE @(.*)@/", $match[$j][0], $nmatch)) {
             $note = Note::getInstance($nmatch[1], $fact->getParent()->getTree());
             if ($note && !$note->canShow()) {
                 continue;
             }
         } else {
             $note = null;
         }
         if ($level >= 2) {
             echo '<tr class="row_note2"><td class="descriptionbox rela ', $styleadd, ' width20">';
         } else {
             echo '<tr><td class="descriptionbox ', $styleadd, ' width20">';
         }
         if ($can_edit) {
             echo '<a onclick="return edit_record(\'', $pid, '\', \'', $fact_id, '\');" href="#" title="', I18N::translate('Edit'), '">';
             if ($level < 2) {
                 if ($fact->getParent()->getTree()->getPreference('SHOW_FACT_ICONS')) {
                     echo '<i class="icon-note"></i> ';
                 }
                 if ($note) {
                     echo GedcomTag::getLabel('SHARED_NOTE');
                 } else {
                     echo GedcomTag::getLabel('NOTE');
                 }
                 echo '</a>';
                 echo '<div class="editfacts">';
                 echo "<div class=\"editlink\"><a class=\"editicon\" onclick=\"return edit_record('{$pid}', '{$fact_id}');\" href=\"#\" title=\"" . I18N::translate('Edit') . "\"><span class=\"link_text\">" . I18N::translate('Edit') . "</span></a></div>";
                 echo '<div class="copylink"><a class="copyicon" href="#" onclick="return copy_fact(\'', $pid, '\', \'', $fact_id, '\');" title="' . I18N::translate('Copy') . '"><span class="link_text">' . I18N::translate('Copy') . '</span></a></div>';
                 echo "<div class=\"deletelink\"><a class=\"deleteicon\" onclick=\"return delete_fact('" . I18N::translate('Are you sure you want to delete this fact?') . "', '{$pid}', '{$fact_id}');\" href=\"#\" title=\"" . I18N::translate('Delete') . "\"><span class=\"link_text\">" . I18N::translate('Delete') . "</span></a></div>";
                 if ($note) {
                     echo '<a class="icon-note" href="', $note->getHtmlUrl(), '" title="' . I18N::translate('View') . '"><span class="link_text">' . I18N::translate('View') . '</span></a>';
                 }
                 echo '</div>';
             }
         } else {
             if ($level < 2) {
                 if ($fact->getParent()->getTree()->getPreference('SHOW_FACT_ICONS')) {
                     echo '<i class="icon-note"></i> ';
                 }
                 if ($note) {
                     echo GedcomTag::getLabel('SHARED_NOTE');
                 } else {
                     echo GedcomTag::getLabel('NOTE');
                 }
             }
             $factlines = explode("\n", $factrec);
             // 1 BIRT Y\n2 NOTE ...
             $factwords = explode(" ", $factlines[0]);
             // 1 BIRT Y
             $factname = $factwords[1];
             // BIRT
             $parent = GedcomRecord::getInstance($pid, $fact->getParent()->getTree());
             if ($factname == 'EVEN' || $factname == 'FACT') {
                 // Add ' EVEN' to provide sensible output for an event with an empty TYPE record
                 $ct = preg_match("/2 TYPE (.*)/", $factrec, $ematch);
                 if ($ct > 0) {
                     $factname = trim($ematch[1]);
                     echo $factname;
                 } else {
                     echo GedcomTag::getLabel($factname, $parent);
                 }
             } elseif ($factname != 'NOTE') {
                 // Note is already printed
                 echo GedcomTag::getLabel($factname, $parent);
                 if ($note) {
                     echo '<div class="editfacts"><a class="icon-note" href="', $note->getHtmlUrl(), '" title="' . I18N::translate('View') . '"><span class="link_text">' . I18N::translate('View') . '</span></a></div>';
                 }
             }
         }
         echo '</td>';
         if ($note) {
             // Note objects
             if (Module::getModuleByName('GEDFact_assistant')) {
                 // If Census assistant installed, allow it to format the note
                 $text = CensusAssistantModule::formatCensusNote($note);
//.........这里部分代码省略.........
开发者ID:jflash,项目名称:webtrees,代码行数:101,代码来源:FunctionsPrintFacts.php

示例11: generateFanChart


//.........这里部分代码省略.........
                     $imagemap .= "{$tx},{$ty},";
                     $deg += ($deg2 - $deg1) / 6;
                 }
                 // plot lower points
                 $mr = ($rx - $rw) / 2;
                 $deg = $deg2;
                 while ($deg >= $deg1) {
                     $rad = deg2rad($deg);
                     $tx = round($cx + $mr * cos($rad));
                     $ty = round($cy - $mr * -sin($rad));
                     $imagemap .= "{$tx},{$ty},";
                     $deg -= ($deg2 - $deg1) / 6;
                 }
                 // join first point
                 $mr = $rx / 2;
                 $deg = $deg1;
                 $rad = deg2rad($deg);
                 $tx = round($cx + $mr * cos($rad));
                 $ty = round($cy - $mr * -sin($rad));
                 $imagemap .= "{$tx},{$ty}";
                 // add action url
                 $pid = $person->getXref();
                 $imagemap .= '" href="#' . $pid . '"';
                 $tempURL = 'fanchart.php?rootid=' . $pid . '&amp;generations=' . $this->generations . '&amp;fan_width=' . $this->fan_width . '&amp;fan_style=' . $this->fan_style . '&amp;ged=' . $person->getTree()->getNameUrl();
                 $html .= '<div id="' . $pid . '" class="fan_chart_menu">';
                 $html .= '<div class="person_box"><div class="details1">';
                 $html .= '<a href="' . $person->getHtmlUrl() . '" class="name1">' . $name;
                 if ($addname) {
                     $html .= $addname;
                 }
                 $html .= '</a>';
                 $html .= '<ul class="charts">';
                 $html .= '<li><a href="pedigree.php?rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '" >' . I18N::translate('Pedigree') . '</a></li>';
                 if (Module::getModuleByName('googlemap')) {
                     $html .= '<li><a href="module.php?mod=googlemap&amp;mod_action=pedigree_map&amp;rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '">' . I18N::translate('Pedigree map') . '</a></li>';
                 }
                 $gedcomid = $person->getTree()->getUserPreference(Auth::user(), 'gedcomid');
                 if ($gedcomid && $gedcomid != $pid) {
                     $html .= '<li><a href="relationship.php?pid1=' . $gedcomid . '&amp;pid2=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '">' . I18N::translate('Relationship to me') . '</a></li>';
                 }
                 $html .= '<li><a href="descendancy.php?rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '" >' . I18N::translate('Descendants') . '</a></li>';
                 $html .= '<li><a href="ancestry.php?rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '">' . I18N::translate('Ancestors') . '</a></li>';
                 $html .= '<li><a href="compact.php?rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '">' . I18N::translate('Compact tree') . '</a></li>';
                 $html .= '<li><a href="' . $tempURL . '">' . I18N::translate('Fan chart') . '</a></li>';
                 $html .= '<li><a href="hourglass.php?rootid=' . $pid . '&amp;ged=' . $person->getTree()->getNameUrl() . '">' . I18N::translate('Hourglass chart') . '</a></li>';
                 if (Module::getModuleByName('tree')) {
                     $html .= '<li><a href="module.php?mod=tree&amp;mod_action=treeview&amp;ged=' . $person->getTree()->getNameUrl() . '&amp;rootid=' . $pid . '">' . I18N::translate('Interactive tree') . '</a></li>';
                 }
                 $html .= '</ul>';
                 // spouse(s) and children
                 foreach ($person->getSpouseFamilies() as $family) {
                     $spouse = $family->getSpouse($person);
                     if ($spouse) {
                         $html .= '<a href="' . $spouse->getHtmlUrl() . '" class="name1">' . $spouse->getFullName() . '</a>';
                         $kids = $family->getChildren();
                         if ($kids) {
                             $html .= '<ul class="children">';
                             foreach ($kids as $child) {
                                 $html .= '<li><a href="' . $child->getHtmlUrl() . '" class="name1">' . $child->getFullName() . '</a></li>';
                             }
                             $html .= '</ul>';
                         }
                     }
                 }
                 // siblings
                 foreach ($person->getChildFamilies() as $family) {
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:67,代码来源:FanchartController.php

示例12: edit

    /**
     * Action from the configuration page
     */
    private function edit()
    {
        global $WT_TREE;
        if (Filter::postBool('save') && Filter::checkCsrf()) {
            $block_id = Filter::postInteger('block_id');
            if ($block_id) {
                Database::prepare("UPDATE `##block` SET gedcom_id = NULLIF(:tree_id, '0'), block_order = :block_order WHERE block_id = :block_id")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'block_order' => Filter::postInteger('block_order'), 'block_id' => $block_id));
            } else {
                Database::prepare("INSERT INTO `##block` (gedcom_id, module_name, block_order) VALUES (NULLIF(:tree_id, '0'), :module_name, :block_order)")->execute(array('tree_id' => Filter::postInteger('gedcom_id'), 'module_name' => $this->getName(), 'block_order' => Filter::postInteger('block_order')));
                $block_id = Database::getInstance()->lastInsertId();
            }
            $this->setBlockSetting($block_id, 'header', Filter::post('header'));
            $this->setBlockSetting($block_id, 'faqbody', Filter::post('faqbody'));
            $languages = Filter::postArray('lang');
            $this->setBlockSetting($block_id, 'languages', implode(',', $languages));
            $this->config();
        } else {
            $block_id = Filter::getInteger('block_id');
            $controller = new PageController();
            if ($block_id) {
                $controller->setPageTitle(I18N::translate('Edit FAQ item'));
                $header = $this->getBlockSetting($block_id, 'header');
                $faqbody = $this->getBlockSetting($block_id, 'faqbody');
                $block_order = Database::prepare("SELECT block_order FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
                $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##block` WHERE block_id = :block_id")->execute(array('block_id' => $block_id))->fetchOne();
            } else {
                $controller->setPageTitle(I18N::translate('Add an FAQ item'));
                $header = '';
                $faqbody = '';
                $block_order = Database::prepare("SELECT IFNULL(MAX(block_order)+1, 0) FROM `##block` WHERE module_name = :module_name")->execute(array('module_name' => $this->getName()))->fetchOne();
                $gedcom_id = $WT_TREE->getTreeId();
            }
            $controller->pageHeader();
            if (Module::getModuleByName('ckeditor')) {
                CkeditorModule::enableEditor($controller);
            }
            ?>
			<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><a
						href="module.php?mod=<?php 
            echo $this->getName();
            ?>
&mod_action=admin_config"><?php 
            echo I18N::translate('Frequently asked questions');
            ?>
</a>
				</li>
				<li class="active"><?php 
            echo $controller->getPageTitle();
            ?>
</li>
			</ol>
			<h1><?php 
            echo $controller->getPageTitle();
            ?>
</h1>

			<form name="faq" class="form-horizontal" method="post" action="module.php?mod=<?php 
            echo $this->getName();
            ?>
&amp;mod_action=admin_edit">
			<?php 
            echo Filter::getCsrf();
            ?>
			<input type="hidden" name="save" value="1">
			<input type="hidden" name="block_id" value="<?php 
            echo $block_id;
            ?>
">

			<div class="form-group">
				<label for="header" class="col-sm-3 control-label">
					<?php 
            echo I18N::translate('Question');
            ?>
				</label>

				<div class="col-sm-9">
					<input type="text" class="form-control" name="header" id="header"
					       value="<?php 
            echo Filter::escapeHtml($header);
            ?>
">
				</div>
			</div>

			<div class="form-group">
				<label for="faqbody" class="col-sm-3 control-label">
					<?php 
//.........这里部分代码省略.........
开发者ID:tunandras,项目名称:webtrees,代码行数:101,代码来源:FrequentlyAskedQuestionsModule.php

示例13: renderContent

    /**
     * {@inhericDoc}
     * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
     */
    protected function renderContent()
    {
        if (Module::getModuleByName('ckeditor')) {
            CkeditorModule::enableEditor($this->ctrl);
        }
        /** @var AbstractModule $module  */
        $module = $this->data->get('module');
        ?>
        
        <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 $this->data->get('title');
        ?>
</li>
		</ol>
		
		<h1><?php 
        echo $this->data->get('title');
        ?>
</h1>

		<form method="post" class="form-horizontal">
			<?php 
        echo Filter::getCsrf();
        ?>
			<input type="hidden" name="action" value="update">
			
			<h3><?php 
        echo I18N::translate('Titles');
        ?>
</h3>
			
			<!--  MAJ_TITLE_PREFIX -->        	
        	<div class="form-group">			
        		<label for="MAJ_TITLE_PREFIX" class="col-sm-3 control-label">
        			<?php 
        echo I18N::translate('Title prefixes');
        ?>
        		</label>
    			<div class="col-sm-9">
    				<input type="text" class="form-control" dir="auto" id="MAJ_TITLE_PREFIX" name="MAJ_TITLE_PREFIX" value="<?php 
        echo Filter::escapeHtml($module->getSetting('MAJ_TITLE_PREFIX'));
        ?>
" maxlength="255" placeholder="de |d'|du |of |von |vom |am |zur |van |del |della |t'|da |ten |ter |das |dos |af ">
        			<p class="small text-muted">
        				<?php 
        echo I18N::translate('Set possible aristocratic particles to separate titles from the land they refer to (e.g. Earl <strong>of</strong> Essex). Variants must be separated by the character |.');
        ?>
<br />
        				<?php 
        echo I18N::translate('An example for this setting is : <strong>de |d\'|du |of |von |vom |am |zur |van |del |della |t\'|da |ten |ter |das |dos |af </strong> (covering some of French, English, German, Dutch, Italian, Spanish, Portuguese, Swedish common particles).');
        ?>
        			</p>
        		</div>        		
        	</div>
        	
        	<h3><?php 
        echo I18N::translate('Header');
        ?>
</h3>
        	
        	<!-- MAJ_ADD_HTML_HEADER -->
    		<div class="form-group">
    			<label class="control-label col-sm-3" for="MAJ_ADD_HTML_HEADER">
    				<?php 
        echo I18N::translate('Include additional HTML in header');
        ?>
    			</label>
    			<div class="col-sm-9">
    				<?php 
        echo FunctionsEdit::editFieldYesNo('MAJ_ADD_HTML_HEADER', $module->getSetting('MAJ_ADD_HTML_HEADER', 0), 'class="radio-inline"');
        ?>
				    <p class="small text-muted">
    					<?php 
        echo I18N::translate('Enable this option to include raw additional HTML in the header of the page.');
        ?>
    				</p>
    			</div>
    		</div>
        	
        	<!-- MAJ_SHOW_HTML_HEADER -->
        	<div class="form-group">
        		<label class="control-label col-sm-3" for="MAJ_SHOW_HTML_HEADER">
        			<?php 
        echo I18N::translate('Hide additional header');
        ?>
        		</label>
        		<div class="col-sm-9">
//.........这里部分代码省略.........
开发者ID:jon48,项目名称:webtrees-lib,代码行数:101,代码来源:AdminConfigView.php

示例14: addSimpleTag


//.........这里部分代码省略.........
     if ($fact === 'NOTE' && $islink) {
         $note1 = Note::getInstance($value, $WT_TREE);
         if ($note1) {
             $noterec = $note1->getGedcom();
             preg_match('/' . $value . '/i', $noterec, $notematch);
             $value = $notematch[0];
         }
     }
     // Show names for spouses in MARR/HUSB/AGE and MARR/WIFE/AGE
     if ($fact === 'HUSB' || $fact === 'WIFE') {
         $family = Family::getInstance($xref, $WT_TREE);
         if ($family) {
             $spouse_link = $family->getFirstFact($fact);
             if ($spouse_link) {
                 $spouse = $spouse_link->getTarget();
                 if ($spouse) {
                     echo $spouse->getFullName();
                 }
             }
         }
     }
     if (in_array($fact, Config::emptyFacts()) && ($value === '' || $value === 'Y' || $value === 'y')) {
         echo '<input type="hidden" id="', $element_id, '" name="', $element_name, '" value="', $value, '">';
         if ($level <= 1) {
             echo '<input type="checkbox" ';
             if ($value) {
                 echo 'checked';
             }
             echo ' onclick="document.getElementById(\'' . $element_id . '\').value = (this.checked) ? \'Y\' : \'\';">';
             echo I18N::translate('yes');
         }
         if ($fact === 'CENS' && $value === 'Y') {
             echo self::censusDateSelector(WT_LOCALE, $xref);
             if (Module::getModuleByName('GEDFact_assistant') && GedcomRecord::getInstance($xref, $WT_TREE) instanceof Individual) {
                 echo '<div></div><a href="#" style="display: none;" id="assistant-link" onclick="return activateCensusAssistant();">' . I18N::translate('Create a new shared note using assistant') . '</a></div>';
             }
         }
     } elseif ($fact === 'TEMP') {
         echo self::selectEditControl($element_name, GedcomCodeTemp::templeNames(), I18N::translate('No temple - living ordinance'), $value);
     } elseif ($fact === 'ADOP') {
         echo self::editFieldAdoption($element_name, $value, '', $person);
     } elseif ($fact === 'PEDI') {
         echo self::editFieldPedigree($element_name, $value, '', $person);
     } elseif ($fact === 'STAT') {
         echo self::selectEditControl($element_name, GedcomCodeStat::statusNames($upperlevel), '', $value);
     } elseif ($fact === 'RELA') {
         echo self::editFieldRelationship($element_name, strtolower($value));
     } elseif ($fact === 'QUAY') {
         echo self::selectEditControl($element_name, GedcomCodeQuay::getValues(), '', $value);
     } elseif ($fact === '_WT_USER') {
         echo self::editFieldUsername($element_name, $value);
     } elseif ($fact === 'RESN') {
         echo self::editFieldRestriction($element_name, $value);
     } elseif ($fact === '_PRIM') {
         echo '<select id="', $element_id, '" name="', $element_name, '" >';
         echo '<option value=""></option>';
         echo '<option value="Y" ';
         if ($value === 'Y') {
             echo ' selected';
         }
         echo '>', I18N::translate('always'), '</option>';
         echo '<option value="N" ';
         if ($value === 'N') {
             echo 'selected';
         }
         echo '>', I18N::translate('never'), '</option>';
开发者ID:josefpavlik,项目名称:webtrees,代码行数:67,代码来源:FunctionsEdit.php

示例15: array

 }
 echo '</h2>';
 if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
     $linklevels = '';
     $placelevels = '';
     $place_names = array();
     for ($j = 0; $j < $level; $j++) {
         $linklevels .= '&amp;parent[' . $j . ']=' . rawurlencode($parent[$j]);
         if ($parent[$j] == '') {
             $placelevels = ', ' . I18N::translate('unknown') . $placelevels;
         } else {
             $placelevels = ', ' . $parent[$j] . $placelevels;
         }
     }
     $gm_module->createMap($placelevels);
 } elseif (Module::getModuleByName('places_assistant')) {
     // Places Assistant is a custom/add-on module that was once part of the core code.
     \PlacesAssistantModule::display_map($level, $parent);
 }
 // -- echo the array
 foreach ($child_places as $n => $child_place) {
     if ($n == 0) {
         echo '<table id="place_hierarchy" class="list_table"><tr><td class="list_label" ';
         if ($numfound > 20) {
             echo 'colspan="3"';
         } elseif ($numfound > 4) {
             echo 'colspan="2"';
         }
         echo '><i class="icon-place"></i> ';
         if ($place_id) {
             echo I18N::translate('Places in %s', $place->getPlaceName());
开发者ID:jflash,项目名称:webtrees,代码行数:31,代码来源:placelist.php


注:本文中的Fisharebest\Webtrees\Module::getModuleByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。