Ejemplo n.º 1
0
 protected function GetRightHtml()
 {
     if ($this->strRightText) {
         return sprintf('<span class="input-group-addon">%s</span>', \QApplication::HtmlEntities($this->strRightText));
     }
     return '';
 }
Ejemplo n.º 2
0
 public function ParsePostData()
 {
     // Check to see if this Control's Value was passed in via the POST data
     if (array_key_exists($this->strControlId, $_POST)) {
         // It was -- update this Control's value with the new value passed in via the POST arguments
         if ($this->strText != $_POST[$this->strControlId]) {
             //$this->blnModified = true;
         }
         $this->strText = $_POST[$this->strControlId];
         switch ($this->strCrossScripting) {
             case QCrossScripting::Allow:
                 // Do Nothing, allow everything
                 break;
             case QCrossScripting::HtmlEntities:
                 // Go ahead and perform HtmlEntities on the text
                 $this->strText = QApplication::HtmlEntities($this->strText);
                 break;
             default:
                 // Deny the Use of CrossScripts
                 // Check for cross scripting patterns
                 // TODO: Change this to RegExp
                 $strText = strtolower($this->strText);
                 if (strpos($strText, '<script') !== false || strpos($strText, '<applet') !== false || strpos($strText, '<embed') !== false || strpos($strText, '<style') !== false || strpos($strText, '<link') !== false || strpos($strText, '<body') !== false || strpos($strText, '<iframe') !== false || strpos($strText, 'javascript:') !== false || strpos($strText, ' onfocus=') !== false || strpos($strText, ' onblur=') !== false || strpos($strText, ' onkeydown=') !== false || strpos($strText, ' onkeyup=') !== false || strpos($strText, ' onkeypress=') !== false || strpos($strText, ' onmousedown=') !== false || strpos($strText, ' onmouseup=') !== false || strpos($strText, ' onmouseover=') !== false || strpos($strText, ' onmouseout=') !== false || strpos($strText, ' onmousemove=') !== false || strpos($strText, ' onclick=') !== false || strpos($strText, '<object') !== false || strpos($strText, 'background:url') !== false) {
                     throw new QCrossScriptingException($this->strControlId);
                 }
         }
     }
 }
Ejemplo n.º 3
0
 public function GetEndScript()
 {
     $strToReturn = parent::GetEndScript();
     if (QDateTime::$Translate) {
         $strShortNameArray = array();
         $strLongNameArray = array();
         $strDayArray = array();
         $dttMonth = new QDateTime('2000-01-01');
         for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
             $dttMonth->Month = $intMonth;
             $strShortNameArray[] = '"' . $dttMonth->ToString('MMM') . '"';
             $strLongNameArray[] = '"' . $dttMonth->ToString('MMMM') . '"';
         }
         $dttDay = new QDateTime('Sunday');
         for ($intDay = 1; $intDay <= 7; $intDay++) {
             $strDay = $dttDay->ToString('DDD');
             $strDay = html_entity_decode($strDay, ENT_COMPAT, QApplication::$EncodingType);
             if (function_exists('mb_substr')) {
                 $strDay = mb_substr($strDay, 0, 2);
             } else {
                 // Attempt to account for multibyte day -- may not work if the third character is multibyte
                 $strDay = substr($strDay, 0, strlen($strDay) - 1);
             }
             $strDay = QApplication::HtmlEntities($strDay);
             $strDayArray[] = '"' . $strDay . '"';
             $dttDay->Day++;
         }
         $strArrays = sprintf('new Array(new Array(%s), new Array(%s), new Array(%s))', implode(', ', $strLongNameArray), implode(', ', $strShortNameArray), implode(', ', $strDayArray));
         $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", %s); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel'), $strArrays);
     } else {
         $strToReturn .= sprintf('qc.regCAL("%s", "%s", "%s", "%s", null); ', $this->strControlId, $this->dtxLinkedControl->ControlId, QApplication::Translate('Today'), QApplication::Translate('Cancel'));
     }
     return $strToReturn;
 }
