コード例 #1
0
ファイル: Transcript.php プロジェクト: k-hasan-19/wiki
 /**
  * Return true if xml property is valid
  */
 protected function validateData(&$textbox1)
 {
     $source = (string) $this->xml->source;
     return !$source || StructuredData::titleExists(NS_SOURCE, $source);
 }
コード例 #2
0
ファイル: StructuredData.php プロジェクト: k-hasan-19/wiki
 public static function titlesExist($ns, $titleArray)
 {
     foreach ($titleArray as $t) {
         if (!StructuredData::titleExists($ns, $t)) {
             return false;
         }
     }
     return true;
 }
コード例 #3
0
ファイル: Family.php プロジェクト: k-hasan-19/wiki
 protected function addPersonInput($people, $name, $msgTip, $style, $tm, $invalidStyle, $given = '', $surname = '', $nameParam = false)
 {
     $rows = '';
     $i = 0;
     if ($this->isGedcomPage) {
         foreach ($people as $person) {
             $p = htmlspecialchars($person);
             $rows .= "<tr><td><input type=\"hidden\" name=\"{$name}_id{$i}\" value=\"" . ($i + 1) . "\"/></td>" . "<td>{$p}<input id=\"{$name}{$i}\" class=\"person_input\" tabindex=\"1\" type=\"hidden\" name=\"{$name}{$i}\" value=\"{$p}\"/></td>" . "</tr>";
             $i++;
         }
         return "<h2>{$msgTip}</h2>" . "<table id=\"{$name}_table\" border=0>" . "{$rows}</table><br><br>";
     } else {
         $ns = NS_PERSON;
         foreach ($people as $person) {
             $p = htmlspecialchars($person);
             $s = $style;
             if (!StructuredData::titleStringHasId($person) || !StructuredData::titleExists(NS_PERSON, $person)) {
                 $s = $invalidStyle;
             }
             $editable = false;
             //$label = ($name == 'child' ? '&middot;' : '&nbsp;');
             $rows .= "<tr><td>&nbsp;<input type=\"hidden\" name=\"{$name}_id{$i}\" value=\"" . ($i + 1) . "\"/></td>" . "<td><input id=\"{$name}{$i}\" class=\"person_input\" tabindex=\"1\" type=\"text\" size=40 name=\"{$name}{$i}\"{$s} value=\"{$p}\"" . ($editable ? '' : ' readonly="readonly"') . "/></td>" . "<td><a href=\"javascript:void(0)\" onClick=\"removePersonFamily('{$name}',{$i}); return preventDefaultAction(event);\">remove</a></td>" . "</tr>";
             $i++;
         }
         //			if (count($people) == 0 || $name == 'child') {
         //				$rows .= "<tr><td><input type=\"hidden\" name=\"{$name}_id$i\" value=\"". ($i+1) ."\"/></td>".
         //				   "<td><input id=\"$name$i\" class=\"person_input\" tabindex=\"1\" type=\"text\" size=40 name=\"$name$i\" value=\"\"/></td>".
         //					"<td><a href=\"javascript:void(0)\" onClick=\"choose($ns,'$name$i'); return preventDefaultAction(event);\"><b>find/add&nbsp;&raquo;</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".
         //                  "<a href=\"javascript:void(0)\" onClick=\"removePersonFamily('$name',$i); return preventDefaultAction(event);\">remove</a></td>" .
         //			      "</tr>";
         //			}
         $given = mb_strtolower($given) == 'unknown' ? '' : htmlspecialchars($given);
         $surname = mb_strtolower($surname) == 'unknown' ? '' : htmlspecialchars($surname);
         $style = '';
         if ($name == 'child') {
             $linkText = 'Add child';
             $display = 'block';
             $gender = '';
         } else {
             $personName = $given && $surname ? "{$given} {$surname}" : $name;
             $linkText = "Add a page for {$personName}";
             if ($nameParam) {
                 $style = 'font-weight:bold';
                 $linkText = '&raquo; ' . $linkText;
             }
             $display = count($people) == 0 ? 'block' : 'none';
             $gender = $name == 'husband' ? 'M' : 'F';
         }
         return "<h2>{$msgTip}<small>" . $tm->addMsgTip($msgTip, 400) . "</small></h2>" . "<table id=\"{$name}_table\" border=0>" . "{$rows}</table>" . "<div id=\"{$name}_addlink\" style=\"display:{$display};{$style}\" class=\"addMemberLink\">" . "<a href=\"javascript:void(0)\" onClick=\"addPage('{$name}','{$gender}','{$given}','{$surname}'); return preventDefaultAction(event);\">{$linkText}</a></div>";
     }
 }
