상속: extends QActionControl
예제 #1
0
 public function __construct($objParentObject, $strControlId = null, StewardshipBatch $objBatch, StewardshipStack $objStack = null, $strUrlHashArgument1 = null, $strUrlHashArgument2 = null, $strUrlHashArgument3 = null)
 {
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->strTemplate = dirname(__FILE__) . '/' . get_class($this) . '.tpl.php';
     $this->objBatch = $objBatch;
     $this->objStack = $objStack;
     $this->strUrlHashArgument = $strUrlHashArgument1;
     $this->strUrlHashArgument2 = $strUrlHashArgument2;
     $this->strUrlHashArgument3 = $strUrlHashArgument3;
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
     $this->btnSave->CausesValidation = $this;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->SetupPanel();
 }
예제 #2
0
 public function GetControlHtml()
 {
     $strOutput = '<ul class="tabs-nav">';
     foreach ($this->arrTab as $intTabIndex => $objTabSection) {
         if ($this->strFloat == 'right') {
             $strLiCssClass = 'floatright ';
         } else {
             $strLiCssClass = '';
         }
         if (isset($this->arrTabUrl[$intTabIndex])) {
             $strOutput .= sprintf('<li class="%s"><a href="%s"><span>%s</span></a></li>', $strLiCssClass, $this->arrTabUrl[$intTabIndex], $this->arrTabTitle[$intTabIndex]);
         } else {
             $objLink = new QLinkButton($this);
             $objLink->Text = sprintf('<span>%s</span>', $this->arrTabTitle[$intTabIndex]);
             $objLink->HtmlEntities = false;
             $objLink->ActionParameter = $intTabIndex;
             if ($this->blnUseAjax) {
                 $objLink->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'changeTab'));
             } else {
                 $objLink->AddAction(new QClickEvent(), new QServerControlAction($this, 'changeTab'));
             }
             if ($intTabIndex == $this->intSelectedTab) {
                 $strLiCssClass .= 'tabs-selected';
             }
             $strOutput .= sprintf('<li class="%s">%s</li>', $strLiCssClass, $objLink->Render(false));
         }
     }
     $strOutput .= '</ul>';
     foreach ($this->arrTab as $intTabIndex => $objTabSection) {
         if (!$objTabSection->CssClass) {
             $objTabSection->CssClass = 'tabs-container';
         }
         $objTabSection->Display = $this->intSelectedTab == $intTabIndex;
         try {
             $strOutput .= $objTabSection->Render(false);
         } catch (Exception $objEx) {
             throw $objEx;
         }
     }
     $this->strText = $strOutput;
     return parent::GetControlHtml();
 }
예제 #3
0
 public function __construct($objParentObject, $strControlId = null, Person $objPerson = null, $strUrlHashArgument)
 {
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->strTemplate = dirname(__FILE__) . '/../' . $this->objForm->strSubNavItemArray[$this->objForm->strSubNavItemToken][1] . '/' . get_class($this) . '.tpl.php';
     $this->objPerson = $objPerson;
     $this->strUrlHashArgument = $strUrlHashArgument;
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Save';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
     $this->btnSave->CausesValidation = $this;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->SetupPanel();
 }
예제 #4
0
<?php

include_once 'prepend.inc.php';
$lnkContactAdd = new QLinkButton($_CONTROL);
$lnkContactAdd->Text = 'Choose';
$lnkContactAdd->AddAction(new QClickEvent(), new QServerAction('AddClicked'));
$lnkContactAdd->ActionParameter = $_ITEM->Id;
?>
<table>
	<tr >
		<td><?php 
$img = '../assets/images/32x32/user.png';
?>
 <img src='<?php 
_p($img);
?>
' width=32px height=32px></img><br/><?php 
$lnkContactAdd->Render();
?>
</td>
		<td valign="top">
			<div>
				Name : <?php 
_p($_ITEM->FullName);
?>
			</div>
			<div>Email: <?php 
_p($_ITEM->Email);
?>
</div>
			<div>Address: <?php 