Ejemplo n.º 4
0
 public function RenderValue(AttributeValue $objValue)
 {
     switch ($objValue->Attribute->AttributeDataTypeId) {
         case AttributeDataType::Text:
             return QApplication::HtmlEntities($objValue->TextValue);
         case AttributeDataType::Checkbox:
             return $objValue->BooleanValue ? 'Yes' : 'No';
         case AttributeDataType::Date:
             return $objValue->DateValue->ToString('MMMM D, YYYY');
         case AttributeDataType::DateTime:
             return $objValue->DatetimeValue->ToString('MMMM D, YYYY') . ' at ' . $objValue->DatetimeValue->ToString('h:mmz');
         case AttributeDataType::ImmutableSingleDropdown:
         case AttributeDataType::MutableSingleDropdown:
             return $objValue->SingleAttributeOption != null ? QApplication::HtmlEntities($objValue->SingleAttributeOption->Name) : ' ';
         case AttributeDataType::ImmutableMultipleDropdown:
         case AttributeDataType::MutableMultipleDropdown:
             $strArray = array();
             foreach ($objValue->GetAttributeOptionAsMultipleArray(QQ::OrderBy(QQN::AttributeOption()->Name)) as $objOption) {
                 $strArray[] = '&bull; ' . QApplication::HtmlEntities($objOption->Name);
             }
             return implode('<br/>', $strArray);
         default:
             throw new Exception('Unhandled Attribute Data Type');
     }
 }
Ejemplo n.º 5
0
 /**
  * Create and setup QListBox lstParentGroup
  * Overrides code-generated version by providing full hierarchy and NOT allowing for "looped families"
  * @param string $strControlId optional ControlId to use
  * @param QQCondition $objConditions not used
  * @param QQClause[] $objOptionalClauses not used
  * @return QListBox
  */
 public function lstParentGroup_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstParentGroup = new QListBox($this->objParentObject, $strControlId);
     $this->lstParentGroup->Name = QApplication::Translate('Parent Group');
     $this->lstParentGroup->AddItem(QApplication::Translate('- None -'), null);
     $this->lstParentGroup->HtmlEntities = false;
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objParentGroupCursor = Group::QueryCursor($objCondition, $objOptionalClauses);
     $intLevelToSkipUntil = null;
     foreach (Group::LoadOrderedArrayByMinistryIdAndConfidentiality($this->objGroup->MinistryId, false) as $objGroup) {
         if ($objGroup->Id == $this->objGroup->Id) {
             $intLevelToSkipUntil = $objGroup->HierarchyLevel;
         } else {
             if (!is_null($intLevelToSkipUntil) && $objGroup->HierarchyLevel <= $intLevelToSkipUntil) {
                 $intLevelToSkipUntil = null;
             }
         }
         if (is_null($intLevelToSkipUntil) && $objGroup->GroupTypeId == GroupType::GroupCategory) {
             $strName = $objGroup->Name;
             if ($objGroup->HierarchyLevel) {
                 $strName = str_repeat('&nbsp;', $objGroup->HierarchyLevel * 3) . '&gt; ' . QApplication::HtmlEntities($strName);
             }
             $objListItem = new QListItem($strName, $objGroup->Id);
             if ($this->objGroup->ParentGroup && $this->objGroup->ParentGroup->Id == $objGroup->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstParentGroup->AddItem($objListItem);
         }
     }
     // Return the QListBox
     return $this->lstParentGroup;
 }
Ejemplo n.º 6
0
 protected function SetupPanel()
 {
     if (!$this->objGroup->IsLoginCanView(QApplication::$Login)) {
         $this->ReturnTo('/groups/');
     }
     $this->SetupViewControls(false, false);
     $this->dtgMembers->SetDataBinder('dtgMembers_Bind', $this);
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'First Name (Exact)';
     $this->txtFirstName->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh'));
     $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh'));
     $this->txtFirstName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Last Name (Exact)';
     $this->txtLastName->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh'));
     $this->txtLastName->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'dtgMembers_Refresh'));
     $this->txtLastName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->lblQuery = new QLabel($this);
     $this->lblQuery->Name = 'Search Parameters';
     $this->lblQuery->Text = nl2br(QApplication::HtmlEntities($this->objGroup->SmartGroup->SearchQuery->Description));
     $this->lblQuery->HtmlEntities = false;
     if ($this->objGroup->CountEmailMessageRoutes()) {
         $this->SetupEmailMessageControls();
     }
     $this->SetupSmsControls();
 }
