Exemplo n.º 1
0
					</div>
					<div class="form-group has-feedback">
						<input type="password" class="form-control" name="dbpass" placeholder="<?php 
    $lh->translateText("database_password");
    ?>
"/>
						<span class="glyphicon glyphicon-lock form-control-feedback"></span>
					</div>
					<div class="form-group">
						<p><?php 
    $lh->translateText("detected_timezone");
    ?>
</p>
	                    <?php 
    // Timezones
    $tzs = \creamy\CRMUtils::getTimezonesAsArray();
    print '<select name="userTimeZone" id="userTimeZone" class="form-control">';
    foreach ($tzs as $key => $value) {
        print '<option value="' . $key . '">' . $value . '</option>';
    }
    print '</select>';
    ?>
	                </div>
	                <div class="form-group">
						<p><?php 
    $lh->translateText("choose_language");
    ?>
</p>
						<select name="desiredLanguage" id="desiredLanguage" class="form-control">
							<?php 
    $locales = \creamy\LanguageHandler::getAvailableLanguages();
Exemplo n.º 2
0
    /** Returns the HTML form for modyfing the system settings */
    public function getGeneralSettingsForm()
    {
        // current settings values
        $baseURL = $this->db->getSettingValueForKey(CRM_SETTING_CRM_BASE_URL);
        $tz = $this->db->getSettingValueForKey(CRM_SETTING_TIMEZONE);
        $lo = $this->db->getSettingValueForKey(CRM_SETTING_LOCALE);
        $ct = $this->db->getSettingValueForKey(CRM_SETTING_THEME);
        if (empty($ct)) {
            $ct = CRM_SETTING_DEFAULT_THEME;
        }
        $ce = $this->db->getSettingValueForKeyAsBooleanValue(CRM_SETTING_CONFIRMATION_EMAIL);
        $cv = $this->db->getSettingValueForKeyAsBooleanValue(CRM_SETTING_EVENTS_EMAIL);
        $cn = $this->db->getSettingValueForKey(CRM_SETTING_COMPANY_NAME);
        $cl = $this->db->getSettingValueForKey(CRM_SETTING_COMPANY_LOGO);
        if (isset($cl)) {
            $cl = $this->imageWithData($cl, "", null);
        }
        $tOpts = array("black" => "black", "blue" => "blue", "green" => "green", "minimalist" => "minimalist", "purple" => "purple", "red" => "red", "yellow" => "yellow");
        // translation.
        $em_text = $this->lh->translationFor("require_confirmation_email");
        $ev_text = $this->lh->translationFor("send_event_email");
        $es_text = $this->lh->translationFor("choose_theme");
        $tz_text = $this->lh->translationFor("detected_timezone");
        $lo_text = $this->lh->translationFor("choose_language");
        $ok_text = $this->lh->translationFor("settings_successfully_changed");
        $bu_text = $this->lh->translationFor("base_url");
        $cn_text = $this->lh->translationFor("company_name");
        $cl_text = $this->lh->translationFor("custom_company_logo");
        // form
        $form = '<form role="form" id="adminsettings" name="adminsettings" class="form" enctype="multipart/form-data">
			  ' . $this->singleFormGroupWithInputGroup($this->singleFormInputElement("base_url", "base_url", "text", $bu_text, $baseURL, "globe"), $bu_text) . '
	    	  <label>' . $this->lh->translationFor("messages") . '</label>
			  ' . $this->checkboxInputWithLabel($em_text, "confirmationEmail", "confirmationEmail", $ce) . '
			  ' . $this->checkboxInputWithLabel($ev_text, "eventEmail", "eventEmail", $cv) . '
			  ' . $this->singleFormGroupWithInputGroup($this->singleFormInputElement("company_name", "company_name", "text", $cn_text, $cn, "building-o"), $cn_text) . '
			  ' . $this->singleFormGroupWithFileUpload("company_logo", "company_logo", $cl, $cl_text, null) . '
			  ' . $this->singleFormGroupWithSelect($es_text, "theme", "theme", $tOpts, $ct, false) . '
			  ' . $this->singleFormGroupWithSelect($tz_text, "timezone", "timezone", \creamy\CRMUtils::getTimezonesAsArray(), $tz) . '
			  ' . $this->singleFormGroupWithSelect($lo_text, "locale", "locale", \creamy\LanguageHandler::getAvailableLanguages(), $lo) . '
			  <div class="box-footer">
			  ' . $this->emptyMessageDivWithTag(CRM_UI_DEFAULT_RESULT_MESSAGE_TAG) . '
			  <button type="submit" class="btn btn-primary">' . $this->lh->translationFor("modify") . '</button></div></form>';
        return $form;
    }