예제 #5
0
 public function __construct($objParentObject, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->strTemplate = __NARRO_INCLUDES__ . '/narro/panel/NarroUserLoginPanel.tpl.php';
     $this->lblMessage = new QLabel($this);
     $this->lblMessage->HtmlEntities = false;
     $this->objAccordion = new QAccordion($this);
     $lblNarroLogin = new QLinkButton($this->objAccordion);
     $lblNarroLogin->Text = t('Login with your Narro account');
     $pnlNarroLogin = new QPanel($this->objAccordion);
     $pnlNarroLogin->AutoRenderChildren = true;
     $pnlNarroLogin->PreferedRenderMethod = 'RenderWithName';
     $pnlNarroLogin->SetCustomStyle('text-align', 'right');
     $this->txtUsername = new QTextBox($pnlNarroLogin, 'username');
     $this->txtUsername->TabIndex = 1;
     $this->txtUsername->Name = t('Username');
     $this->txtUsername->PreferedRenderMethod = 'RenderWithName';
     $this->txtPassword = new QTextBox($pnlNarroLogin, 'password');
     $this->txtPassword->TabIndex = 2;
     $this->txtPassword->TextMode = QTextMode::Password;
     $this->txtPassword->Name = t('Password');
     $this->txtPassword->PreferedRenderMethod = 'RenderWithName';
     $this->btnLogin = new QButton($pnlNarroLogin);
     $this->btnLogin->Text = t('Login');
     $this->btnLogin->PrimaryButton = true;
     $this->btnLogin->TabIndex = 3;
     $this->btnLogin->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnLogin_Click'));
     $lblOpenIdLogin = new QLinkButton($this->objAccordion);
     $lblOpenIdLogin->HtmlEntities = false;
     $lblOpenIdLogin->Text = '<img src="http://www.openid.net/favicon.ico" /> ' . t('Login with your OpenID');
     $pnlOpenIdLogin = new QPanel($this->objAccordion);
     $pnlOpenIdLogin->AutoRenderChildren = true;
     $this->txtOpenId = new QTextBox($pnlOpenIdLogin, 'openid');
     $this->txtOpenId->Name = t('OpenID URL');
     $this->txtOpenId->Instructions = t('Use your existing OpenID account information to login.');
     $this->txtOpenId->PreferedRenderMethod = 'RenderWithName';
     $this->btnOpenIdLogin = new QButton($pnlOpenIdLogin);
     $this->btnOpenIdLogin->Text = t('Login');
     $this->btnOpenIdLogin->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnOpenIdLogin_Click'));
     $lblGoogleLogin = new QLinkButton($this->objAccordion);
     $lblGoogleLogin->HtmlEntities = false;
     $lblGoogleLogin->Text = '<img src="http://www.google.com/favicon.ico" /> ' . t('Login with your Google account');
     $lblGoogleLogin->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnGoogleLogin_Click'));
     $pnlGoogleLogin = new QPanel($this->objAccordion);
     $pnlGoogleLogin->AutoRenderChildren = true;
     $lblBrowserIdLogin = new QLinkButton($this->objAccordion);
     $lblBrowserIdLogin->HtmlEntities = false;
     $lblBrowserIdLogin->Text = '<img src="https://browserid.org/favicon.ico" /> ' . t('Login with BrowserID');
     $lblBrowserIdLogin->AddAction(new QClickEvent(), new QJavaScriptAction(sprintf("navigator.id.get(function(assertion) {if (assertion) {qc.pA('%s', '%s', 'QClickEvent', assertion, '')} else {qc.pA('%s', '%s', 'QClickEvent', '', '')}}); return false;", $this->Form->FormId, $lblBrowserIdLogin->ControlId, $this->Form->FormId, $lblBrowserIdLogin->ControlId)));
     $lblBrowserIdLogin->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnBrowserIdLogin_Click'));
     $pnlBrowserIdLogin = new QPanel($this->objAccordion);
     $pnlBrowserIdLogin->AutoRenderChildren = true;
     $openid = new LightOpenID($_SERVER['HTTP_HOST']);
     if (!$openid->mode && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != '' && !strstr($_SERVER['HTTP_REFERER'], $_SERVER['REQUEST_URI'])) {
         $this->txtPreviousUrl = $_SERVER['HTTP_REFERER'];
     }
     if ($openid->mode) {
         if ($openid->mode == 'cancel') {
             $this->lblMessage->Text = t('The user has canceled authentication');
             $this->lblMessage->ForeColor = 'red';
         } else {
             if ($openid->validate()) {
                 $arrAttributes = $openid->getAttributes();
                 $objUser = NarroUser::LoadByUsername($openid->identity);
                 require_once __NARRO_INCLUDES__ . '/PasswordHash.class.php';
                 $objHasher = new PasswordHash(8, FALSE);
                 if (!$objUser instanceof NarroUser) {
                     try {
                         $objUser = NarroUser::RegisterUser($openid->identity, $openid->identity, '', $openid->identity);
                         if (isset($arrAttributes['namePerson'])) {
                             $objUser->Username = $arrAttributes['namePerson'];
                         }
                         if (isset($arrAttributes['contact/email'])) {
                             $objUser->Email = $arrAttributes['contact/email'];
                         }
                         $objUser->Save();
                     } catch (Exception $objEx) {
                         $this->lblMessage->ForeColor = 'red';
                         $this->lblMessage->Text = t('Failed to create an associated user for this OpenId') . $objEx->getMessage() . var_export($openid->identity, true);
                         return false;
                     }
                     $objUser->Reload();
                     QApplication::$Session->RegenerateId();
                     QApplication::$Session->User = $objUser;
                     QApplication::Redirect(NarroLink::UserPreferences($objUser->UserId));
                     exit;
                 } elseif ($objUser->Password != $objHasher->HashPassword('')) {
                     $this->lblMessage->ForeColor = 'red';
                     $this->lblMessage->Text = t('This user has a password set, please login with that instead');
                     return false;
                 }
                 QApplication::$Session->RegenerateId();
                 QApplication::$Session->User = $objUser;
                 QApplication::$User = $objUser;
                 if ($this->txtPreviousUrl) {
                     $strUrl = preg_replace('/([\\?\\&]l\\=)[a-z0-9\\-\\_]+/', '\\1' . QApplication::$User->GetPreferenceValueByName('Language'), $this->txtPreviousUrl);
                     if ($strUrl) {
                         QApplication::Redirect($strUrl);
                     } else {
                         QApplication::Redirect($this->txtPreviousUrl);
                     }
                 } else {
                     QApplication::Redirect(NarroLink::ProjectList(null, null, QApplication::$User->GetPreferenceValueByName('Language')));
                 }
                 exit;
             } else {
                 $this->lblMessage->Text = t('OpenID login failed');
                 $this->lblMessage->ForeColor = 'red';
             }
         }
     }
 }
