本文整理汇总了PHP中Prado类的典型用法代码示例。如果您正苦于以下问题:PHP Prado类的具体用法?PHP Prado怎么用?PHP Prado使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Prado类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setup
function setup()
{
parent::setup();
$app = Prado::getApplication();
$this->userDao = $app->getModule('daos')->getDao('UserDao');
$this->flushDatabase();
}
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:UserDaoTestCase.php
示例2: onLoad
public function onLoad($param)
{
$this->Page->Title = Prado::localize('NewCustomer');
$this->content->Visible = true;
$this->reg_ok->Visible = false;
$this->Save->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/save.gif';
$this->btnCancelSelect->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/cancel.gif';
if (isset($_GET["status"])) {
$this->content->Visible = false;
$this->reg_ok->Visible = true;
}
if ($this->User->UserDB->type_user_id == 4) {
$this->Save->Visible = false;
$this->btnCancelSelect->Visible = false;
} else {
$this->Save->Visible = true;
$this->btnCancelSelect->Visible = true;
}
$criteria = new TActiveRecordCriteria();
$criteria->OrdersBy['id'] = 'desc';
$classifiche = TblClassifica::finder()->findAll($criteria);
$this->DDLClassifica->DataSource = $classifiche;
$this->DDLClassifica->dataBind();
$this->DDLClassifica->SelectedValue = 1;
}
开发者ID:bailey-ann,项目名称:stringtools,代码行数:25,代码来源:NewCustomer.php
示例3: getCache
protected function getCache()
{
if (!$this->_cache) {
$this->_cache = Prado::getApplication()->getCache();
}
return $this->_cache;
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:7,代码来源:TFastSqlMapApplicationCache.php
示例4: run
/**
* Runs the service.
* This method is invoked by application automatically.
*/
public function run()
{
$id = $this->getRequest()->getServiceParameter();
if (isset($this->_feeds[$id])) {
$feedConfig = $this->_feeds[$id];
$properties = $feedConfig->getAttributes();
if (($class = $properties->remove('class')) !== null) {
$feed = Prado::createComponent($class);
if ($feed instanceof IFeedContentProvider) {
// init feed properties
foreach ($properties as $name => $value) {
$feed->setSubproperty($name, $value);
}
$feed->init($feedConfig);
$content = $feed->getFeedContent();
//$this->getResponse()->setContentType('application/rss+xml');
$this->getResponse()->setContentType($feed->getContentType());
$this->getResponse()->write($content);
} else {
throw new TConfigurationException('feedservice_feedtype_invalid', $id);
}
} else {
throw new TConfigurationException('feedservice_class_required', $id);
}
} else {
throw new THttpException(404, 'feedservice_feed_unknown', $id);
}
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:32,代码来源:TFeedService.php
示例5: getDecorator
/**
* @return TWebControlDecorator
*/
public function getDecorator($create = true)
{
if ($create && !$this->_decorator) {
$this->_decorator = Prado::createComponent('TWebControlDecorator', $this);
}
return $this->_decorator;
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:10,代码来源:TWebControl.php
示例6: getData
protected function getData()
{
$d = array();
$cmd = $this->db->createCommand("SELECT * FROM hr_config WHERE id=1");
$query = $cmd->query();
$data = $query->read();
$dir = $data['log_path'];
if (file_exists($dir)) {
if (!is_readable($dir)) {
$this->displayMessage(Prado::localize('The directory {dir} is not readable', array("dir" => $dir)), false);
return false;
}
} else {
$this->displayMessage(Prado::localize('The directory {dir} does not exist', array("dir" => $dir)), false);
return false;
}
$list = scandir($dir);
$i = 0;
foreach ($list as $l) {
if ($l != "." && $l != "..") {
$d[$i]['Value'] = "./horuxlog/" . $l;
$d[$i++]['Text'] = $l;
}
}
return $d;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:26,代码来源:logviewer.php
示例7: insertBrick
function insertBrick($sender, $param)
{
$x = Prado::createComponent("Application.pages.LTemplate");
$x->Size = $sender->NamingContainer->findControl("MySize")->SelectedValue;
$this->placeholder->getControls()->add($x);
$this->Page->CallbackClient->insertContentAfter($this->AjaxInsertPoint, $x);
}
开发者ID:Nurudeen,项目名称:prado,代码行数:7,代码来源:ActiveBricksTest.php
示例8: displayHardwareList
public function displayHardwareList()
{
$path = './protected/pages/hardware/device/';
$files = scandir($path);
$types = array();
foreach ($files as $f) {
if ($f != '..' && $f != '.' && $f != '.svn' && is_dir($path . $f)) {
$t = explode("_", $f);
$type = $t;
unset($type[0]);
$types[$t[0]][] = implode("_", $type);
}
}
$html = '<ul id="menu-item" class="jtree">';
foreach ($types as $k => $v) {
$html .= '<li id="internal-node">';
$html .= '<div class="node-open"><span></span>';
$html .= Prado::localize("{type} technology", array('type' => $k));
$html .= '</div><ul>';
foreach ($v as $k2 => $v2) {
$html .= '<li>';
$html .= '<div class="leaf"><span></span>';
$html .= '<a href="' . $this->Service->constructUrl('hardware.device.' . $k . '_' . $v2 . '.add') . '">' . $v2 . '</a>';
$html .= '</div>';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</li>';
}
$html .= '</ul>';
return $html;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:32,代码来源:HardwareAddList.php
示例9: onLoad
public function onLoad($param)
{
$this->Page->Title = Prado::localize('Confirm');
$id = 0;
$code = "";
if (isset($_GET["id"])) {
$id = $_GET["id"];
}
if (isset($_GET["code"])) {
$code = $_GET["code"];
}
if ($id != 0 && $code != "") {
$user = TblUsers::finder()->findBy_id($id);
if ($user != null) {
if ($user->active == 1) {
$this->result->Text = Prado::localize('USER_ALREADY_ACTIVE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
} else {
if ($user->confirm_code != $code) {
$this->result->Text = Prado::localize('USER_WRONG_CODE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
} else {
$user->active = 1;
$user->save();
$this->result->Text = Prado::localize('ACTIVATION_OK');
}
}
} else {
$this->result->Text = Prado::localize('USER_NOT_EXIST') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
}
} else {
}
}
开发者ID:bailey-ann,项目名称:stringtools,代码行数:31,代码来源:Confirm.php
示例10: getThumbnailGenerator
protected function getThumbnailGenerator()
{
if (is_null($this->_thumbnailGen)) {
$this->_thumbnailGen = Prado::createComponent($this->getThumbnailGeneratorClass());
}
return $this->_thumbnailGen;
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:7,代码来源:ThumbnailManager.php
示例11: editRow
public function editRow($sender, $param)
{
if ($this->IsValid) {
$finder = SliderRecord::finder();
$finder->DbConnection->Active = true;
$transaction = $finder->DbConnection->beginTransaction();
try {
$rows = $finder->findByID($this->getRequest()->itemAt("id"));
$rows->Name = TPropertyValue::ensureString($this->Name->getSafeText());
$rows->Description = TPropertyValue::ensureString($this->Description->getText());
$rows->save();
$baseMethod = new BaseFunction();
$d = dir($baseMethod->UploadFilePath);
while ($entry = $d->read()) {
if (strlen($entry) > 2 && is_file($d->path . '/' . $entry) && $entry != '.htaccess') {
$namePhoto = strtolower($entry);
$rowPhoto = SliderRecord::finder()->findByID($this->getRequest()->itemAt("id"));
$rowPhoto->Photo = $namePhoto;
$rowPhoto->save();
copy($baseMethod->UploadFilePath . $entry, Prado::getPathOfAlias('UserFiles') . '/Slider/' . $namePhoto) or die("Błąd przy kopiowaniu");
}
}
$d->close();
$transaction->commit();
$this->Response->redirect($this->Service->constructUrl("Slider.Index", array("id" => $this->getRequest()->itemAt("id"))));
} catch (Exception $e) {
$transaction->rollBack();
die;
}
}
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:31,代码来源:Index.php
示例12: createInstanceOf
/**
* Creates a new instance of a particular class (for PHP primative types,
* their corresponding default value for given type is used).
* @param string PHP type name
* @return mixed default type value, if no type is specified null is returned.
* @throws TSqlMapException if class name is not found.
*/
public function createInstanceOf($type = '')
{
if (strlen($type) > 0) {
switch (strtolower($type)) {
case 'string':
return '';
case 'array':
return array();
case 'float':
case 'double':
case 'decimal':
return 0.0;
case 'integer':
case 'int':
return 0;
case 'bool':
case 'boolean':
return false;
}
if (class_exists('Prado', false)) {
return Prado::createComponent($type);
} else {
if (class_exists($type, false)) {
//NO auto loading
return new $type();
} else {
throw new TSqlMapException('sqlmap_unable_to_find_class', $type);
}
}
}
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:38,代码来源:TSqlMapTypeHandlerRegistry.php
示例13: getData
protected function getData($offset, $limit)
{
$session = Prado::getApplication()->getSession();
$langID = $session->itemAt('jezyk');
$this->DataGrid->DataSource = PagesRecord::finder()->findAll('LanguageID = ? AND PageID = 19 ORDER BY Position', $langID);
return $this->DataGrid->dataBind();
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:7,代码来源:Data.php
示例14: onDefault
public function onDefault($sender, $param)
{
$cbs = $this->findControlsByType("TActiveCheckBox");
$nDelete = 0;
$koMsg = '';
$cbChecked = 0;
foreach ($cbs as $cb) {
if ((bool) $cb->getChecked() && $cb->Value != "0") {
$cbChecked++;
}
}
if ($cbChecked == 0) {
$koMsg = Prado::localize('Select one item');
} elseif ($cbChecked == 1) {
foreach ($cbs as $cb) {
if ((bool) $cb->getChecked() && $cb->Value != "0") {
$cmd = $this->db->createCommand("UPDATE hr_install SET `default`='0' WHERE type='template'");
$cmd->execute();
$cmd = $this->db->createCommand("UPDATE hr_install SET `default`='1' WHERE id=:id");
$cmd->bindValue(":id", $cb->Value);
$cmd->execute();
}
}
} else {
$koMsg = Prado::localize('Select only one item');
}
if ($koMsg !== '') {
$pBack = array('koMsg' => $koMsg);
} else {
$pBack = array('okMsg' => Prado::localize('New default template updated'));
}
$this->Response->redirect($this->Service->constructUrl('installation.template', $pBack));
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:33,代码来源:template.php
示例15: rollback
/**
* Rolls back a transaction.
* @throws TDbException if the transaction or the DB connection is not active.
*/
public function rollback()
{
if ($this->_compatible) {
$this->getConnection()->setForceMaster(TMasterSlaveDbConnectionForceMaster::OFF_AUTOMATIC);
}
Prado::log('rollback, ForceMaster: OFF_AUTOMATIC', TLogger::DEBUG, 'System.Testing.Data.Distributed.MasterSlave.TMasterSlaveDbTransaction');
parent::rollback();
}
开发者ID:quantrocket,项目名称:planlogiq,代码行数:12,代码来源:TMasterSlaveDbTransaction.php
示例16: fileDelete
public function fileDelete($sender, $param)
{
if ($this->pathName[1] == 'Index') {
FilesRecord::finder()->deleteByID($param->CommandName);
unlink(Prado::getPathOfAlias('UserFiles') . '/' . $this->pathName[0] . '/' . $this->getRequest()->itemAt("id") . '/' . $param->CommandParameter);
}
$this->Response->redirect($this->Service->constructUrl($this->pathName[0] . ".Index", array("id" => $this->getRequest()->itemAt("id"))));
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:8,代码来源:GalleryAdminBox.php
示例17: getShortLang
public function getShortLang()
{
$source = Prado::getApplication()->getGlobalization();
if (Prado::getApplication()->getRequest()->contains('culture')) {
$source->setCulture(Prado::getApplication()->getRequest()->itemAt('culture'));
}
return $source->getCulture();
}
开发者ID:venomproject,项目名称:defaultCMS,代码行数:8,代码来源:BaseFunction.php
示例18: setup
function setup()
{
parent::setup();
$app = Prado::getApplication();
$this->categoryDao = $app->getModule('daos')->getDao('CategoryDao');
$this->projectDao = $app->getModule('daos')->getDao('ProjectDao');
$this->flushDatabase();
}
开发者ID:Nurudeen,项目名称:prado,代码行数:8,代码来源:CategoryDaoTestCase.php
示例19: button2_onclick
function button2_onclick($sender, $param)
{
$this->label1->Text = "Button 1 was clicked ";
$this->label1->Text .= $this->foo->Text;
$x = Prado::createComponent('Application.pages.CustomTemplateComponent');
$this->placeholder->getControls()->add($x);
$this->placeholder->dataBind();
}
开发者ID:Nurudeen,项目名称:prado,代码行数:8,代码来源:CustomTemplateControlTest.php
示例20: createNewInstance
/**
* Creates a new instance of TimeTrackerUser
* @param array result data
* @return TimeTrackerUser new user instance
*/
public function createNewInstance($row = null)
{
$manager = Prado::getApplication()->getModule('users');
if (is_null($manager)) {
$manager = new UserManager();
}
return new TimeTrackerUser($manager);
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:13,代码来源:TimeTrackerUserTypeHandler.php
注:本文中的Prado类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论