Ejemplo n.º 7
0
 public function lblInternalNotes_Refresh()
 {
     if (strlen($strNote = trim($this->objSignupEntry->InternalNotes)) > 0) {
         $this->lblInternalNotes->Text = nl2br(QApplication::HtmlEntities($strNote), true);
     } else {
         $this->lblInternalNotes->Text = '<span class="na">None</span>';
     }
 }
Ejemplo n.º 8
0
 public function GetItemText()
 {
     $strHtml = \QApplication::HtmlEntities($this->strName);
     if ($strAnchor = $this->strAnchor) {
         $strHtml = \QHtml::RenderTag('a', ['href' => $strAnchor], $strHtml, false, true);
     }
     return $strHtml;
 }
Ejemplo n.º 9
0
Archivo: batch.php Proyecto: alcf/chms
 public function RenderNumber(StewardshipContribution $objContribution)
 {
     if (strlen($objContribution->Source) > 7) {
         return QApplication::HtmlEntities(substr($objContribution->Source, 0, 5) . '...');
     } else {
         return QApplication::HtmlEntities($objContribution->Source);
     }
 }
Ejemplo n.º 10
0
/**
 * Standard Print as Block function.  To aid with possible cross-scripting vulnerabilities,
 * this will automatically perform QApplication::HtmlEntities() unless otherwise specified.
 * 
 * Difference between _b() and _p() is that _b() will convert any linebreaks to <br/> tags.
 * This allows _b() to print any "block" of text that will have linebreaks in standard HTML.
 *
 * @param string $strString
 * @param boolean $blnHtmlEntities
 */