예제 #6
0
 /**
  * Basic setup of edit-related QControls for a Group to be used for all group types
  * @return void
  */
 protected function SetupEditControls()
 {
     $this->mctGroup = new GroupMetaControl($this, $this->objGroup);
     $this->txtName = $this->mctGroup->txtName_Create();
     $this->txtName->Select();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->txtName->Required = true;
     $this->chkActiveFlag = $this->mctGroup->chkActiveFlag_Create();
     $this->chkActiveFlag->Name = 'Active?';
     $this->chkActiveFlag->Text = 'Check if this is an "Active" group.';
     $this->lstParentGroup = $this->mctGroup->lstParentGroup_Create();
     $this->lstParentGroup->Name = 'In Group Category';
     $this->lstEmailBroadcastType = $this->mctGroup->lstEmailBroadcastType_Create();
     $this->lstEmailBroadcastType->Instructions = '<span class="help" onclick="displayHelp(\'helpEmailBroadcastType\')"><img src="/assets/images/icons/help.png" alt="help"></span>';
     $this->txtToken = $this->mctGroup->txtToken_Create();
     $this->txtToken->Name = 'Email Address';
     $this->txtToken->HtmlAfter = '<span> @ groups.alcf.net</span>';
     $this->chkConfidentialFlag = $this->mctGroup->chkConfidentialFlag_Create();
     $this->chkConfidentialFlag->Name = 'Confidential?';
     $this->chkConfidentialFlag->Text = 'Check if this group is considered a "Confidential" group';
     // Confidentiality not for Group Categories
     if ($this->mctGroup->Group->GroupTypeId == GroupType::GroupCategory) {
         $this->chkConfidentialFlag->Visible = false;
         $this->chkConfidentialFlag->Checked = false;
     }
     // Setup Ministry with Rules
     if (QApplication::$Login->RoleTypeId == RoleType::ChMSAdministrator) {
         $this->lstMinistry = $this->mctGroup->lstMinistry_Create(null, null, QQ::OrderBy(QQN::Ministry()->Name));
     } else {
         $intMinistryIdArray = array();
         foreach (QApplication::$Login->GetMinistryArray() as $objMinistry) {
             $intMinistryIdArray[] = $objMinistry->Id;
         }
         $this->lstMinistry = $this->mctGroup->lstMinistry_Create(null, QQ::In(QQN::Ministry()->Id, $intMinistryIdArray), QQ::OrderBy(QQN::Ministry()->Name));
     }
     if ($this->mctGroup->EditMode) {
         $this->lstMinistry->Enabled = false;
     }
     // Setup EmailBroadcast-related controls
     $this->lstEmailBroadcastType->GetItem(0)->Name = '- None -';
     $this->lstEmailBroadcastType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'txtToken_Refresh'));
     $this->txtToken_Refresh();
     // Delete?
     if ($this->mctGroup->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         if ($this->mctGroup->Group->CountChildGroups()) {
             $this->btnDelete->AddAction(new QClickEvent(), new QAlertAction('This Group Category has child groups.  You must first move or delete those child groups before you can delete this Group Category.'));
             $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
         } else {
             if ($this->mctGroup->Group->GroupTypeId == GroupType::GroupCategory) {
                 $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this group?  This will also delete all participation records and archived messages and cannot be undone.'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
             } else {
                 $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to DELETE this group?  This will also delete all participation records and archived messages and cannot be undone.\\n\\nA better option would be to simply mark this group as "Inactive".'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
                 $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
             }
         }
     }
 }
