/**
     * Output Html Form
     *
     * @return	string						HTML Form
     */
    function Form()
    {
        global $conf, $langs;
        if (file_exists('menu/standard_menu.lib.php') && empty($conf->optional_menu)) {
            include 'menu/standard_menu.lib.php';
        } elseif (!empty($conf->optional_menu)) {
            include addslashes($conf->optional_menu);
        } else {
            die('Can\'t load standard_menu.lib.php please download menu/standard_menu.lib.php from https://github.com/AT-backbone/Cap-PHP-library');
        }
        $Type_arr = Types();
        // TYPES FOR PAGES
        $Pages_arr = Pages();
        // PAGES
        $Type_Status_arr = TypeStatus();
        // Type Status (Like Required)
        $out = $this->Header_llx();
        $out .= '<body>';
        $out .= '<form method="POST" id="capform" name="capform" action="index.php" enctype="multipart/form-data" data-ajax="false">';
        $out .= '<input type="hidden" name="action" value="create">';
        foreach ($Type_arr as $pagename => $TypePage) {
            if (!in_array($pagename, $Pages_arr['popup'])) {
                $out .= '<div data-role="page" id="' . $pagename . '">';
                $out .= '<div data-role="panel" data-display="push" id="' . $pagename . '_panel">';
                $out .= '<!-- panel content goes here -->';
                $out .= '<ul data-role="listview">';
                $out .= '<li style="height: 91px;">';
                $out .= '<img src="conf/logo.jpg" style="border: 1px solid black;border-radius: 45px;width: 20%;margin: 10px 0px 0px 10px;">';
                $out .= '<h1>';
                $out .= 'Cap Creator';
                $out .= '</h1>';
                $out .= '<br>';
                $out .= '<span style="font-size: 10px;">';
                $out .= 'Cap v' . $this->version;
                $out .= '</span>';
                $out .= '</li>';
                foreach ($Pages_arr as $link => $Page_Name) {
                    if ($link != 'popup' && $link != 'next' && $link != 'header') {
                        if (!in_array($link, $Pages_arr['popup'])) {
                            $data = "";
                            if (in_array($link, $Pages_arr['noajax'])) {
                                $data = 'data-ajax="false"';
                            }
                            if ($link != 'noajax') {
                                if ($link == '#' . $pagename) {
                                    $out .= '<li data-theme="b"><a href="' . $link . '" ' . $data . '>' . $Page_Name . '</a></li>';
                                } else {
                                    $out .= '<li><a href="' . $link . '" ' . $data . '>' . $Page_Name . '</a></li>';
                                }
                            }
                            unset($data);
                        }
                    }
                }
                $out .= '</ul>';
                $out .= '</div>';
                // PANEL
                if ($conf->webservice->login && $conf->webservice_aktive) {
                    $login_show_name = $conf->webservice->login;
                } else {
                    $login_show_name = $langs->trans('Login');
                }
                $out .= '<div data-theme="b" data-role="header">';
                $out .= '<a href="#' . $pagename . '_panel" class="ui-btn ui-icon-bars ui-btn-icon-notext" style="border: none;"></a>';
                $out .= '<h1>' . $Pages_arr['#' . $pagename] . '</h1>';
                if ($conf->webservice->on == 1) {
                    $out .= '<a href="#Login-' . $pagename . '" data-rel="popup" data-position-to="window" data-transition="pop">' . $login_show_name . '</a>';
                }
                $out .= '</div>';
                // HEADER
                // Main
                $out .= '<div class="ui-content ui-page-theme-a" data-form="ui-page-theme-a" data-theme="a" role="main">';
                $out .= '<div data-theme="a" data-form="ui-body-a" class="ui-body ui-body-a ui-corner-all">';
                $out .= '<ul data-role="listview" data-divider-theme="b">';
                $out .= '<li data-role="list-divider" data-theme="b"><h1 style="font-size:22px;">' . $Pages_arr['#' . $pagename] . '</h1></li>';
                foreach ($TypePage as $key => $type) {
                    if (is_numeric($key)) {
                        $out .= '<li>';
                        $out .= $this->InputStandard($type, $Type_Status_arr);
                        $out .= '</li>';
                    }
                }
                $out .= '</ul>';
                $out .= '</div>';
                // UI_BODY_A
                // DETAILS
                if (count($TypePage['detail']['value']) >= 1) {
                    $visibl = "";
                    if ($conf->webservice->on == 0 && $pagename == "conf") {
                        $visibl = 'style="display:none;"';
                    }
                    $out .= '<div data-role="collapsible" id="' . $pagename . '-detail" data-theme="b" data-content-theme="a" ' . $visibl . '>';
                    $out .= '<h2>' . $TypePage['detail']['name'] . '</h2>';
                    $out .= '<ul data-role="listview">';
                    if (is_array($TypePage['detail']['value'])) {
                        foreach ($TypePage['detail']['value'] as $key_ex => $type_ex) {
                            if ($key_ex != 'name') {
                                $out .= '<li id="' . $type_ex . 'DIV" class="ui-field-contain">' . $this->InputStandard($type_ex, $Type_Status_arr) . '</li>';
                            }
                        }
                    }
                    $out .= '</ul>';
                    $out .= '</div>';
                    // DETAILS
                }
                $out .= '</div>';
                // MAIN CONTENT
                $out .= '<div data-role="footer" data-theme="b">';
                //if($Pages_arr[$pagename]['next'] == true) $out.= '<ul data-role="listview" data-inset="true"><li><a href="#info"><h1>Next</h1></a></li></ul>';
                if (!empty($Pages_arr['next']['name'][$pagename]) || !empty($Pages_arr['next']['nolink'][$pagename])) {
                    if (!empty($Pages_arr['next']['nolink'][$pagename])) {
                        $out .= $Pages_arr['next']['nolink'][$pagename];
                    } else {
                        $out .= '<ul data-role="listview" data-inset="true"><li><a href="#' . $Pages_arr['next']['name'][$pagename] . '"><h1>' . $langs->trans('Next') . '</h1></a></li></ul>';
                    }
                }
                $out .= '</div>';
                // FOOTER
                // POPUP
                foreach ($Pages_arr['popup'] as $key => $popupname) {
                    $TypePopup = $Type_arr[$popupname];
                    $out .= '<div data-role="popup" id="' . $popupname . '-' . $pagename . '" data-theme="a" class="ui-corner-all" style="width: 100%;">';
                    //$out.= '<form>';
                    //$out.= '<div data-theme="a" data-form="ui-body-a" class="ui-body ui-body-a ui-corner-all">';
                    $out .= '<ul data-role="listview" data-divider-theme="b">';
                    $out .= '<li data-role="list-divider" data-theme="b"><h1 style="font-size:22px;">' . $langs->trans('Title' . $popupname) . '</h1></li>';
                    foreach ($TypePopup as $key => $type) {
                        if (is_numeric($key)) {
                            $out .= '<li>';
                            $out .= $this->InputStandard($type, $Type_Status_arr);
                            $out .= '</li>';
                        }
                    }
                    $out .= '</ul>';
                    //$out.= '</div>';	 // UI_BODY_A
                    //$out.= '</form>';
                    $out .= '</div>';
                }
                $out .= '</div>';
                // PAGE END
            }
        }
        $out .= '</form>';
        // FORM
        $out .= '<script>
							' . $this->script . '
							</script>';
        $out .= '</body>';
        $out .= '
			<script>					
				';
        $depends = dependencies();
        // from menu php
        $out .= '
									function dependencies_js()
									{';
        foreach ($depends as $is_object => $depends_array) {
            foreach ($depends_array as $name_or_id => $depends_array_next) {
                foreach ($depends_array_next as $object_name => $obj_arr) {
                    foreach ($obj_arr as $condition => $condition_arr) {
                        foreach ($condition_arr as $change_is => $change_to_arr) {
                            foreach ($change_to_arr as $change_name_or_id => $change_to_array) {
                                foreach ($change_to_array as $change_name => $change_to_val) {
                                    if ($name_or_id == "name") {
                                        $out .= '
																			if( $( "' . $is_object . '[name=\'' . $object_name . '\']" ).val() == "' . $condition . '" )
																			{
																		';
                                    } else {
                                        $out .= '
																			if( $( "#' . $object_name . '" ).val() == "' . $condition . '" )
																			{
																		';
                                    }
                                    if ($change_name_or_id == "name") {
                                        $out .= '
																			 $( "' . $change_is . '[name=\'' . $change_name . '\']" ).val( "' . $change_to_val . '" );	
																			 $( "' . $change_is . '[name=\'' . $change_name . '\']" ).selectmenu().selectmenu("refresh");				
																			 if($( "' . $change_is . '[name=\'' . $change_name . '\']" ).is("select"))
																			 {
																			  	$( "' . $change_is . '[name=\'' . $change_name . '\']" ).parent( ).find("a").addClass( "ui-btn-f" ); // its a select
																			 }
																			 else
																			 {
																				 $( "' . $change_is . '[name=\'' . $change_name . '\']" ).parent( ).addClass( "ui-body-f" ); // its a input
																			 }
																	   }																
																	';
                                    } else {
                                        $out .= '
																			 $( "#' . $change_name . '" ).val( "' . $change_to_val . '" );	
																			 $( "#' . $change_name . '" ).selectmenu().selectmenu("refresh");					
																			 if($( "#' . $change_name . '" ).is("select"))
																			 {
																			  	$( "#' . $change_name . '" ).parent( ).find("a").addClass( "ui-btn-f" ); // its a select
																			 }
																			 else
																			 {
																				 $( "#' . $change_name . '" ).parent( ).addClass( "ui-body-f" ); // its a input
																			 }
																	   }															
																	';
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        $out .= '}';
        $langs_arr = $this->getlang();
        foreach ($langs_arr as $key => $langs_val) {
            $out .= '
										$( "#' . $key . '_Remove_Button" ).click(function() {
											$(this).parent("a").hide();			
											$(\'input[name="event[' . $key . ']"]\').val("");
											$(\'input[name="headline[' . $key . ']"]\').val("");
											$(\'input[name="description[' . $key . ']"]\').val("");
											$(\'input[name="instruction[' . $key . ']"]\').val("");
											$( "#' . $key . '_language_input" ).val("delete");
										});
									 ';
        }
        foreach ($langs_arr as $key => $langs_val) {
            $out .= '$( "#' . $key . '_Button" ).click(function() {';
            $out .= '
											if($( "#' . $key . '_language_input" ).val() != "delete")
											{
												$( "#' . $key . '_language_input" ).val("' . $key . '");
											}
											else
											{
												$( "#' . $key . '_language_input" ).val("");
											}
											
											$( ".Lang_Button" ).each(function( index )
											{
												if( "' . $key . '_Button" == $(this).attr("id"))
												{
													$(this).css("box-shadow", "0px 0px 11px rgb(0, 126, 255)");
												}
												else
												{
													$(this).css("box-shadow", "");
												}
											});
											
											$( ".lang_input" ).each(function( index )
											{
												if( "' . $key . '" == $(this).attr("id"))
												{
													$(this).show();
												}
												else
												{
													$(this).hide();
												}					
											});				
							';
            $out .= '});';
        }
        $out .= '
				
			</script>';
        return $out;
    }
Example #2
0
    print "<td>" . $row['collection_id'] . "</td>";
    print "<td>" . $row['title'] . "</td>";
    print "<td>" . $row['cat'] . "</td>";
    print "</tr>";
}
print "</table><br/>";
mysql_free_result($res);
print "<h2>Unnormalized words</h2>";
wordsAndTags($dbcon, 0);
print "<h2>Normalized words</h2>";
wordsAndTags($dbcon, 1);
/* Dependencies */
print "<h2>Unnormalized Dependencies</h2>";
dependencies($dbcon, 0);
print "<h2>Normalized Dependencies</h2>";
dependencies($dbcon, 1);
mysql_close($dbcon);
function dependencies($dbcon, $normzd)
{
    $query = "SELECT document.title as title, property.string as prop, mW.word_id as mid, sW.word_id as sid, mW.string as master, sW.string as slave, wordwordpropdoc.times, wordwordpropdoc.fromTitle FROM wordwordpropdoc INNER JOIN property INNER JOIN word as mW INNER JOIN word as sW INNER JOIN document WHERE wordwordpropdoc.masterWord_id=mW.word_id AND wordwordpropdoc.slaveWord_id=sW.word_id AND wordwordpropdoc.doc_id=document.document_id AND wordwordpropdoc.prop_id=property.property_id AND wordwordpropdoc.normalized='" . $normzd . "'";
    $res = mysql_query($query, $dbcon);
    if (!$res) {
        die(mysql_error());
    }
    print "<table border=\"1\">";
    print "<tr><th>Document Title</th><th>Master Word ID</th><th>Master Word</th><th>Slave Word ID</th><th>Slave Word</th><th>Relationship</th><th>Times</th><th>Where</th></tr>";
    while ($row = mysql_fetch_assoc($res)) {
        if ($row['fromTitle'] == 1) {
            $ft = "TITLE";
        } else {
            $ft = "BODY";
Example #3
0
$OPT = array();
$OPT["db"] = array(0);
if (isset($oo["theme"]) and !empty($oo["theme"])) {
    echo c("a");
    theme($oo["theme"]);
}
if (isset($oo["filter"])) {
    $_SESSION["filter"] = TRUE;
} else {
    $_SESSION["filter"] = FALSE;
}
if (!isset($oo["banner-no"])) {
    echo banner();
}
if (isset($oo["install-dependencie"])) {
    echo dependencies();
}
if (isset($oo["h"]) or isset($oo["help"])) {
    echo help();
}
if (isset($oo["a"]) or isset($oo["about"])) {
    echo about();
}
if (isset($oo["s"])) {
    $OPT["find"] = $oo["s"];
} else {
    $O = 1;
}
if (isset($oo["search"])) {
    $OPT["find"] = $oo["search"];
} else {