예제 #1
0
/**
 * Init function of API.
 */
function init()
{
    if (($idArr = parseParam()) && validateParam($idArr)) {
        execute($idArr);
    } else {
        printParamErr();
    }
}
예제 #2
0
/**
 * Init function of API.
 */
function init()
{
    if (($idArrGroup = parseParam()) && validateParam($idArrGroup[0]) && validateParam($idArrGroup[1])) {
        execute($idArrGroup);
    } else {
        printParamErr();
    }
}
예제 #3
0
    }
    return 0;
}
foreach ($dev['PARAMSETS'] as $psetType) {
    $saveP = array();
    $p = HMRPC('getParamset', array($ds['d_id'], $psetType));
    profile_point('getParamset ' . $psetType);
    $pdes = HMRPC('getParamsetDescription', array($ds['d_id'], $psetType));
    profile_point('getParamsetDescription ' . $psetType);
    ?>
<table width="100%" style="max-width: 700px;" class="border-bottom"><?php 
    if (is_array($pdes)) {
        foreach ($pdes as $k => $ps) {
            $ps['WRITABLE'] = ($ps['OPERATIONS'] & 2) == 2 && $k != 'AES_ACTIVE';
            if ($ps['WRITABLE'] && $doSave) {
                $fVal = parseParam($_POST[$k], $ps);
                if ($fVal != $p[$k]) {
                    $saveP[$k] = $fVal;
                    $p[$k] = $fVal;
                }
            }
            ?>
<tr>
    
      <td width="200"><div align="right">
        <span class="faint"><?php 
            echo $k;
            ?>
</span>
      </div></td>
      <td width="200">
예제 #4
0
* @version 1.0
* @author Nicolas Noben (@keyle)
* @license MIT License
*
* See README for syntax
*
**/
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
ini_set('user_agent', 'Mozilla/5.0 (Windows NT 6.1; U; ru; rv:5.0.1.6) Gecko/20110501 Firefox/5.0.1 Firefox/5.0.1');
require_once 'phpQuery-onefile.php';
// Cleaning Request Parameters (url, sel for selectors, debug for debug flag)
$debug = isset($_REQUEST['debug']) ? true : false;
$url = parseParam('url');
$sel = parseParam('sel');
$sel = replaceThisByThatInThat('__', ' ', $sel);
$sel = replaceThisByThatInThat('%', '#', $sel);
$array_selectors = getIndividiualSelectors($sel);
$array_selectors = separateSelectorsAndAttributes($array_selectors);
// Get the page and do the filtering
$output = file_get_contents($url);
phpQuery::newDocument($output);
$oneAfterTheOtherArrays = phpQueryFilterAllSelectors($array_selectors);
$ordered = dumbMergeArrays($oneAfterTheOtherArrays);
// Create JSON output
$output = new stdClass();
$output->url = replaceThisByThatInThat('\\', '', $url);
$output->sel = $sel;
$output->results = $ordered;
$json_encoded_string = json_encode($output);
예제 #5
0
 public function postHash()
 {
     $hash = \Input::get('hash');
     return parseParam($hash);
 }