示例#1
0
 protected function Form_Create()
 {
     if (!QApplication::$Login) {
         QApplication::Redirect('/');
     }
     $this->objQcodoClass = QcodoClass::Load(QApplication::PathInfo(0));
     if (!$this->objQcodoClass) {
         throw new Exception('Invalid QcodoClass Id: ' . QApplication::PathInfo(0));
     }
     $this->lblName = new QLabel($this);
     $this->lblName->Text = $this->objQcodoClass->Name;
     $this->lstClassGroup = new QListBox($this);
     $this->lstClassGroup->Name = 'Class Group/Classification';
     foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objClassGroup) {
         $this->lstClassGroup->AddItem($objClassGroup->Name, $objClassGroup->Id, $objClassGroup->Id == $this->objQcodoClass->ClassGroupId);
     }
     $this->chkEnumerationFlag = new QCheckBox($this);
     $this->chkEnumerationFlag->Checked = $this->objQcodoClass->EnumerationFlag;
     $this->chkEnumerationFlag->Name = 'Enumeration Class Flag';
     $this->txtShortDescription = new QTextBox($this);
     $this->txtShortDescription->Name = QApplication::Translate('Short Description');
     $this->txtShortDescription->Text = $this->objQcodoClass->ShortDescription;
     $this->txtShortDescription->TextMode = QTextMode::MultiLine;
     $this->txtExtendedDescription = new QWriteBox($this);
     $this->txtExtendedDescription->Name = QApplication::Translate('Extended Description');
     $this->txtExtendedDescription->Text = $this->objQcodoClass->ExtendedDescription;
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click'));
     $this->btnCancel->CausesValidation = false;
 }
示例#2
0
文件: index.php 项目: qcodo/qcodo-api
 protected function Form_Create()
 {
     $this->btnThis = new QButton($this);
     $this->btnThis->AddAction(new QClickEvent(), new QServerAction());
     $this->objDefaultWaitIcon = new QWaitIcon($this, 'spinner');
     $this->pnlDocumentation = new QPanel($this);
     $this->pnlDocumentation->AutoRenderChildren = true;
     $this->lblSelector = new QLabel($this, 'lblSelector');
     $this->lblSelector->AddAction(new QChangeEvent(), new QAjaxAction('lblSelector_Change'));
     $this->tnvNavigation = new QTreeNav($this);
     $this->tnvNavigation->ItemWidth = 350;
     foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objGroup) {
         $objGroupItem = new QTreeNavItem($objGroup->Name, null, false, $this->tnvNavigation, 'g' . $objGroup->Id);
         foreach ($objGroup->GetQcodoClassArray(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objClass) {
             $objItem = new TreeNavItemCustom($objClass->DisplayName, $objClass->Id, false, $objGroupItem, $objClass->Id);
             if ($objClass->FileId) {
                 if (!$objClass->EnumerationFlag) {
                     $objItemMethods = new QTreeNavItem('Methods', $objClass->Id . 'm', false, $objItem, $objClass->Id . 'm');
                     $objItemProperties = new QTreeNavItem('Properties', $objClass->Id . 'p', false, $objItem, $objClass->Id . 'p');
                     $objItemVariables = new QTreeNavItem('Member Variables', $objClass->Id . 'v', false, $objItem, $objClass->Id . 'v');
                 }
                 if ($objClass->CountQcodoConstants()) {
                     $objItemConstants = new QTreeNavItem('Constants', $objClass->Id . 'c', false, $objItem, $objClass->Id . 'c');
                 }
             }
         }
     }
     $this->tnvNavigation->AddAction(new QChangeEvent(), new QAjaxAction('tnvNavigation_Change'));
     if (QApplication::PathInfo(0)) {
         $this->SelectItem($this->GetItemId(QApplication::PathInfo(0), QApplication::PathInfo(1), QApplication::PathInfo(2)));
     }
     if (QApplication::$LoginForDisplay) {
         $this->strMembershipInfo = 'Welcome, ' . QApplication::$LoginForDisplay->__toString() . '<br/>';
         $this->strMembershipInfo .= '<a href="http://www.qcodo.com/members/index.php/1" class="top_member_nav_link">Log Out</a> &nbsp;|&nbsp; <a href="http://www.qcodo.com/members/profile.php?strReturn=%2Fdocumentation" class="top_member_nav_link">My Profile</a>';
     } else {
         $this->strMembershipInfo = 'Welcome, Qcodo Guest<br/>';
         $this->strMembershipInfo .= '<a href="http://www.qcodo.com/members/?strReturn=%2Fdocumentation" class="top_member_nav_link">Log In</a> &nbsp;|&nbsp; <a href="http://www.qcodo.com/members/register.php?strReturn=%2Fdocumentation" class="top_member_nav_link">Register</a>';
     }
 }
 protected function lstClassGroup_Create()
 {
     $this->lstClassGroup = new QListBox($this);
     $this->lstClassGroup->Name = QApplication::Translate('Class Group');
     $this->lstClassGroup->AddItem(QApplication::Translate('- Select One -'), null);
     $objClassGroupArray = ClassGroup::LoadAll();
     if ($objClassGroupArray) {
         foreach ($objClassGroupArray as $objClassGroup) {
             $objListItem = new QListItem($objClassGroup->__toString(), $objClassGroup->Id);
             if ($this->objQcodoClass->ClassGroup && $this->objQcodoClass->ClassGroup->Id == $objClassGroup->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstClassGroup->AddItem($objListItem);
         }
     }
 }
 public function dtgClassGroup_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgClassGroup->TotalItemCount = ClassGroup::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgClassGroup->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgClassGroup->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgClassGroup->DataSource = ClassGroup::LoadAll($objClauses);
 }