Example #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;
 }
 protected function SetupClassGroup()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intId = QApplication::QueryString('intId');
     if ($intId) {
         $this->objClassGroup = ClassGroup::Load($intId);
         if (!$this->objClassGroup) {
             throw new Exception('Could not find a ClassGroup object with PK arguments: ' . $intId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objClassGroup = new ClassGroup();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
Example #3
0
 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);
         }
     }
 }
Example #5
0
 public static function GetSoapArrayFromArray($objArray)
 {
     if (!$objArray) {
         return null;
     }
     $objArrayToReturn = array();
     foreach ($objArray as $objObject) {
         array_push($objArrayToReturn, ClassGroup::GetSoapObjectFromObject($objObject, true));
     }
     return unserialize(serialize($objArrayToReturn));
 }
 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);
 }
Example #7
0
 public function addClassGroupRelatedByParent(ClassGroup $l)
 {
     $this->collClassGroupsRelatedByParent[] = $l;
     $l->setClassGroupRelatedByParent($this);
 }
 public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects)
 {
     if ($objObject->objParentQcodoInterface) {
         $objObject->objParentQcodoInterface = QcodoInterface::GetSoapObjectFromObject($objObject->objParentQcodoInterface, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intParentQcodoInterfaceId = null;
         }
     }
     if ($objObject->objClassGroup) {
         $objObject->objClassGroup = ClassGroup::GetSoapObjectFromObject($objObject->objClassGroup, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intClassGroupId = null;
         }
     }
     if ($objObject->objFile) {
         $objObject->objFile = File::GetSoapObjectFromObject($objObject->objFile, false);
     } else {
         if (!$blnBindRelatedObjects) {
             $objObject->intFileId = null;
         }
     }
     return $objObject;
 }
Example #9
0
 public function addClassGroup(ClassGroup $l)
 {
     $this->collClassGroups[] = $l;
     $l->setClassType($this);
 }