本文整理汇总了PHP中Agent::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Agent::load方法的具体用法?PHP Agent::load怎么用?PHP Agent::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent
的用法示例。
在下文中一共展示了Agent::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEditFormView
public function getEditFormView()
{
global $clientRoot;
$model = $this->model;
if (strlen($model->getagentrelationsid()) == 0) {
$new = TRUE;
} else {
$new = FALSE;
}
$returnvalue = "\n <script type='text/javascript'>\n var frm = \$('#saveARelRecordForm');\n frm.submit(function () {\n \$('#statusDiv').html('Saving...');\n \$('#saveARelResultDiv').html('');\n \$.ajax({\n type: 'POST',\n url: '{$clientRoot}/agents/rpc/handler.php',\n data: frm.serialize(),\n dataType : 'html',\n success: function(data){\n \$('#saveARelResultDiv').html(data);\n \$('#statusDiv').html('');\n },\n error: function( xhr, status, errorThrown ) {\n \$('#statusDiv').html('Error. ' + errorThrown);\n console.log( 'Error: ' + errorThrown );\n console.log( 'Status: ' + status );\n console.dir( xhr );\n }\n });\n return false; \n });\n </script>\n";
$returnvalue .= '<div id="saveARelResultDiv"></div>';
$returnvalue .= '<form id="saveARelRecordForm">';
if ($new) {
$returnvalue .= '<input type=hidden name=mode id=mode value=savenew>';
} else {
$returnvalue .= '<input type=hidden name=mode id=mode value=save>';
}
$returnvalue .= '<input type=hidden name=table id=table value="AgentRelations">';
$returnvalue .= '<input type=hidden name=agentrelationsid value="' . $model->getagentrelationsid() . '">';
$returnvalue .= '<ul>';
if (strlen($model->getfromagentid()) > 0) {
$fromAgent = new Agent();
$fromAgent->load($model->getfromagentid());
$returnvalue .= '<input type=hidden name=fromagentid id=fromagentid value="' . $model->getfromagentid() . '">';
$returnvalue .= "<li>" . $fromAgent->getAssembledName() . "</li>\n";
} else {
$returnvalue .= "\n <script type='text/javascript'>\n \$('#fagentselect').autocomplete({\n source: '" . $clientRoot . "/agents/rpc/handler.php?mode=listjson',\n minLength: 2,\n select: function( event, ui ) { \n \$('#" . agentrelations::FROMAGENTID . "').val(ui.item.value);\n \$('#fagentselect').val(ui.item.label);\n event.preventDefault();\n }\n });\n </script>\n ";
$dupof = "";
if (strlen($model->getfromagentid()) > 0) {
$toAg = new Agent();
$toAg->load($model->gettoagentidid());
$to = $toAg->getAssembledName(TRUE);
}
$returnvalue .= '<li>
<div class="ui-widget">
<label for="fagentselect"></label>
<input id="fagentselect" value="' . $to . '"/>
<input type="hidden" id="' . agentrelations::FROMAGENTID . '" name="' . agentrelations::FROMAGENTID . '" value="' . $model->getfromagentidid() . '"/>
</div>
</li>';
}
$ct = new ctrelationshiptypes();
$types = $ct->listRelationTypesFB();
$returnvalue .= "<li>Relationship: <select id='" . agentrelations::RELATIONSHIP . "' name=" . agentrelations::RELATIONSHIP . " >\n";
foreach ($types as $type) {
if ($type == $model->getrelationship()) {
$isselected = 'selected';
} else {
$isselected = '';
}
$returnvalue .= "<option value='{$type}' {$isselected}>{$type}</option>\n";
}
$returnvalue .= "\n <script type='text/javascript'>\n \$('#tagentselect').autocomplete({\n source: '" . $clientRoot . "/agents/rpc/handler.php?mode=listjson',\n minLength: 2,\n select: function( event, ui ) { \n \$('#" . agentrelations::TOAGENTID . "').val(ui.item.value);\n \$('#tagentselect').val(ui.item.label);\n event.preventDefault();\n }\n });\n </script>\n ";
$dupof = "";
if (strlen($model->gettoagentid()) > 0) {
$toAg = new Agent();
$toAg->load($model->gettoagentid());
$to = $toAg->getAssembledName(TRUE);
}
$returnvalue .= '<li>
<div class="ui-widget">
<label for="tagentselect">of </label>
<input id="tagentselect" value="' . $to . '"/>
<input type="hidden" id="' . agentrelations::TOAGENTID . '" name="' . agentrelations::TOAGENTID . '" value="' . $model->gettoagentid() . '"/>
</div>
</li>';
$returnvalue .= "<li>NOTES<input type=text name=" . agentrelations::NOTES . " id=" . agentrelations::NOTES . " value='" . $model->getnotes() . "' size='51' maxlength='" . agentrelations::NOTES_SIZE . "' ></li>\n";
$returnvalue .= '<li><input type=submit value="Save"></li>';
$returnvalue .= '</ul>';
$returnvalue .= '</form>';
return $returnvalue;
}
示例2: Agent
<?php
include_once '../config/symbini.php';
include_once $serverRoot . '/classes/AgentManager.php';
include_once $serverRoot . '/classes/RdfUtility.php';
include_once $serverRoot . '/classes/UuidFactory.php';
// Find out what media types the client would like, in order.
$accept = RdfUtility::parseHTTPAcceptHeader($_SERVER['HTTP_ACCEPT']);
$force = array_key_exists("force", $_REQUEST) ? $_REQUEST["force"] : "";
$agentid = preg_replace('[^0-9]', '', array_key_exists("agentid", $_REQUEST) ? $_REQUEST["agentid"] : "");
$uuid = array_key_exists("uuid", $_REQUEST) ? $_REQUEST["uuid"] : "";
$findobjects = preg_replace('[^0-9]', '', array_key_exists("findobjects", $_REQUEST) ? $_REQUEST["findobjects"] : "");
$agent = new Agent();
$agentview = new AgentView();
if (strlen($agentid) > 0) {
$agent->load($agentid);
$agentview->setModel($agent);
} elseif (strlen($uuid) > 0) {
if (UuidFactory::is_valid($uuid)) {
$agent->loadByGUID($uuid);
$agentview->setModel($agent);
}
}
$done = FALSE;
if ($force == 'turtle') {
deliverTurtle();
$done = TRUE;
}
if ($force == 'rdfxml') {
deliverRdfXml();
$done = TRUE;
示例3: loadAgent
/**
* Obtain agentid or uuid from request and lookup agent.
* @return agent found, or null.
*/
function loadAgent()
{
$agent = null;
$agentid = preg_replace('[^0-9]', '', array_key_exists("agentid", $_REQUEST) ? $_REQUEST["agentid"] : "");
$uuid = array_key_exists("uuid", $_REQUEST) ? $_REQUEST["uuid"] : "";
if (strlen($agentid) > 0) {
$agent = new Agent();
$agent->load($agentid);
} elseif (strlen($uuid) > 0) {
if (UuidFactory::isValid($uuid)) {
$agent = new Agent();
$agent->loadByGUID($uuid);
}
}
return $agent;
}