本文整理汇总了PHP中Vtiger_Viewer::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Viewer::getInstance方法的具体用法?PHP Vtiger_Viewer::getInstance怎么用?PHP Vtiger_Viewer::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Viewer
的用法示例。
在下文中一共展示了Vtiger_Viewer::getInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changePassword
public function changePassword($data)
{
global $site_URL;
$request = new Vtiger_Request($data);
$userName = $request->get('username');
$viewer = Vtiger_Viewer::getInstance();
$companyModel = Vtiger_CompanyDetails_Model::getInstanceById();
$companyName = $companyModel->get('organizationname');
$organisationDetails = $companyModel->getLogo();
$logoTitle = $organisationDetails->get('title');
$logoName = $organisationDetails->get('imagename');
$moduleName = 'Users';
$viewer->assign('LOGOURL', $site_URL . '/test/logo/' . $logoName);
$viewer->assign('TITLE', $logoTitle);
$viewer->assign('COMPANYNAME', $companyName);
$viewer->assign('USERNAME', $userName);
$changePasswordTrackUrl = $site_URL . "/modules/Users/actions/ForgotPassword.php";
$viewer->assign('TRACKURL', $changePasswordTrackUrl);
$expiryTime = (int) $request->get('time') + 24 * 60 * 60;
$currentTime = time();
if ($expiryTime > $currentTime) {
$secretToken = uniqid();
$secretHash = md5($userName . $secretToken);
$options = array('handler_path' => 'modules/Users/handlers/ForgotPassword.php', 'handler_class' => 'Users_ForgotPassword_Handler', 'handler_function' => 'changePassword', 'onetime' => 1, 'handler_data' => array('username' => $userName, 'secret_token' => $secretToken, 'secret_hash' => $secretHash));
$trackURL = Vtiger_ShortURL_Helper::generateURL($options);
$shortURLID = explode('id=', $trackURL);
$viewer->assign('SHORTURL_ID', $shortURLID[1]);
$viewer->assign('SECRET_HASH', $secretHash);
} else {
$viewer->assign('LINK_EXPIRED', true);
}
$viewer->assign('TRACKURL', $changePasswordTrackUrl);
$viewer->assign('MODULE', $moduleName);
$viewer->view('ForgotPassword.tpl', $moduleName);
}
示例2: changePassword
public function changePassword($request)
{
$request = new Vtiger_Request($request);
$viewer = Vtiger_Viewer::getInstance();
$userName = $request->get('username');
$newPassword = $request->get('password');
$confirmPassword = $request->get('confirmPassword');
$shortURLID = $request->get('shorturl_id');
$secretHash = $request->get('secret_hash');
$shortURLModel = Vtiger_ShortURL_Helper::getInstance($shortURLID);
$secretToken = $shortURLModel->handler_data['secret_token'];
$validateData = array('username' => $userName, 'secret_token' => $secretToken, 'secret_hash' => $secretHash);
$valid = $shortURLModel->compareEquals($validateData);
if ($valid) {
$userId = getUserId_Ol($userName);
$user = Users::getActiveAdminUser();
$wsUserId = vtws_getWebserviceEntityId('Users', $userId);
vtws_changePassword($wsUserId, '', $newPassword, $confirmPassword, $user);
} else {
$viewer->assign('ERROR', true);
}
$shortURLModel->delete();
$viewer->assign('USERNAME', $userName);
$viewer->assign('PASSWORD', $newPassword);
$viewer->view('FPLogin.tpl', 'Users');
}
示例3: viewController
function viewController()
{
$smarty = Vtiger_Viewer::getInstance();
foreach ($this->parameters as $k => $v) {
$smarty->assign($k, $v);
}
$smarty->assign("IS_SAFARI", Mobile::isSafari());
$smarty->assign("SKIN", Mobile::config('Default.Skin'));
return $smarty;
}
示例4: changePassword
public function changePassword($request)
{
$request = new Vtiger_Request($request);
$viewer = Vtiger_Viewer::getInstance();
$username = $request->get('username');
$newPassword = $request->get('password');
$confirmPassword = $request->get('confirmPassword');
$userId = getUserId_Ol($username);
$user = Users::getActiveAdminUser();
$wsUserId = vtws_getWebserviceEntityId('Users', $userId);
vtws_changePassword($wsUserId, '', $newPassword, $confirmPassword, $user);
$viewer->assign('USERNAME', $username);
$viewer->assign('PASSWORD', $newPassword);
$viewer->view('FPLogin.tpl', 'Users');
}
示例5: changePassword
public function changePassword($data) {
global $site_URL;
$request = new Vtiger_Request($data);
$viewer = Vtiger_Viewer::getInstance();
$companyModel = Vtiger_CompanyDetails_Model::getInstanceById();
$companyName = $companyModel->get('organizationname');
$organisationDetails = $companyModel->getLogo();
$logoTitle = $organisationDetails->get('title');
$logoName = $organisationDetails->get('imagepath');
$moduleName = 'Users';
$viewer->assign('LOGOURL', $site_URL . $logoName);
$viewer->assign('TITLE', $logoTitle);
$viewer->assign('COMPANYNAME', $companyName);
$viewer->assign('USERNAME', $request->get('username'));
$changePasswordTrackUrl = $site_URL . "modules/Users/actions/ForgotPassword.php";
$viewer->assign('TRACKURL', $changePasswordTrackUrl);
$viewer->view('ForgotPassword.tpl', $moduleName);
}
示例6: renderFrontend
/**
* @param $data - Config Array of this Input with the following Structure
* array(
* 'label' => 'Label the Function should use',
* 'name' => 'The Fieldname, which should submit the value, the Workflow will be write to Environment',
* 'config' => Key-Value Array with all configurations, done by admin
* )
* @param \Workflow\VTEntity $context - Current Record, which is assigned to the Workflow
* @return array - The rendered content, shown to the user with the following structure
* array(
* 'html' => '<htmlContentOfThisInputField>',
* 'javascript' => 'A Javascript executed after html is shown'
* )
*
*/
public function renderFrontend($data, $context)
{
$adb = \PearDatabase::getInstance();
/**
* @var \Vtiger_Viewer $viewer
*/
$viewer = \Vtiger_Viewer::getInstance();
$html = '';
$script = '';
$fieldId = 'field_' . preg_replace('/[^a-zA-Z0-9_]/', '_', $data['name']);
$field1 = '<div class="insertReferencefield" style="float:right;" data-name="' . $data['name'] . '][accountid" data-module="Accounts"></div>';
$field2 = '<div class="insertReferencefield" style="float:right;" data-name="' . $data['name'] . '][contactid" data-module="Contacts" data-parentfield="' . $data['name'] . '][accountid"></div>';
$html .= "<label><div style='min-height:26px;padding:2px 0;'><div style=''><strong>" . $data['label'] . "</strong></div><div style='text-align:right;'><div style='overflow:hidden;'><strong>Organization</strong><br/>" . $field1 . "</div><div style='overflow:hidden;'><strong>Contact</strong><br/>" . $field2 . "</div></div></div></label>";
$script = '';
if (!empty($data['config']['nullable'])) {
$script .= 'jQuery("#' . $fieldId . '").select2("val", "");';
}
$script .= 'jQuery(function() { jQuery("#contactid_contactid_display").attr("readonly", "readonly"); });';
return array('html' => $html, 'javascript' => $script);
}
示例7: getViewer
function getViewer(Vtiger_Request $request)
{
if (!$this->viewer) {
$viewer = Vtiger_Viewer::getInstance();
$viewer->assign('APPTITLE', getTranslatedString('APPTITLE'));
$viewer->assign('YETIFORCE_VERSION', vglobal('YetiForce_current_version'));
if ($request->isAjax()) {
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
if ($request->get('parent') == 'Settings') {
$viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
}
}
$this->viewer = $viewer;
}
return $this->viewer;
}
示例8: vtemplate_path
function vtemplate_path($templateName, $moduleName = '')
{
$viewerInstance = Vtiger_Viewer::getInstance();
$args = func_get_args();
return call_user_func_array(array($viewerInstance, 'getTemplatePath'), $args);
}