예제 #7
0
    ?>
</div>
		<div>Label: <?php 
    isset($_ITEM->Label) ? _p($_ITEM->Label) : _p('');
    ?>
</div>
		<div>Number of Discs: <?php 
    isset($_ITEM->NumberOfDiscs) ? _p($_ITEM->NumberOfDiscs) : _p('');
    ?>
</div>

		<?php 
}
?>
		<?php 
$btnLend = new QLinkButton($this);
$btnLend->Text = 'Lend this to...';
$btnLend->AddAction(new QClickEvent(), new QServerAction('LendThis_Click'));
$btnLend->ActionParameter = $_ITEM->Id;
$objCondition = array();
$objCondition = QQ::Equal(QQN::Sharedetails()->Asin, $_ITEM->Asin);
$result = Sharedetails::QuerySingle($objCondition);
?>
		<br/><br/><br/><br/><br/>
		<div>
			<?php 
if (sizeof($result) != 0) {
    ?>
				<img src = '../assets/images/32x32/tag_green.png' />
				<?php 
    _p('This item is shared with ' . $result->FullName);
예제 #8
0
' 
					  width=108px 
					  height=160px
					  onmouseover="document.getElementById('toolContent <?php 
_p($_ITEM->Asin);
?>
').style.visibility='visible'"
					  onmouseout="document.getElementById('toolContent <?php 
_p($_ITEM->Asin);
?>
').style.visibility='hidden'" 
					  />
			</a>
				<?php 
$item_pass = $_ITEM->Id . '~' . $_ITEM->Title;
$btnChoose = new QLinkButton($this->dtrAssets);
$btnChoose->Text = 'Add to Basket';
$btnChoose->AddAction(new QClickEvent(), new QServerAction('ChooseAssets_Click'));
$btnChoose->ActionParameter = $item_pass;
?>
				<?php 
$btnChoose->Render();
?>


	
		
			<div  id="toolContent <?php 
_p($_ITEM->Asin);
?>
" style="visibility:hidden;align:absbottom;height:11;width:11;background-color: grey;left:1px;top:11px;display:block;margin 0 2px 0 10px;">