Example #1
0
function check($lang_file, $en_file)
{
    global $final_result;
    if (!is_file($en_file)) {
        return false;
    }
    $en_content = file_get_contents($en_file);
    $lang_content = file_get_contents($lang_file);
    $result = do_check($en_content, $lang_content);
    if (count($result) > 0) {
        $final_result[] = array("file" => $lang_file, "error" => $result);
    }
}
?>
                                </label>
                                <label>
                                <input name="wpmsngi[alignFooter]" id="alignRadios" value="2" 
                                        <?php 
echo do_check('2', $wpmsngiopts['alignFooter']) ? 'checked="checked"' : '';
?>
 type="radio">
                                    <?php 
_e('Center', 'wpmsngi');
?>
                                </label>
                                <label>
                                <input name="wpmsngi[alignFooter]" id="alignRadios" value="3" 
                                        <?php 
echo do_check('3', $wpmsngiopts['alignFooter']) ? 'checked="checked"' : '';
?>
 type="radio">
                                    <?php 
_e('Right', 'wpmsngi');
?>
                                </label>
                            </p>
                        
                        </td>
                    </tr>
                    <tr valign="top">
                        <td> 
                            <small><?php 
_e('Enter content that will be displayed in the footer of all posts and pages.', 'wpmsngi');
?>
Example #3
0
function HTMLformTargetVocabulary($tvocab_id = "0")
{
    global $CFG;
    $array = $tvocab_id > 0 ? ARRAYtargetVocabulary($tvocab_id) : array();
    $array[tvocab_status] = is_numeric($array[tvocab_status]) ? $array[tvocab_status] : '1';
    $doAdmin = $array[tvocab_id] > 0 ? 'saveTargetVocabulary' : 'addTargetVocabulary';
    $rows .= ' <fieldset>
    <legend><a href="admin.php?vocabulario_id=list">' . ucfirst(LABEL_lcConfig) . '</a> &middot; ' . ucfirst(LABEL_TargetVocabularyWS) . '</legend>
   <form class="formdiv" name="abmTargetVocabulary" action="admin.php" method="post" onsubmit="return checkrequired(this)">';
    if ($array[tvocab_id]) {
        $rows .= '<div><label for="tvocab_label">' . ucfirst(LABEL_Titulo) . '</label>';
        $rows .= '<a id="tvocab_title" href="' . $array[tvocab_url] . '">' . $array[tvocab_title] . '</a>';
        $rows .= '</div>';
        $link2tterms = '<a href="admin.php?doAdmin=seeTermsTargetVocabulary&amp;tvocab_id=' . $array[tvocab_id] . '">' . $array[cant] . ' ' . LABEL_Terminos . '</a>';
    }
    $rows .= '<div><label for="tvocab_label" accesskey="l">' . ucfirst(LABEL_tvocab_label) . '</label>';
    $rows .= '<input name="tvocab_label" type="text" id="tvocab_label" size="25" maxlength="50" value="' . $array[tvocab_label] . '"/>';
    $rows .= '</div>';
    $rows .= '<div><label for="tvocab_tag" accesskey="t">' . ucfirst(LABEL_tvocab_tag) . '</label>';
    $rows .= '<input name="tvocab_tag" type="text" id="tvocab_tag" size="5" maxlength="5" value="' . $array[tvocab_tag] . '"/>';
    $rows .= '</div>';
    $rows .= '<div><label for="tvocab_uri_service" accesskey="u">' . ucfirst(LABEL_tvocab_uri_service) . '</label>';
    if ($array[tvocab_id]) {
        $rows .= '<span id="tvocab_uri_service">' . $array[tvocab_uri_service] . '</span>';
    } else {
        $rows .= '<input name="tvocab_uri_service" type="text" id="tvocab_uri_service" size="50" maxlength="250"  value="' . $array[tvocab_uri_service] . '"/>';
    }
    $rows .= '</div>';
    $rows .= '<div><label for="tvocab_status" accesskey="u">' . ucfirst(LABEL_enable) . '</label>';
    $rows .= '<input name="tvocab_status" type="checkbox" id="tvocab_status" value="1" ' . do_check('1', $array[tvocab_status], "checked") . '"/>' . $link2tterms;
    $rows .= '</div>';
    $rows .= '<div class="submit_form" align="center">';
    $rows .= '<input type="submit"  id="boton" name="botonTargetVocabulary" value="' . LABEL_Enviar . '"/>';
    $rows .= '<input type="hidden"  id="tvocab_id" name="tvocab_id" value="' . $array[tvocab_id] . '"/>';
    $rows .= '<input type="hidden"  name="doAdmin" id="doAdmin" value="' . $doAdmin . '"/>';
    $rows .= '<input type="button"  name="cancelar" type="button" onClick="location.href=\'admin.php\'" value="' . ucfirst(LABEL_Cancelar) . '"/>';
    $rows .= '</div>';
    $rows .= '</form>';
    $rows .= '  </fieldset>';
    return $rows;
}
            do_check($wpName . "Graphs", $SITE['graphImageDir'] . 'OutsideTempHistory.gif', $SITE['wsFtpTime'], 'file');
            // windrose.png
            break;
        case 'WC':
            do_check($wpName . "Graphs", $SITE['graphImageDir'] . 'temperature1.jpg', $SITE['wsFtpTime'], 'file');
            // windrose.png
            break;
    }
    // eo switch wpcode
}
// eo in array
#------------------------------ WXSIM check    -------------------------------------------
if (isset($SITE['wxsimPage'])) {
    $file = $SITE['wxsimData'] . 'plaintext.txt';
    if (file_exists($file)) {
        do_check(langtransstr("WXSIM forecast"), $file, 6 * 60 * 60 + 2 * 60, 'file');
        // note: '6*60*60 + 2*60' is 6:02:00 hms
    }
}
#-------------------------METEOHUB data usage --------------------------------------------
if ($wpCode == 'MH') {
    // only needed for MH
    if (isset($ws['wsDataUse'])) {
        do_check_data($ws['wsDataUse'], 'Data area');
    }
    if (isset($ws['wsRootUse'])) {
        do_check_data($ws['wsRootUse'], 'Root area');
    }
}
#---------------------------------------------------------------------------------------------------
function do_check_data($percent, $text)
function HTMLformTargetVocabulary($tvocab_id = "0")
{
    global $CFG;
    $array = $tvocab_id > 0 ? ARRAYtargetVocabulary($tvocab_id) : array();
    $array[tvocab_status] = is_numeric($array[tvocab_status]) ? $array[tvocab_status] : '1';
    $doAdmin = $array[tvocab_id] > 0 ? 'saveTargetVocabulary' : 'addTargetVocabulary';
    // Preparado de datos para el formulario ///
    $arrayLang = array();
    foreach ($CFG["ISO639-1"] as $langs) {
        array_push($arrayLang, "{$langs['0']}#{$langs['1']}");
    }
    //SEND_KEY to prevent duplicated
    session_start();
    $_SESSION['TGET_SEND_KEY'] = md5(uniqid(rand(), true));
    $rows .= '<form role="form" id="form-tvocab" data-toggle="validator" name="abmTargetVocabulary" action="admin.php" method="post">';
    $rows .= '	<div class="row">
			    <div class="col-sm-12">
					<legend><a href="admin.php?vocabulario_id=list">' . ucfirst(LABEL_lcConfig) . '</a> &middot; ' . ucfirst(LABEL_TargetVocabularyWS) . '</legend>
			    </div>
			    <!-- panel  -->
			    <div class="col-lg-7">
			        <div class="panel panel-default">
			            <div class="panel-body form-horizontal">';
    if ($array["tvocab_id"]) {
        $link2tterms = '(<a href="admin.php?doAdmin=seeTermsTargetVocabulary&amp;tvocab_id=' . $array["tvocab_id"] . '">' . $array["cant"] . ' ' . LABEL_Terminos . '</a>)';
        $rows .= '<div class="form-group"><label class="col-sm-3 control-label" for="tvocab_label">' . ucfirst(LABEL_Titulo) . '</label>';
        $rows .= '	<div class="col-sm-9"><a id="tvocab_title" href="' . $array["tvocab_url"] . '">' . $array["tvocab_title"] . '</a> ' . $link2tterms . ' ';
        $rows .= '	</div>';
        $rows .= '</div>';
    }
    $rows .= '	 <div class="form-group">
			            <label for="tvocab_label" accesskey="l" class="col-sm-3 control-label">' . ucfirst(LABEL_tvocab_label) . '</label>
			                <div class="col-sm-9">
											<input type="text" required placeholder="' . LABEL_tvocab_label . '" class="form-control" name="tvocab_label" id="tvocab_label" value="' . $array["tvocab_label"] . '"/>
			                </div>
			            </div>
			             <div class="form-group">
			                    <label for="tvocab_lang" class="col-sm-3 control-label">' . ucfirst(LABEL_Idioma) . '</label>
			                    <div class="col-sm-9">
													<select class="form-control" id="tvocab_lang" name="tvocab_lang">
			                    ' . doSelectForm($arrayLang, $array["tvocab_lang"]) . '
			                    </select>
			             				</div>
			             </div>

									<div class="form-group">
											<label for="tvocab_tag" accesskey="l" class="col-sm-3 control-label">' . ucfirst(LABEL_tvocab_tag) . '</label>
			                <div class="col-sm-9">
											<input type="text" class="form-control"  required placeholder="' . ucfirst(LABEL_tvocab_tag) . '" name="tvocab_tag" id="tvocab_tag" value="' . $array["tvocab_tag"] . '"/>
											<span class="help-block">' . ucfirst(LABEL_defaultEQmap) . '</span>
											</div>
			            </div>

									<div class="form-group">
										<label for="tvocab_uri_service" accesskey="l" class="col-sm-3 control-label">' . ucfirst(LABEL_tvocab_uri_service) . '</label>
			                <div class="col-sm-9">';
    if ($array[tvocab_id]) {
        $rows .= '<span id="tvocab_uri_service">' . $array["tvocab_uri_service"] . '</span>';
    } else {
        $rows .= '<input type="url" required placeholder="' . LABEL_tvocab_uri_service . '"  class="form-control" name="tvocab_uri_service" id="tvocab_uri_service" value="' . $array["tvocab_uri_service"] . '"/>';
        $rows .= '<span class="help-block">' . ucfirst(LINK_publicKnownVocabularies) . '</span>';
    }
    $rows .= '    </div>
			            </div>

			                <div class="form-group">
			                <input type="checkbox" name="tvocab_status" id="tvocab_status" value="1" alt="' . ucfirst(LABEL_enable) . '" ' . do_check(1, $array["tvocab_status"], 'checked') . '  />
			                <div class="col-sm-4">
			                <label for="tvocab_status">' . ucfirst(LABEL_enable) . '</label>
			                  </div>
			                </div>
			                <div class="form-group">
			                    <div class="col-sm-12 text-right">
			                     <button type="submit" class="btn btn-primary" id="boton" name="botonTargetVocabulary" value="' . LABEL_Enviar . '"/>' . ucfirst(LABEL_Enviar) . '</button>
			                      <a type="button" class="btn btn" name="cancelar" type="button" href="admin.php" title="' . ucfirst(LABEL_Cancelar) . '">' . ucfirst(LABEL_Cancelar) . '</a>
			                    </div>
			                </div>
			            </div>
			        </div>
			    </div> <!-- / panel  -->';
    $rows .= '<input type="hidden"  id="tvocab_id" name="tvocab_id" value="' . $array[tvocab_id] . '"/>';
    $rows .= '<input type="hidden"  name="doAdmin" id="doAdmin" value="' . $doAdmin . '"/>';
    $rows .= '<input type="hidden"  name="ks" id="ks" value="' . $_SESSION["TGET_SEND_KEY"] . '"/>';
    $rows .= '</form>';
    return $rows;
}