コード例 #4
0
ファイル: Person.php プロジェクト: k-hasan-19/wiki
 protected function addFamilyInput($families, $name, $header, $msgTip, $style, $tm, $invalidStyle)
 {
     $rows = '';
     $i = 0;
     if ($this->isGedcomPage) {
         foreach ($families as $family) {
             $f = htmlspecialchars($family);
             $rows .= "<tr><td><input type=\"hidden\" name=\"{$name}_id{$i}\" value=\"" . ($i + 1) . "\"/></td>" . "<td>{$f}<input id=\"{$name}{$i}\" class=\"family_input\" tabindex=\"1\" type=\"hidden\" name=\"{$name}{$i}\" value=\"{$f}\"/></td>" . "</tr>";
             $i++;
         }
         return "<h2>{$header}</h2>" . "<table id=\"{$name}_table\" border=0>" . "{$rows}</table><br><br>";
     } else {
         $ns = NS_FAMILY;
         foreach ($families as $family) {
             $f = htmlspecialchars($family);
             $s = $style;
             if (!StructuredData::titleStringHasId($family) || !StructuredData::titleExists(NS_FAMILY, $family)) {
                 $s = $invalidStyle;
             }
             $editable = false;
             $rows .= "<tr><td>&nbsp;<input type=\"hidden\" name=\"{$name}_id{$i}\" value=\"" . ($i + 1) . "\"/></td>" . "<td><input id=\"{$name}{$i}\" class=\"family_input\" tabindex=\"1\" type=\"text\" size=40 name=\"{$name}{$i}\"{$s} value=\"{$f}\"" . ($editable ? '' : ' readonly="readonly"') . "/></td>" . "<td><a href=\"javascript:void(0)\" onClick=\"removePersonFamily('{$name}',{$i}); return preventDefaultAction(event);\">remove</a></td>" . "</tr>";
             $i++;
         }
         //			if (count($families) == 0) {
         //			   $rows .= "<tr><td><input type=\"hidden\" name=\"{$name}_id$i\" value=\"". ($i+1) ."\"/></td>".
         //			      "<td><input id=\"$name$i\" class=\"family_input\" tabindex=\"1\" type=\"text\" size=40 name=\"$name$i\" value=\"\"/></td>".
         //					"<td><a href=\"javascript:void(0)\" onClick=\"choose($ns,'$name$i'); return preventDefaultAction(event);\"><b>find/add&nbsp;&raquo;</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".
         //                  "<a href=\"javascript:void(0)\" onClick=\"removePersonFamily('$name',$i); return preventDefaultAction(event);\">remove</a></td>" .
         //			      "</tr>";
         //			}
         //         if ($addingToFamily) {
         //            $rows .= '<tr><td colspan="3"><font color="red">The family will be added when the <i>Family page</i> is saved.</font></td></tr>';
         //         }
         if ($name == 'spouse_of_family') {
             $linkText = 'Add spouse and children';
             $display = 'block';
         } else {
             $linkText = "Add parents";
             $display = count($families) == 0 ? 'block' : 'none';
         }
         return "<h2>{$header}<small>" . $tm->addMsgTip($msgTip, 400) . "</small></h2>" . "<table id=\"{$name}_table\" border=0>" . $rows . '</table>' . "<div id=\"{$name}_addlink\" style=\"display:{$display}\" class=\"addMemberLink\">" . "<a href=\"javascript:void(0)\" onClick=\"addPage('{$name}'); return preventDefaultAction(event);\">{$linkText}</a></div>";
         //            ."<a id=\"{$name}_link\" href=\"javascript:void(0)\" onClick=\"addPage('$name','new'); return preventDefaultAction(event);\">Find/Add another family page</a><br>"
         //            .($rows ? '' : "<br>");
     }
 }