本文整理汇总了PHP中Content::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Content::load方法的具体用法?PHP Content::load怎么用?PHP Content::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Content
的用法示例。
在下文中一共展示了Content::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTitlle
function addTitlle($Category, $Id, $Lang)
{
require_once 'classes/model/Content.php';
$content = new Content();
$value = $content->load($Category, '', $Id, $Lang);
return $value;
}
示例2: load
/**
* load blog post data in the object
* @access public
*/
public function load($content_id)
{
Logger::log("Enter: BlogPost::load | Arg: \$content_id = {$content_id}");
Logger::log("Calling: Content::load | Param: \$content_id = {$content_id}");
parent::load($content_id);
Logger::log("Exit: BlogPost::load");
return;
}
示例3: getPermissionName
/**
* @return string
*/
public function getPermissionName()
{
if ($this->getPerUid() == '') {
throw new Exception("Error in getPerName, the PER_UID can't be blank");
}
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->permission_name = Content::load('PER_NAME', '', $this->getPerUid(), $lang);
return $this->permission_name;
}
示例4: getGrpTitle
/**
* Get the [grp_title] column value.
*
* @return string
*/
public function getGrpTitle()
{
if ($this->getGrpUid() == '') {
throw new Exception("Error in getGrpTitle, the GRP_UID can't be blank");
}
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->grp_title = Content::load('GRP_TITLE', '', $this->getGrpUid(), $lang);
return $this->grp_title;
}
示例5: getEvnDescription
/**
* Get the evn_description column value.
* @return string
*/
public function getEvnDescription()
{
if ($this->getEvnUid() == "") {
throw new Exception("Error in getEvnDescription, the getEvnUid() can't be blank");
}
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->evn_description = Content::load('EVN_DESCRIPTION', '', $this->getEvnUid(), $lang);
return $this->evn_description;
}
示例6: getRepTabTitle
/**
* Get the rep_tab_title column value.
* @return string
*/
public function getRepTabTitle()
{
if ($this->getRepTabUid() == "") {
throw new Exception("Error in getRepTabTitle, the getRepTabUid() can't be blank");
}
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->rep_tab_title = Content::load('REP_TAB_TITLE', '', $this->getRepTabUid(), $lang);
return $this->rep_tab_title;
}
示例7: getStgTitle
/**
* Get the stg_title column value.
* @return string
*/
public function getStgTitle()
{
if ($this->getStgUid() == "") {
throw new Exception("Error in getStgTitle, the getStgUid() can't be blank");
}
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$this->stg_title = Content::load('STG_TITLE', '', $this->getStgUid(), $lang);
return $this->stg_title;
}
示例8: getNotesList
/**
* Get Notes List
*
* @param int $httpData->start
* @param int $httpData->limit
* @param string $httpData->appUid (optionalif it is not passed try use $_SESSION['APPLICATION'])
* @return array containg the case notes
*/
function getNotesList($httpData)
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode($response);
die;
}
$appUid = null;
if (isset($httpData->appUid) && trim($httpData->appUid) != "") {
$appUid = $httpData->appUid;
} else {
if (isset($_SESSION['APPLICATION'])) {
$appUid = $_SESSION['APPLICATION'];
}
}
G::LoadClass('case');
$case = new Cases();
$caseLoad = '';
if (!isset($_SESSION['PROCESS']) && !isset($httpData->pro)) {
$caseLoad = $case->loadCase($appUid);
$httpData->pro = $caseLoad['PRO_UID'];
}
if (!isset($httpData->pro) || empty($httpData->pro)) {
$proUid = $_SESSION['PROCESS'];
} else {
$proUid = $httpData->pro;
}
if (!isset($httpData->tas) || empty($httpData->tas)) {
$tasUid = $_SESSION['TASK'];
} else {
$tasUid = $httpData->tas;
}
//$proUid = (!isset($httpData->pro)) ? $_SESSION['PROCESS'] : $httpData->pro;
//$tasUid = (!isset($httpData->tas)) ? ((isset($_SESSION['TASK'])) ? $_SESSION['TASK'] : '') : $httpData->tas;
$usrUid = $_SESSION['USER_LOGGED'];
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
$respBlock = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'BLOCK');
if ($respView['CASES_NOTES'] == 0 && $respBlock['CASES_NOTES'] == 0) {
return array('totalCount' => 0, 'notes' => array(), 'noPerms' => 1);
}
//require_once ("classes/model/AppNotes.php");
if (!isset($appUid)) {
throw new Exception(G::LoadTranslation('ID_RESOLVE_APPLICATION_ID'));
}
$usrUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : "";
$appNotes = new AppNotes();
$response = $appNotes->getNotesList($appUid, '', $httpData->start, $httpData->limit);
require_once "classes/model/Content.php";
$content = new Content();
$response['array']['appTitle'] = $content->load('APP_TITLE', '', $appUid, SYS_LANG);
return $response['array'];
}
示例9: load
/**
* load Video data in the object
* @access public
* @param content id of the Video.
* @param $user_id user id of the person who is accessing data
* @param $my_user_id user id of the person whose data is loading
*/
public function load($content_id, $user_id = 0, $my_user_id = 0)
{
Logger::log("Enter: Video::load | Arg: \$content_id = {$content_id}");
Logger::log("Calling: Content::load | Param: \$content_id = {$content_id}");
parent::load($content_id);
$sql = "SELECT * FROM {videos} WHERE content_id = {$this->content_id}";
$res = Dal::query($sql);
if ($res->numRows() > 0) {
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
if ($my_user_id != 0) {
// getting degree 1 friendlist
$relations = Relation::get_relations($user_id, APPROVED, PA::$network_info->network_id);
if ($user_id == $my_user_id) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
} elseif (in_array($my_user_id, $relations)) {
if ($row->video_perm == WITH_IN_DEGREE_1 || $row->video_perm == ANYONE) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
}
} elseif ($my_user_id == 0) {
if ($row->video_perm == WITH_IN_DEGREE_1 || $row->video_perm == ANYONE) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
}
} else {
if ($row->video_perm == ANYONE) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
}
}
} else {
if ($user_id == $my_user_id) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
} else {
if ($row->video_perm == ANYONE) {
$this->video_file = $row->video_file;
$this->file_name = $row->video_file;
$this->file_perm = $row->video_perm;
}
}
}
}
Logger::log("Exit: Video::load");
return;
}
示例10: load
/**
* load Announcement data in the object
* @access public
* @param content id of the Announcement.
*/
public function load($content_id)
{
Logger::log(" Enter: Announcement::load | Arg: \$content_id = {$content_id}");
Logger::log(" Calling: Content::load | Param: \$content_id = {$content_id}");
parent::load($content_id);
$sql = "SELECT * FROM {announcements} WHERE content_id = {$this->content_id}";
$res = Dal::query($sql);
if ($res->numRows() > 0) {
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
$this->announcement_time = $row->announcement_time;
$this->position = $row->position;
$this->status = $row->status;
}
Logger::log("Exit: Announcement::load");
return;
}
示例11: TQuickForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TQuickForm('form_Content');
$this->form->class = 'tform';
$this->form->style = 'width: 640px';
$this->form->setFormTitle(_t('Content'));
// defines the database
parent::setDatabase('blog');
// defines the active record
parent::setActiveRecord('Content');
// create the form fields
$id = new TEntry('id');
$title = new TEntry('title');
$subtitle = new TText('subtitle');
$sidepanel = new THtmlEditor('sidepanel');
$id->setEditable(FALSE);
// add the fields
$this->form->addQuickField('ID', $id, 100);
$this->form->addQuickField(_t('Title'), $title, 500);
$this->form->addQuickField(_t('Subtitle'), $subtitle, 400);
$row = $this->form->getContainer()->addRow();
$row->addCell($lbl = new TLabel(_t('Side panel')));
$lbl->setFontStyle('b');
$sidepanel->style = 'margin: 10px';
$row = $this->form->getContainer()->addRow();
$row->addCell($sidepanel)->colspan = 2;
$this->form->addField($sidepanel);
$subtitle->setSize(500, 40);
$sidepanel->setSize(590, 200);
// define the form action
$this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
TTransaction::open('blog');
$content = new Content();
if ($content->load(1)) {
$this->onEdit(array('key' => 1));
}
TTransaction::close();
// add the form to the page
parent::add($this->form);
}
示例12: LoadContent
function LoadContent($data, $fields)
{
$obj = new Content();
$ConCategory = $fields['CON_CATEGORY'];
$ConParent = $fields['CON_PARENT'];
$ConId = $fields['CON_ID'];
$ConLang = $fields['CON_LANG'];
$ConValue = $fields['CON_VALUE'];
try {
$res = $obj->load($ConCategory, $ConParent, $ConId, $ConLang);
if ($res == '') {
$this->testLime->is($res, '', 'Load Empty Content ');
} else {
$this->testLime->is($ConValue, $ConValue, 'correct value from Content->Load ');
}
} catch (Exception $e) {
return $e;
}
return $res;
}
示例13: load
/**
* load sb content in the object
* @access public
*/
public function load($content_id)
{
Logger::log("Enter: SBMicroContent::load | Arg: \$content_id = {$content_id}");
Logger::log("Calling: Content::load | Param: \$content_id = {$content_id}");
parent::load($content_id);
$sql = "SELECT SB.sbtype_id,SB.name FROM {sbmicrocontent_types} AS SB,{contents_sbmicrocontents} AS MC WHERE MC.content_id = ? AND MC.microcontent_id = SB.sbtype_id";
$data = array($content_id);
$res = Dal::query($sql, $data);
if (PEAR::isError($res)) {
Logger::log(" Throwing exception DB_QUERY_FAILED | Message: {$res->getMessage}()", LOGGER_ERROR);
throw new PAException(DB_QUERY_FAILED, $res->getMessage());
}
if ($res->numRows()) {
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
$this->sbtype_id = $row->sbtype_id;
$this->sbname = stripslashes($row->name);
}
Logger::log("Exit: SBMicrocontent::load");
return;
}
示例14: regenerateContent
function regenerateContent($langId)
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ContentPeer::CON_CATEGORY);
$oCriteria->addSelectColumn(ContentPeer::CON_ID);
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
$oCriteria->add(ContentPeer::CON_LANG, 'en');
$oCriteria->add(ContentPeer::CON_VALUE, '', Criteria::NOT_EQUAL);
$oDataset = ContentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$oContent = new Content();
while ($aRow = $oDataset->getRow()) {
$oContent->load($aRow['CON_CATEGORY'], '', $aRow['CON_ID'], $langId);
$oDataset->next();
}
}
示例15: load
/**
This function get all the video for a network
if we pass cat_id for that than it return all the video for that category
*/
public function load($cid)
{
Logger::log("Enter: TekVideo::load()");
if (!isset($cid)) {
$cid = NULL;
}
$sql = 'SELECT * FROM {media_videos} WHERE content_id = ?';
$res = Dal::query($sql, $cid);
$result_array = array();
if ($res->numRows()) {
while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
if (!empty($row->video_id)) {
$this->verify_status($row->video_id, $row->content_id, $row->status);
}
$this->video_id = $row->video_id;
$this->status = $row->status;
$this->external_thumbnail = $row->external_thumbnail;
$this->internal_thumbnail = $row->internal_thumbnail;
$this->views = $row->views;
/* $this->embed_tag = get_embed_tag($row->video_id);*/
$this->view_url = $row->view_url;
$this->duration = $row->duration;
$this->category_id = $row->category_id;
$this->content_id = $row->content_id;
$this->author_id = $row->author_id;
$this->video_perm = $row->video_perm;
$this->file_perm = $row->video_perm;
parent::load($row->content_id);
$result_array[] = $row;
}
}
Logger::log("Exit: TekVideo::load()");
return $result_array;
}