本文整理汇总了PHP中TPropertyValue类的典型用法代码示例。如果您正苦于以下问题:PHP TPropertyValue类的具体用法?PHP TPropertyValue怎么用?PHP TPropertyValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TPropertyValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: changePageSize
public function changePageSize($sender, $param)
{
$this->DataGrid->PageSize = TPropertyValue::ensureInteger($this->PageSize->Text);
$this->DataGrid->CurrentPageIndex = 0;
$this->DataGrid->DataSource = $this->Data;
$this->DataGrid->dataBind();
}
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:Sample5.php
示例2: setTotalRowCount
public function setTotalRowCount($value)
{
if (($value = TPropertyValue::ensureInteger($value)) < 0) {
$value = 0;
}
$this->_totalRowCount = $value;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:7,代码来源:TDataSourceView.php
示例3: createParameter
private function createParameter($id, $value)
{
$element = new TXmlElement('parameter');
$element->Attributes['id'] = $id;
$element->Attributes['value'] = TPropertyValue::ensureString($value);
return $element;
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:7,代码来源:ConfigMan.php
示例4: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$rows = new nNewsletterRecord();
$rows->Name = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->Status = 0;
$rows->save();
$lay = new nLayoutRecord();
//$lay->PlaneText = TPropertyValue::ensureString ( $this->PlaneText->getText () );
$lay->HtmlText = TPropertyValue::ensureString($this->HtmlText->getText());
$lay->nNewsletterID = $rows->ID;
$lay->save();
$mailList = explode(";", $this->SendDescription->getText());
foreach ($mailList as $email) {
if (filter_var(trim($email), FILTER_VALIDATE_EMAIL)) {
if (!nSenderRecord::finder()->findBy_nLayoutID_AND_Email($lay->ID, trim($email))) {
$send = new nSenderRecord();
$send->Email = trim($email);
$send->Status = 0;
$send->nLayoutID = $lay->ID;
$send->save();
}
}
}
$this->Response->redirect($this->Service->constructUrl("Newsletter.Data"));
}
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:27,代码来源:Add.php
示例5: getPageSize
private function getPageSize()
{
if (($limit = TPropertyValue::ensureInteger($this->Request['limit'])) <= 0) {
$limit = TPropertyValue::ensureInteger($this->Application->Parameters['PostPerPage']);
}
return $limit;
}
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:SearchPost.php
示例6: init
/**
* Initialize the TTranslate translation components
*/
public static function init($catalogue = 'messages')
{
static $saveEventHandlerAttached = false;
//initialized the default class wide formatter
if (!isset(self::$formatters[$catalogue])) {
$app = Prado::getApplication()->getGlobalization();
$config = $app->getTranslationConfiguration();
$source = MessageSource::factory($config['type'], $config['source'], $config['filename']);
$source->setCulture($app->getCulture());
if (TPropertyValue::ensureBoolean($config['cache'])) {
$source->setCache(new MessageCache($config['cache']));
}
self::$formatters[$catalogue] = new MessageFormat($source, $app->getCharset());
//mark untranslated text
if ($ps = $config['marker']) {
self::$formatters[$catalogue]->setUntranslatedPS(array($ps, $ps));
}
//save the message on end request
// Do it only once !
if (!$saveEventHandlerAttached && TPropertyValue::ensureBoolean($config['autosave'])) {
Prado::getApplication()->attachEventHandler('OnEndRequest', array('Translation', 'saveMessages'));
$saveEventHandlerAttached = true;
}
}
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:28,代码来源:Translation.php
示例7: saveButtonClicked
public function saveButtonClicked($sender, $param)
{
if ($this->IsValid) {
$postRecord = new PostRecord();
$postRecord->Title = $this->Title->SafeText;
$postRecord->Content = $this->Content->SafeText;
if ($this->DraftMode->Checked) {
$postRecord->Status = PostRecord::STATUS_DRAFT;
} else {
if (!$this->User->IsAdmin && TPropertyValue::ensureBoolean($this->Application->Parameters['PostApproval'])) {
$postRecord->Status = PostRecord::STATUS_PENDING;
} else {
$postRecord->Status = PostRecord::STATUS_PUBLISHED;
}
}
$postRecord->CreateTime = time();
$postRecord->ModifyTime = $postRecord->CreateTime;
$postRecord->AuthorID = $this->User->ID;
$cats = array();
foreach ($this->Categories->SelectedValues as $value) {
$cats[] = TPropertyValue::ensureInteger($value);
}
$this->DataAccess->insertPost($postRecord, $cats);
$this->gotoPage('Posts.ViewPost', array('id' => $postRecord->ID));
}
}
开发者ID:Nurudeen,项目名称:prado,代码行数:26,代码来源:NewPost.php
示例8: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$finder = CatalogueRecord::finder();
$finder->DbConnection->Active = true;
$transaction = $finder->DbConnection->beginTransaction();
try {
$rows = $finder->findBycat_id($this->getRequest()->itemAt("id"));
$rows->MasterName = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->ShortName = TPropertyValue::ensureString($this->ShortName->getSafeText());
$baseMethod = new BaseFunction();
$d = dir($baseMethod->UploadFilePath);
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry) && $entry != '.htaccess') {
copy($baseMethod->UploadFilePath . $entry, Prado::getPathOfAlias('UserFiles') . '/Language/' . $this->getRequest()->itemAt("id") . '/' . $entry) or die("Błąd przy kopiowaniu");
$rows->Photo = $entry;
}
}
$d->close();
$rows->save();
$transaction->commit();
$this->Response->redirect($this->Service->constructUrl("Language.Index", array("id" => $this->getRequest()->itemAt("id"))));
} catch (Exception $e) {
$transaction->rollBack();
}
}
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:27,代码来源:Index.php
示例9: setDecayRate
/**
* Sets the decay rate between callback. Default is 0;
* @param float decay rate between callbacks.
*/
public function setDecayRate($value)
{
$decay = TPropertyValue::ensureFloat($value);
if ($decay < 0) {
throw new TConfigurationException('callback_decay_be_not_negative', $this->getID());
}
$this->setViewState('Decay', $decay);
}
开发者ID:bailey-ann,项目名称:stringtools,代码行数:12,代码来源:TValueTriggeredCallback.php
示例10: setHistorySize
/**
* @param integer maximum number of page states that should be kept in session
* @throws TInvalidDataValueException if the number is smaller than 1.
*/
public function setHistorySize($value)
{
if (($value = TPropertyValue::ensureInteger($value)) > 0) {
$this->_historySize = $value;
} else {
throw new TInvalidDataValueException('sessionpagestatepersister_historysize_invalid');
}
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:12,代码来源:TSessionPageStatePersister.php
示例11: getCategoryFilter
private function getCategoryFilter()
{
if (($catID = $this->Request['cat']) !== null) {
$catID = TPropertyValue::ensureInteger($catID);
return "category_id={$catID}";
} else {
return '';
}
}
开发者ID:Nurudeen,项目名称:prado,代码行数:9,代码来源:ListPost.php
示例12: onInit
public function onInit($param)
{
parent::onInit($param);
$id = TPropertyValue::ensureInteger($this->Request['id']);
$this->_category = $this->DataAccess->queryCategoryByID($id);
if ($this->_category === null) {
throw new BlogException(500, 'category_id_invalid', $id);
}
}
开发者ID:Nurudeen,项目名称:prado,代码行数:9,代码来源:EditCategory.php
示例13: createBooleanControl
protected function createBooleanControl($container, $column, $record)
{
$value = $this->getRecordPropertyValue($column, $record);
$control = new TCheckBox();
$control->setChecked(TPropertyValue::ensureBoolean($value));
$control->setCssClass('boolean-checkbox');
$this->setDefaultProperty($container, $control, $column, $record);
return $control;
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:9,代码来源:TScaffoldInputCommon.php
示例14: saveItem
public function saveItem($sender, $param)
{
$item = $param->Item;
$postID = $this->PostGrid->DataKeys[$item->ItemIndex];
$postRecord = $this->DataAccess->queryPostByID($postID);
$postRecord->Status = TPropertyValue::ensureInteger($item->Cells[2]->PostStatus->SelectedValue);
$this->DataAccess->updatePost($postRecord);
$this->PostGrid->EditItemIndex = -1;
$this->bindData();
}
开发者ID:Nurudeen,项目名称:prado,代码行数:10,代码来源:PostMan.php
示例15: loadTestTemplate
public function loadTestTemplate($sender, $param)
{
$c = new TestTemplate();
$this->Content->Controls[] = $c;
$c->dataBind();
$this->Content->render($param->newWriter);
$value = $this->Page->getControlState('WebgisDynamicControls');
$value[] = array('classname' => get_class($c), 'args' => null);
$this->Page->setControlState('WebgisDynamicControls', TPropertyValue::ensureArray($value), 0);
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:10,代码来源:TestLayout.php
示例16: saveItem
public function saveItem($sender, $param)
{
$item = $param->Item;
$userID = $this->UserGrid->DataKeys[$item->ItemIndex];
$userRecord = $this->DataAccess->queryUserByID($userID);
$userRecord->Role = TPropertyValue::ensureInteger($item->Cells[1]->UserRole->SelectedValue);
$userRecord->Status = TPropertyValue::ensureInteger($item->Cells[2]->UserStatus->SelectedValue);
$this->DataAccess->updateUser($userRecord);
$this->UserGrid->EditItemIndex = -1;
$this->bindData();
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:11,代码来源:UserMan.php
示例17: selectLevel
public function selectLevel($sender, $param)
{
if (($selection = $this->LevelSelection->SelectedValue) === '') {
$this->LevelError->Visible = true;
return;
} else {
$this->Level = TPropertyValue::ensureInteger($selection);
}
$this->Word = $this->generateWord();
$this->GuessWord = str_repeat('_', strlen($this->Word));
$this->Misses = 0;
$this->GameMultiView->ActiveView = $this->GuessView;
}
开发者ID:Nurudeen,项目名称:prado,代码行数:13,代码来源:Home.php
示例18: onInit
public function onInit($param)
{
parent::onInit($param);
if (($id = $this->Request['id']) !== null) {
$id = TPropertyValue::ensureInteger($id);
} else {
$id = $this->User->ID;
}
if (($this->_userRecord = $this->DataAccess->queryUserByID($id)) === null) {
throw new BlogException(500, 'profile_id_invalid', $id);
}
$this->_userRecord->Email = strtr(strtoupper($this->_userRecord->Email), array('@' => ' at ', '.' => ' dot '));
}
开发者ID:Nurudeen,项目名称:prado,代码行数:13,代码来源:ViewUser.php
示例19: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$commentLimit = TPropertyValue::ensureInteger($this->Application->Parameters['RecentComments']);
$comments = $this->Application->getModule('data')->queryComments('', 'ORDER BY create_time DESC', "LIMIT {$commentLimit}");
foreach ($comments as $comment) {
$comment->ID = $this->Service->constructUrl('Posts.ViewPost', array('id' => $comment->PostID)) . '#c' . $comment->ID;
if (strlen($comment->Content) > 40) {
$comment->Content = substr($comment->Content, 0, 40) . ' ...';
}
}
$this->CommentList->DataSource = $comments;
$this->CommentList->dataBind();
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:14,代码来源:CommentPortlet.php
示例20: onInit
public function onInit($param)
{
parent::onInit($param);
if (($id = $this->Request['id']) !== null) {
$id = TPropertyValue::ensureInteger($id);
if (!$this->User->IsAdmin && $this->User->ID !== $id) {
throw new BlogException(500, 'profile_edit_disallowed', $id);
}
} else {
$id = $this->User->ID;
}
if (($this->_userRecord = $this->DataAccess->queryUserByID($id)) === null) {
throw new BlogException(500, 'profile_id_invalid', $id);
}
}
开发者ID:bklein01,项目名称:prado,代码行数:15,代码来源:EditUser.php
注:本文中的TPropertyValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论