function _b($strString, $blnHtmlEntities = true)
{
    // Text Block Print
    if ($blnHtmlEntities && gettype($strString) != 'object') {
        print nl2br(QApplication::HtmlEntities($strString));
    } else {
        print nl2br($strString);
    }
}
Ejemplo n.º 11
0
 protected function GetControlHtml()
 {
     try {
         // Figure Out the Path
         $strPath = $this->RenderAsImgSrc(false);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     if ($this->strCachedActualFilePath) {
         $objDimensions = getimagesize($this->strCachedActualFilePath);
         // Setup Style and Other Attribute Information (EXCEPT for "BackColor")
         // Use actual "Width" and "Height" values from cached image
         $strBackColor = $this->strBackColor;
         $strWidth = $this->strWidth;
         $strHeight = $this->strHeight;
         $this->strBackColor = null;
         $this->strWidth = $objDimensions[0];
         $this->strHeight = $objDimensions[1];
         $strStyle = $this->GetStyleAttributes();
         if ($strStyle) {
             $strStyle = sprintf(' style="%s"', $strStyle);
         }
         $this->strBackColor = $strBackColor;
         $this->strWidth = $strWidth;
         $this->strHeight = $strHeight;
     } else {
         // Setup Style and Other Attribute Information (EXCEPT for "BackColor", "Width" and "Height")
         $strBackColor = $this->strBackColor;
         $strWidth = $this->strWidth;
         $strHeight = $this->strHeight;
         $this->strBackColor = null;
         $this->strWidth = null;
         $this->strHeight = null;
         $strStyle = $this->GetStyleAttributes();
         if ($strStyle) {
             $strStyle = sprintf(' style="%s"', $strStyle);
         }
         $this->strBackColor = $strBackColor;
         $this->strWidth = $strWidth;
         $this->strHeight = $strHeight;
     }
     $strAlt = null;
     if ($this->strAlternateText) {
         $strAlt = ' alt="' . QApplication::HtmlEntities($this->strAlternateText) . '"';
     }
     // Render final "IMG SRC" tag
     if (!$this->strHeight) {
         $objDimensions = getimagesize($this->ImagePath);
         $intRenderedHeight = $objDimensions[1] * $this->strWidth / $objDimensions[0];
         $intDisplayedHeight = round($intRenderedHeight * 0.85);
     } else {
         $intDisplayedHeight = $this->strHeight;
     }
     $strToReturn = sprintf('<div %s style="background: url(%s); width: %spx; height: %spx; border: 2px solid #aaa;"></div>', $this->GetActionAttributes(), $strPath, $this->strWidth, $intDisplayedHeight);
     return $strToReturn;
 }
Ejemplo n.º 12
0
function DisplayMonospacedText($strText)
{
    $strText = QApplication::HtmlEntities($strText);
    $strText = str_replace('	', '    ', $strText);
    $strText = str_replace(' ', '&nbsp;', $strText);
    $strText = str_replace("\r", '', $strText);
    $strText = str_replace("\n", '<br/>', $strText);
    _p($strText, false);
}
Ejemplo n.º 13
0
/**
 * Standard Print function.  To aid with possible cross-scripting vulnerabilities,
 * this will automatically perform QApplication::HtmlEntities() unless otherwise specified.
 *
 * @param string $strString string value to print
 * @param boolean $blnHtmlEntities perform HTML escaping on the string first
 */
function _p($strString, $blnHtmlEntities = true)
{
    // Standard Print
    if ($blnHtmlEntities && gettype($strString) != 'object') {
        print QApplication::HtmlEntities($strString);
    } else {
        print $strString;
    }
}
Ejemplo n.º 14
0
 protected function GetControlHtml()
 {
     $strStyle = $this->GetStyleAttributes();
     if ($strStyle) {
         $strStyle = sprintf('style="%s"', $strStyle);
     }
     $strToReturn = sprintf('<a href="%s" id="%s" %s%s%s>%s</a>', $this->strLinkUrl, $this->strControlId, $this->GetTargetAtribute(), $this->GetAttributes(), $strStyle, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText);
     return $strToReturn;
 }
Ejemplo n.º 15
0
 public function RenderGroupName(Group $objGroup)
 {
     $strName = sprintf('<a href="/groups/group.php#%s">%s</a>', $objGroup->Id, QApplication::HtmlEntities($objGroup->Name));
     // Add Pointer
     $intHierarchyLevel = $objGroup->HierarchyLevel - $this->objGroup->HierarchyLevel - 1;
     $strName = $intHierarchyLevel ? '&gt;&nbsp;' . $strName : $strName;
     // Add Indent
     $strName = str_repeat('&nbsp;&nbsp;&nbsp;', $intHierarchyLevel) . $strName;
     return $strName;
 }
Ejemplo n.º 16
0
 protected function btnSubmit_Click($strFormId, $strControlId, $strParameter)
 {
     $this->txtEmail->Visible = false;
     $this->btnSubmit->Visible = false;
     $this->lblMessage->Visible = true;
     $this->btnBack->Visible = true;
     $strEmail = trim(strtolower($this->txtEmail->Text));
     PublicLogin::RetrieveUsernameForEmail($strEmail);
     $this->lblMessage->Text = '<p>We are looking to see if <strong>' . QApplication::HtmlEntities($strEmail) . '</strong> exists in the system, and if so ' . 'we will send you an email that contains your username.  This should only take a moment, but please wait up to a few minnutes for delivery.</p>' . '<p>On the off-chance that the email gets caught by SPAM filters, you may also want to check your SPAM or Junk Mail folder.</p>' . '<p>If you encounter any issues, please feel free and ' . Registry::GetValue('contact_sentence_my_alcf_support') . '.</p>';
 }
Ejemplo n.º 17
0
Archivo: index.php Proyecto: alcf/chms
 public function RenderName(StewardshipFund $objFund)
 {
     if ($objFund->ActiveFlag) {
         $objStyle = null;
     } else {
         $objStyle = new QDataGridRowStyle();
         $objStyle->BackColor = '#edd';
     }
     $this->dtgFunds->OverrideRowStyle($this->dtgFunds->CurrentRowIndex, $objStyle);
     return sprintf('<a href="/stewardship/funds/edit.php/%s">%s</a>', $objFund->Id, QApplication::HtmlEntities($objFund->Name));
 }
Ejemplo n.º 18
0
 public function RenderAddresses(ParentPagerIndividual $objIndividual)
 {
     $objAddressArray = $objIndividual->GetParentPagerAddressArray();
     if ($objIndividual->ParentPagerHousehold) {
         $objAddressArray = array_merge($objAddressArray, $objIndividual->ParentPagerHousehold->GetParentPagerAddressArray());
     }
     $strToReturnArray = array();
     foreach ($objAddressArray as $objAddress) {
         $strToReturnArray[] = QApplication::HtmlEntities($objAddress->Address1) . ', ' . QApplication::HtmlEntities($objAddress->City);
     }
     return implode('<br/>', $strToReturnArray);
 }
Ejemplo n.º 19
0
 /**
  * Get the HTML for this Control.
  * @return string
  */
 public function GetControlHtml()
 {
     // Pull any Attributes
     $strAttributes = $this->GetAttributes(true, false);
     $strActions = $this->GetActionAttributes();
     // Pull any styles
     if ($strStyle = $this->GetStyleAttributes()) {
         $strStyle = 'style="' . $strStyle . '"';
     }
     $strToReturn = sprintf('<div %s id="%s"><a href="%s" %s %s>%s</a></div>', $strAttributes, $this->strControlId, $this->strLinkUrl, $strActions, $strStyle, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText);
     // Return the HTML.
     return $strToReturn;
 }
Ejemplo n.º 20
0
 protected function GetControlHtml()
 {
     $strStyle = $this->GetStyleAttributes();
     if ($strStyle) {
         $strStyle = sprintf('style="%s"', $strStyle);
     }
     $strToReturn = sprintf('<div class="%s">', $this->strCssClassForDiv);
     $strToReturn .= sprintf('<a href="#" id="%s_searchlink"><img src="/images/search.png"/ title="Enter Search Term"></a>', $this->strControlId);
     $strToReturn .= sprintf('<input type="text" name="%s" id="%s" value="' . $this->strFormat . '" %s%s />', $this->strControlId, $this->strControlId, QApplication::HtmlEntities($this->strText), $this->GetAttributes(), $strStyle);
     $strToReturn .= sprintf('<a href="#" id="%s_cancellink"><img src="/images/search_cancel.png" title="Clear Search Term"/></a>', $this->strControlId);
     $strToReturn .= '</div>';
     return $strToReturn;
 }
Ejemplo n.º 21
0
 public function Accordion_Draw($objAccordion, $strPart, $objItem, $intIndex)
 {
     switch ($strPart) {
         case Bs\Accordion::RenderHeader:
             $objAccordion->RenderToggleHelper(QApplication::HtmlEntities($objItem->FirstName . ' ' . $objItem->LastName));
             break;
         case Bs\Accordion::RenderBody:
             if ($objItem->Address) {
                 echo "<b>Address: </b>" . $objItem->Address->Street . ", " . $objItem->Address->City . "<br />";
             }
             break;
     }
 }
Ejemplo n.º 22
0
 protected function GetControlHtml()
 {
     if (!$this->blnEnabled) {
         $strDisabled = 'disabled="disabled" ';
     } else {
         $strDisabled = "";
     }
     if ($this->intTabIndex) {
         $strTabIndex = sprintf('tabindex="%s" ', $this->intTabIndex);
     } else {
         $strTabIndex = "";
     }
     if ($this->strToolTip) {
         $strToolTip = sprintf('title="%s" ', $this->strToolTip);
     } else {
         $strToolTip = "";
     }
     if ($this->strCssClass) {
         $strCssClass = sprintf('class="%s" ', $this->strCssClass);
     } else {
         $strCssClass = "";
     }
     if ($this->strAccessKey) {
         $strAccessKey = sprintf('accesskey="%s" ', $this->strAccessKey);
     } else {
         $strAccessKey = "";
     }
     if ($this->blnChecked) {
         $strChecked = 'checked="checked" ';
     } else {
         $strChecked = "";
     }
     $strStyle = $this->GetStyleAttributes();
     if (strlen($strStyle) > 0) {
         $strStyle = sprintf('style="%s" ', $strStyle);
     }
     $strCustomAttributes = $this->GetCustomAttributes();
     $strActions = $this->GetActionAttributes();
     if (strlen($this->strText)) {
         $this->blnIsBlockElement = true;
         if ($this->strTextAlign == QTextAlign::Left) {
             $strToReturn = sprintf('<table cellspacing="0" cellpadding="0" border="0"><tr><td %s%s%s%s%s><label for="%s">%s</label><input type="checkbox" id="%s" name="%s" %s%s%s%s%s /></td></tr></table>', $strCssClass, $strToolTip, $strStyle, $strCustomAttributes, $strDisabled, $this->strControlId, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText, $this->strControlId, $this->strControlId, $strDisabled, $strChecked, $strActions, $strAccessKey, $strTabIndex);
         } else {
             $strToReturn = sprintf('<table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="checkbox" id="%s" name="%s" %s%s%s%s%s /></td><td %s%s%s%s%s><label for="%s">%s</label></td></tr></table>', $this->strControlId, $this->strControlId, $strDisabled, $strChecked, $strActions, $strAccessKey, $strTabIndex, $strCssClass, $strToolTip, $strStyle, $strCustomAttributes, $strDisabled, $this->strControlId, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText);
         }
     } else {
         $this->blnIsBlockElement = false;
         $strToReturn = sprintf('<input type="checkbox" id="%s" name="%s" %s%s%s%s%s%s%s%s%s />', $this->strControlId, $this->strControlId, $strCssClass, $strDisabled, $strChecked, $strActions, $strAccessKey, $strToolTip, $strTabIndex, $strCustomAttributes, $strStyle);
     }
     return $strToReturn;
 }
 /**
  * Render as an HTML link (anchor tag)
  *
  * @param string      $strLabel           Text to link to
  * @param string|null $strActionParameter Action parameter for this rendering of the control. Will be sent to the ActionParameter of the action.
  * @param null|array  $attributes         Array of attributes to add to the tag for the link.
  * @param string      $strTag             Tag to use. Defaults to 'a'.
  *
  * @return string
  */
 public function RenderAsLink($strLabel, $strActionParameter = null, $attributes = [], $strTag = 'a', $blnHtmlEntities = true)
 {
     $defaults['href'] = 'javascript:;';
     $defaults['data-qpxy'] = $this->strControlId;
     if ($strActionParameter) {
         $defaults['data-qap'] = $strActionParameter;
     }
     $attributes = array_merge($defaults, $attributes);
     // will only apply defaults that are not in attributes
     if ($blnHtmlEntities) {
         $strLabel = QApplication::HtmlEntities($strLabel);
     }
     return QHtml::RenderTag($strTag, $attributes, $strLabel);
 }
Ejemplo n.º 24
0
 public function RenderName(Group $objGroup)
 {
     if ($objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) {
         $strName = sprintf('<a href="#groups/edit_participation/%s">%s</a>', $objGroup->Id, QApplication::HtmlEntities($objGroup->Name));
     } else {
         $strName = QApplication::HtmlEntities($objGroup->Name);
     }
     $strName = $objGroup->ParentGroup ? '&gt;&nbsp;' . $strName : $strName;
     $objGroupIterate = $objGroup;
     while ($objGroupIterate = $objGroupIterate->ParentGroup) {
         $strName = '&nbsp;&nbsp;&nbsp;' . $strName;
     }
     return $strName;
 }
Ejemplo n.º 25
0
 protected function GetControlHtml()
 {
     $strStyle = $this->GetStyleAttributes();
     if ($strStyle) {
         $strStyle = sprintf('style="%s"', $strStyle);
     }
     if ($this->blnPrimaryButton) {
         $strCommand = "submit";
     } else {
         $strCommand = "button";
     }
     $strToReturn = sprintf('<input type="%s" name="%s" id="%s" value="%s" %s%s />', $strCommand, $this->strControlId, $this->strControlId, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText, $this->GetAttributes(), $strStyle);
     return $strToReturn;
 }
Ejemplo n.º 26
0
 public function __get($strName)
 {
     switch ($strName) {
         case 'ShortDescriptionAsHtml':
             $strToReturn = QApplication::HtmlEntities(trim($this->strShortDescription));
             $strToReturn = str_replace("\r", '', $strToReturn);
             $strToReturn = str_replace("\n", '<br/>', $strToReturn);
             return $strToReturn;
         case 'Parameters':
             return $this->GetParameterArray(QQ::Clause(QQ::OrderBy(QQN::Parameter()->OrderNumber), QQ::Expand(QQN::Parameter()->Variable)));
             /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         case 'InheritenceState':
             return $this->intInheritenceState;
             /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         /* ONLY TO BE USED when OPERATION is restored via QcodoClass::Operations */
         case 'OverridesOperation':
             return $this->objOverridesOperation;
             /* CAN BE USED ANYWHERE */
         /* CAN BE USED ANYWHERE */
         case 'Overrides':
             $objClass = $this->QcodoClass->ParentQcodoClass;
             while ($objClass) {
                 if ($objOperation = Operation::LoadByQcodoClassIdQcodoInterfaceIdName($objClass->Id, null, $this->strName)) {
                     return $objOperation;
                 }
                 $objClass = $objClass->ParentQcodoClass;
             }
             return null;
         case 'DisplayName':
             switch ($this->intInheritenceState) {
                 case InheritenceState::Interited:
                     return $this->strName . '&nbsp;<img src="/images/inherited_light.png" border="0" alt="Inherited"/>';
                 case InheritenceState::Overrides:
                     return $this->strName . '&nbsp;<img src="/images/overrides.png" border="0" alt="Overrides"/>';
                 default:
                     return $this->strName;
             }
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 27
0
 public function __get($strName)
 {
     switch ($strName) {
         case 'DisplayForForums':
             $strToReturn = sprintf('<a href="%s" title="View Profile">%s</a>', $this->ViewProfileUrl, QApplication::HtmlEntities($this->DisplayName));
             if ($this->strLocation) {
                 $strToReturn .= ' (' . QApplication::HtmlEntities($this->strLocation, ENT_COMPAT, QApplication::$EncodingType) . ')';
             }
             // Display the Flag (if applicable)
             if ($this->Country) {
                 $strCode = strtolower($this->Country->Code);
                 $strImageFile = sprintf('/images/flags/%s.png', $strCode);
                 if (file_exists(QApplication::$DocumentRoot . $strImageFile)) {
                     $strToReturn .= sprintf(' <img src="%s" title="%s" alt="%s" width="16" height="11"/>', $strImageFile, $this->Country->Name, $this->Country->Name);
                 }
             }
             // Display the Star (if applicable)
             $strStarIcon = ' <img src="/images/star_icon.png" style="vertical-align: bottom;" title="%s" alt="%s" width="16" height="16"/>';
             if ($this->intPersonTypeId == PersonType::Administrator) {
                 $strToReturn .= sprintf($strStarIcon, 'Qcodo Administrator', 'Qcodo Administrator');
             } else {
                 if ($this->intPersonTypeId == PersonType::Contributor) {
                     $strToReturn .= sprintf($strStarIcon, 'Qcodo Core Contributor', 'Qcodo Core Contributor');
                 } else {
                     if ($this->blnDonatedFlag) {
                         $strToReturn .= sprintf($strStarIcon, 'Financial Contributor', 'Financial Contributor');
                     }
                 }
             }
             return $strToReturn;
         case 'ViewProfileUrl':
             return '/profile/view.php/' . $this->strUsername;
         case 'DisplayNameWithLink':
             return sprintf('<a href="%s" title="View Profile">%s</a>', $this->ViewProfileUrl, QApplication::HtmlEntities($this->DisplayName));
         case 'SmtpEmailAddress':
             return $this->strFirstName . ' ' . $this->strLastName . ' <' . $this->strEmail . '>';
         case 'Type':
             return PersonType::$NameArray[$this->intPersonTypeId];
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 28
0
 protected function GetDataGridRowHtml($objObject)
 {
     // Get the Default Style
     $objStyle = $this->objRowStyle;
     // Iterate through the Columns
     $strColumnsHtml = '';
     foreach ($this->objColumnArray as $objColumn) {
         try {
             $strHtml = $this->ParseColumnHtml($objColumn, $objObject);
             if ($objColumn->HtmlEntities) {
                 $strHtml = QApplication::HtmlEntities($strHtml);
             }
             // For IE
             if (QApplication::IsBrowser(QBrowserType::InternetExplorer) && $strHtml == '') {
                 $strHtml = '&nbsp;';
             }
         } catch (QCallerException $objExc) {
             $objExc->IncrementOffset();
             throw $objExc;
         }
         $strColumnsHtml .= sprintf('<td %s>%s</td>', $objColumn->GetAttributes(), $strHtml);
     }
     // Add an extra empty column to go underneath the Column Toggle Button
     if ($this->ShowColumnToggle || $this->ShowExportCsv) {
         // This is nasty - cloning the original object just to reset the display to true and get the attributes
         // There must be a better way to do this, but it gets the job done for now
         // Also, for inclusion in Qcodo, this might not be what you want to do. What if the last column has weird attributes, and they should go back to normal?
         // But you can't include the RowStyle because there are things in a RowStyle that don't work on cells
         $objNewColumn = clone $objColumn;
         $objNewColumn->Display = true;
         $objNewColumn->Width = null;
         $strColumnsHtml .= sprintf('<td %s>&nbsp;</td>', $objNewColumn->GetAttributes());
     }
     // Apply AlternateRowStyle (if applicable)
     if ($this->intCurrentRowIndex % 2 == 1) {
         $objStyle = $objStyle->ApplyOverride($this->objAlternateRowStyle);
     }
     // Apply any Style Override (if applicable)
     if (is_array($this->objOverrideRowStyleArray) && array_key_exists($this->intCurrentRowIndex, $this->objOverrideRowStyleArray) && !is_null($this->objOverrideRowStyleArray[$this->intCurrentRowIndex])) {
         $objStyle = $objStyle->ApplyOverride($this->objOverrideRowStyleArray[$this->intCurrentRowIndex]);
     }
     // Finish up
     $strToReturn = sprintf('<tr %s>%s</tr>', $objStyle->GetAttributes(), $strColumnsHtml);
     $this->intCurrentRowIndex++;
     return $strToReturn;
 }
Ejemplo n.º 29
0
 protected function GetControlHtml()
 {
     $strStyle = $this->GetStyleAttributes();
     if ($strStyle) {
         $strStyle = sprintf('style="%s"', $strStyle);
     }
     $strTemplateEvaluated = '';
     if ($this->strTemplate) {
         global $_CONTROL;
         $objCurrentControl = $_CONTROL;
         $_CONTROL = $this;
         $strTemplateEvaluated = $this->objForm->EvaluateTemplate($this->strTemplate);
         $_CONTROL = $objCurrentControl;
     }
     $strToReturn = sprintf('<%s id="%s" %s%s>%s%s%s</%s>%s', $this->strTagName, $this->strControlId, $this->GetAttributes(), $strStyle, $this->blnHtmlEntities ? QApplication::HtmlEntities($this->strText) : $this->strText, $strTemplateEvaluated, $this->blnAutoRenderChildren ? $this->RenderChildren(false) : '', $this->strTagName, $this->objHoverTip && !$this->objParentControl->ExportCsv ? $this->objHoverTip->Render(false) : '');
     return $strToReturn;
 }
Ejemplo n.º 30
0
 public function __get($strName)
 {
     switch ($strName) {
         case 'Type':
             return GroupType::$NameArray[$this->intGroupTypeId];
         case 'CsvFilename':
             $strName = $this->strName;
             $strToReturn = null;
             for ($i = 0; $i < strlen($strName); $i++) {
                 $intOrd = ord($strName[$i]);
                 if ($intOrd >= ord('a') && $intOrd <= ord('z') || $intOrd >= ord('A') && $intOrd <= ord('Z') || $intOrd >= ord('0') && $intOrd <= ord('9')) {
                     $strToReturn .= $strName[$i];
                 }
             }
             return $strToReturn . '.csv';
         case 'GroupDetail':
             switch ($this->GroupTypeId) {
                 case GroupType::GroupCategory:
                     return $this->GroupCategory;
                 case GroupType::SmartGroup:
                     return $this->SmartGroup;
                 default:
                     throw new QCallerException('Invalid GroupTypeId');
             }
             break;
         case 'EmailTypeHtml':
             switch ($this->EmailBroadcastTypeId) {
                 case EmailBroadcastType::PrivateList:
                 case EmailBroadcastType::PublicList:
                 case EmailBroadcastType::AnnouncementOnly:
                     return sprintf('%s &nbsp;|&nbsp; <a href="mailto:%s@groups.alcf.net">%s@groups.alcf.net</a>', EmailBroadcastType::$NameArray[$this->EmailBroadcastTypeId], QApplication::HtmlEntities($this->Token), QApplication::HtmlEntities($this->Token));
                 case null:
                     return '<span style="color: #999; font-size: 10px; ">None</span>';
                 default:
                     throw new Exception('Invalid EmailBroadcastTypeId: ' . $this->EmailBroadcastTypeId);
             }
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }