本文整理汇总了PHP中newObject函数的典型用法代码示例。如果您正苦于以下问题:PHP newObject函数的具体用法?PHP newObject怎么用?PHP newObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了newObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: avSelectWPrintTree
function avSelectWPrintTree($name, $module, $class, $cclass, $show, $current, $method = '')
{
global $SYS;
$cdata = newObject("{$class}", $current);
$dsize = strlen($cdata->{$show}) * 1.5 + 5;
return "\n\t\t\n\t\t<input type=\"hidden\" size=\"11\" maxlength=\"11\" name=\"{$name}\" id=\"Target{$class}{$name}\" value=\"{$current}\">\n\t\t<input type=\"text\" size=\"{$dsize}\" name=\"_t_{$name}\" id=\"wTarget{$class}{$name}\" value=\"" . $cdata->{$show} . "\" readonly>\n\t\t<span onclick='window.open(\"{$SYS["ROOT"]}/Framework/Extensions/Tree/TreeW.php?module={$module}&class={$class}&show={$show}¤t={$current}&name={$name}&cclass={$cclass}&method={$method}\",\"wFrame{$class}{$name}\",\"width=400,height=300,toolbar=0,scrollbar=0\")'\n\t\tstyle=\"cursor:pointer;background-color:white;border:1px solid gray\"> + </span>\n\t\t";
}
示例2: run
function run()
{
set_time_limit(0);
/* Accion */
$con = newObject("ghost", $this->host);
$connection = $con->makeConnection();
if ($connection) {
// <tipo type="list" option="Ejecución|Espera">Tipo</tipo>
switch ($this->tipo) {
case 'Ejecución':
return $this->_run_command($connection);
break;
case 'Espera':
while (!$this->_waitfor($connection)) {
sleep(30);
}
break;
case 'Crear Script':
return $this->_scripting($connection);
break;
}
} else {
$this->ERROR = "Error al ejecutar el comando";
return false;
}
return true;
}
示例3: Save
function Save()
{
//$this->fecha_pub=time();
$f = newObject("fileh");
$f->CaptureFile = 'foto';
$par = new Ente($this->name);
$par = typecast($this, "Ente");
return $par->save();
}
示例4: listUsersInGroupId
function listUsersInGroupId()
{
$o = newObject("user");
$res = $o->select("(grupos&{$this->code}={$this->code})");
foreach ($res as $k => $v) {
$r[$v->ID] = $v->apellidos . ", " . $v->nombre;
}
return $r;
}
示例5: save
function save()
{
$f = newObject("fileh");
$f->CaptureFile = 'foto';
//dataDump($this);
$par = new Ente($this->name);
$par = typecast($this, "Ente");
//dataDump($par);
return $par->save();
}
示例6: ART_block_biblio
function ART_block_biblio()
{
global $SYS;
$c = newObject("categoria");
$c->searchResults = $c->select("cat_id=0 AND nombre <> 'faqs'", $offset, $sort);
ob_start();
listList($c, array(), "Articulus/biblio");
//plantHTML($SYS,"Articulus/biblio");
$data = ob_get_contents();
ob_end_clean();
return $data;
}
示例7: FORUS_block_forus
function FORUS_block_forus()
{
global $SYS;
$c = newObject("categoria");
$c->searchResults = $c->select("nombre='faqs'", $offset, $sort);
if ($c->nRes > 0) {
$faq = $c->searchResults[0]->ID;
}
if (BILO_isLogged()) {
$clase = "login";
} else {
$clase = "logoff";
}
return "<table border=\"0\" width=\"127\" cellspacing=\"0\" class=\"block\"><tr><th class=\"{$clase}\">Soporte Linux\n\t</td></tr><tr><td class=\"boton\"><a style=\"text-decoration:none;\" href=\"{$SYS["ROOT"]}/Forus/Lista_Foros/\">Foros</a></td></tr><td class=\"boton\"><a style=\"text-decoration:none;\" href=\"{$SYS["ROOT"]}/Articulus/Lista/cat_id={$faq}/\">Faqs</a></td></tr></table>";
}
示例8: PublicMdP
function PublicMdP(&$res, $link = "", $max = 0)
{
if ($max > 4) {
return true;
}
$p = newObject("departamento", $this->cat_id, $max++);
if ($p->ID < 2) {
$res .= " -> <a class=\"minimal\" href=\"{$link}/ID={$this->ID}/\">{$this->nombre}</a>";
return true;
} else {
$p->PublicMdP(&$res, $link, $max);
$res .= "-><a class=\"minimal\" href=\"{$link}/ID={$this->ID}/\">{$this->nombre}</a>";
}
return true;
}
示例9: disminuirVisitas
function disminuirVisitas($source, $event, $formData)
{
global $GSPAnel;
$objResponse = new xajaxResponse();
$task = newObject("example", $formData["ID"]);
if ($task->ID < 2) {
$objResponse->script("alert('Selecciona un ejemplo primero')");
} else {
$valorvisitas = $task->visita - 1;
$task->visita = $valorvisitas;
$task->save();
$objResponse->script("alert('Visitas: {$task->visita}')");
$objResponse->script("tableGrid_{$GSPAnel->dGrid->id}.refresh()");
$objResponse->script("xajax_wForm.requestloadFromId({$task->ID},'{$GSPAnel->aForms[0]->id}','example')");
}
return $objResponse;
}
示例10: BILO_block_user
function BILO_block_user()
{
global $SYS;
ob_start();
if (BILO_isLogged()) {
$u = newObject("user", BILO_uid());
$u->username = BILO_username();
$u->clase = "login";
plantHTML($u, "Public/block_ok_login");
} else {
$u = newObject("user");
debug(BILO_username(), "blue");
$u->clase = "logoff";
plantHTML($u, "Public/block_no_login");
}
$data = ob_get_contents();
ob_end_clean();
return $data;
}
示例11: checkSecurity
function checkSecurity($p)
{
$current_user = $_SESSION["__auth"]["userId"];
if (BILO_isAdmin()) {
debug("Sec passed by Group Administrador Is God(TM)", 'red');
return True;
}
if ($p->ID < 2) {
// We are creating a new file or new folder
// Check if directory has write access for all
$dir = newObject("data_object", $p->inode);
if (strpos($dir->p_other, 'w') !== False) {
debug("Sec passed by Other:w", 'red');
return True;
}
// Check if directory has write access for group
if (BILO_checkGroup($dir->gid)) {
if (strpos($dir->p_group, 'w') !== False) {
debug("Sec passed by Group:w", 'red');
return True;
}
}
// Check if directory has write access for user
if (BILO_uid() == $dir->uid) {
if (strpos($dir->p_owner, 'w') !== False) {
debug("Sec passed by Owner:w " . BILO_uid() . "|" . $dir->uid, 'red');
return True;
}
}
} else {
// We are modyfing a file or new folder
// Check if element has write access for all
// Check if element has write access for user
if (BILO_uid() == $p->uid) {
if (strpos($p->p_owner, 'w') !== False) {
debug("Sec passed by Owner:w " . BILO_uid() . "|" . $p->uid, 'red');
return True;
}
}
}
return false;
}
示例12: save
function save()
{
global $prefix;
debug("Info: Calling Extended save");
if ($this->ID > 1 && $this->md5 != $this->md5calc()) {
$o = newObject("gtasklog");
$res = $o->selectA("schedule_id=" . $this->ID . " AND inicio>" . time());
foreach ($res as $row) {
$IDS[] = $row["ID"];
}
if ($IDS) {
debug("Purgando programaciones", "green");
_query("DELETE FROM {$prefix}_gtasklog WHERE estado='No Iniciada' AND ID IN (" . implode(",", $IDS) . ")");
}
}
$this->md5 = $this->md5calc();
$par = new Ente($this->name);
$par = typecast($this, "Ente");
//dataDump($par);
return $par->save();
}
示例13: generateJobsToday
function generateJobsToday()
{
setlimitRows(150000);
$d = newObject("gtasklog");
$d->deletes("estado='No iniciada' AND inicio>" . dateTodayStamp());
$u = newObject("gtask");
$ids = $u->allID();
$d = array();
$tasks = array(1);
foreach ($ids as $id) {
$o = newObject("gtask", $id);
$cron = new Parser($o->getCronString());
$RunsToday = $cron->getRuns(time());
foreach ($RunsToday as $timeStampOfRun) {
//echo strftime("%d/%m/%Y %H:%M",$cron_ran)." # ".$cron_ran;
$tl = newObject("gtasklog");
$tasklog = $tl->getByTaskDate($o, $timeStampOfRun);
if ($tasklog) {
$tasks[] = $tasklog->ID;
//print_r($tasklog);
} else {
//
$tl = newObject("gtasklog");
$tl->etiqueta = $o->titulo . "@" . strftime("%Y%m%d");
$tl->tipo = 'Desde Definición';
$tl->gtask_id = $id;
$tl->schedule_id = $o->schedule_id;
$tl->inicio = $timeStampOfRun;
$tl->estado = 'No iniciada';
$tl->automatica = $o->automatica;
$tl->emailconfirmacion = $o->emailconfirmacion;
$tl->departamento = $o->departamento;
$tl->diasderetraso = $o->diasderetraso;
$tasks[] = $tl->save();
}
}
}
resetlimitRows();
}
示例14: save
function save()
{
$obj = newObject($this->campos["entity"]);
$this->usuario_id = BILO_uid();
$this->vista = $this->campos['entity'];
foreach ($this->campos as $key => $value) {
if (!in_array($key, array_keys($obj->properties))) {
unset($this->campos[$key]);
}
}
$this->campos_ser = serialize($this->campos);
setLimitRows(15000);
$this->searchResults = $this->select("usuario_id={$this->usuario_id} AND vista='{$this->vista}'");
resetLimitRows();
if ($this->nRes > 0) {
$this->ID = $this->searchResults[0]->ID;
} else {
$this->ID = 1;
}
$par = new Ente($this->name);
$par = typecast($this, "Ente");
return $par->save();
}
示例15: newObject
<?php
require_once "Memo.php";
require_once "security.php";
$dir = newObject("data_object");
if (!isset($inode)) {
$inode = 0;
} else {
$inode = $inode + 0;
}
if (!isset($sort)) {
$sort = "type DESC";
}
$aux = newObject("data_object", $inode);
$aux2 = newObject("data_object", 0);
$mdptext = "";
$aux->mdp(&$mdptext);
$dir->path = $mdptext;
$dir->current_inode = $inode;
if (checkReadSecurity($aux)) {
$dir->searchResults = $dir->select("inode={$inode}", $offset, $sort);
$safe_list = array();
do {
$ele = current($dir->searchResults);
if (checkReadSecurity($ele)) {
$safe_list[] = $ele;
}
} while (next($dir->searchResults));
$dir->searchResults = $safe_list;
if (sizeof($safe_list) < 1 || $safe_list[0] == false) {
unset($dir->searchResults);