public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->addIndent(); $compiler->raw("\$this->setValue(" . $this->compileAttributesArray() . ", "); $this->right->compile($compiler); $compiler->raw(");\n"); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->raw('floor('); $this->left->compile($compiler); $compiler->raw(' / '); $this->right->compile($compiler); $compiler->raw(')'); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->raw(' !in_array('); $this->left->compile($compiler); $compiler->raw(', '); $this->right->compile($compiler); $compiler->raw(') '); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Escape):Value for filtering must be callable.'); } $compiler->raw('htmlspecialchars('); $value($compiler); $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Json_encode):Value for filtering must be callable.'); } $compiler->raw('json_encode('); $value($compiler); $compiler->raw(', JSON_FORCE_OBJECT)'); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->write('// For block node')->raw("\n")->write('foreach ('); $compiler->subcompile($this->expr)->raw(") {\n")->indent(); foreach ($this->body as $key => $val) { $val->compile($compiler); } $compiler->outdent()->write("}\n"); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Show):Value for filtering must be callable.'); } $compiler->raw("'<pre>' . print_r("); $value($compiler); $compiler->raw(", true) . '<pre>'"); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Urldecode):Value for filtering must be callable.'); } $compiler->raw('urldecode('); $value($compiler); $compiler->raw(')'); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->write('// If block node')->raw("\n"); /* $compiler->write('var_dump($this->getValue($this->context, \'fps_user_id\'));'); $compiler->write('var_dump(('); $compiler->subcompile($this->tests[0]); $compiler->write('));')->raw("\n"); */ for ($i = 0; $i < count($this->tests); $i += 2) { if ($i > 0) { $compiler->outdent()->write('} else if ('); } else { $compiler->write('if ('); } //pr($this->tests); $compiler->subcompile($this->tests[$i])->raw(") {\n")->indent(); foreach ($this->tests[$i + 1] as $k => $v) { $compiler->subcompile($v); } } if (!empty($this->else)) { $compiler->outdent()->write("} else {\n")->indent(); foreach ($this->else as $key => $val) { $compiler->subcompile($val); } } $compiler->outdent()->write("}\n"); }
public function compile(Fps_Viewer_CompileParser $compiler) { if (isset($compiler->loader->createPageUrlCallback) && is_callable($compiler->loader->createPageUrlCallback)) { $this->callback($compiler->loader->createPageUrlCallback); } if (is_callable(self::$callback)) { $url = self::$callback($this->value); $compiler->write('"' . $url . '"'); } else { $compiler->write($this->value); } }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->raw("Fps_Viewer_FunctionsStorage::run('{$this->func}', "); while (count($this->params) > 0) { $node = array_shift($this->params); $compiler->raw($node->compile($compiler)); if (count($this->params) > 0) { $compiler->raw(", "); } } $compiler->raw(")"); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Bbcode):Value for filtering must be callable.'); } $compiler->raw('Register::getInstance()->PrintText->parseBBCodes('); $value($compiler); if (!empty($this->params[0])) { $compiler->raw(', '); $this->params[0]->compile($compiler); } $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Lang):Value for filtering must be callable.'); } $compiler->raw('__('); $value($compiler); if (!empty($this->params[0])) { $compiler->raw(', '); $this->params[0]->compile($compiler); } $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('Regexp string is not exists in "Match" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Match):Value for filtering must be callable.'); } $compiler->raw('preg_match('); $this->params[0]->compile($compiler); $compiler->raw(', '); $value($compiler); $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Replace" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Replace):Value for filtering must be callable.'); } $compiler->raw('strtr('); $value($compiler); $compiler->raw(', '); $this->params[0]->compile($compiler); $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Append" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Append):Value for filtering must be callable.'); } $compiler->raw('call_user_func(function($arr, $value) {$arr[] = $value;return $arr;},'); $value($compiler); $compiler->raw(','); $this->params[0]->compile($compiler); $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (!is_callable($value)) { throw new Exception('(Filter_Join):Value for filtering must be callable.'); } $compiler->raw('implode('); if (isset($this->params[0])) { $this->params[0]->compile($compiler); } else { $compiler->raw('""'); } $compiler->raw(', '); $value($compiler); $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Slice" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Slice):Value for filtering must be callable.'); } $compiler->raw('array_slice('); $value($compiler); $compiler->raw(', '); $this->params[0]->compile($compiler); if (!empty($this->params[1]) && is_object($this->params[1])) { $compiler->raw(', '); $this->params[1]->compile($compiler); } $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Split" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Split):Value for filtering must be callable.'); } $compiler->raw('explode('); $this->params[0]->compile($compiler); $compiler->raw(', '); $value($compiler); if (isset($this->params[1])) { $compiler->raw(', '); $this->params[1]->compile($compiler); } $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Substr" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Substr):Value for cuting must be callable.'); } $compiler->raw('mb_substr('); $value($compiler); $compiler->raw(', '); $this->params[0]->compile($compiler); if (!empty($this->params[1])) { $compiler->raw(', '); $this->params[1]->compile($compiler); } $compiler->raw(')'); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "NumFormat" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_NumFormat):Value for filtering must be callable.'); } $compiler->raw('number_format('); $value($compiler); $compiler->raw(', '); foreach ($this->params as $k => $param) { $param->compile($compiler); if ($k + 1 < count($this->params)) { $compiler->raw(', '); } } $compiler->raw(')'); }
public function compile(Fps_Viewer_CompileParser $compiler) { $path = strtr($this->path, array('//' => '/', '\\\\' => '\\')); $compiler->write("\n"); $compiler->write("\$this->includeFile('{$path}', "); if (is_array($this->context) && count($this->context)) { $compiler->raw("array("); foreach ($this->context as $key => $row) { $compiler->raw("'{$row}' => (isset(\${$row})) ? \${$row} : ''"); if ($key + 1 < count($this->context)) { $compiler->raw(", "); } } $compiler->raw(")"); } else { $compiler->raw("array()"); } $compiler->raw(");"); $compiler->write("\n"); }
public function compile($value, Fps_Viewer_CompileParser $compiler) { if (empty($this->params[0])) { throw new Exception('First parameter is not exists in "Batch" filter.'); } if (empty($this->params[1])) { throw new Exception('Second parameter is not exists in "Batch" filter.'); } if (!is_callable($value)) { throw new Exception('(Filter_Batch):Value for filtering must be callable.'); } $compiler->raw('array_map(function($n, $size = '); $this->params[0]->compile($compiler); $compiler->indent()->raw(', $def = '); $this->params[1]->compile($compiler); $compiler->indent()->raw(') {' . "\n"); $compiler->indent()->write('return array_pad($n, $size, $def);' . "\n"); $compiler->outdent()->write('}, array_chunk('); $value($compiler); $compiler->raw(', '); $this->params[0]->compile($compiler); $compiler->raw('))'); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->write('echo ')->raw($this->value->compile($compiler))->raw(";\n"); }
public function compile(Fps_Viewer_CompileParser $compiler) { $compiler->write("/** Comment block\n")->write($this->value)->raw("\n")->write("*/ \n"); }