当前位置: 首页>>代码示例>>PHP>>正文


PHP iMSCP_pTemplate::assign方法代码示例

本文整理汇总了PHP中iMSCP_pTemplate::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP iMSCP_pTemplate::assign方法的具体用法?PHP iMSCP_pTemplate::assign怎么用?PHP iMSCP_pTemplate::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iMSCP_pTemplate的用法示例。


在下文中一共展示了iMSCP_pTemplate::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: admin_generatePage

/**
 * Generate page
 *
 * @param  iMSCP_pTemplate $tpl
 * @return void
 */
function admin_generatePage($tpl)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    if (!isset($cfg['CHECK_FOR_UPDATES']) || !$cfg['CHECK_FOR_UPDATES']) {
        set_page_message(tr('i-MSCP version update checking is disabled'), 'static_warning');
    } else {
        /** @var iMSCP_Update_Version $updateVersion */
        $updateVersion = iMSCP_Update_Version::getInstance();
        if ($updateVersion->isAvailableUpdate()) {
            if ($updateInfo = $updateVersion->getUpdateInfo()) {
                $date = new DateTime($updateInfo['published_at']);
                $tpl->assign(array('TR_UPDATE_INFO' => tr('Update info'), 'TR_RELEASE_VERSION' => tr('Release version'), 'RELEASE_VERSION' => tohtml($updateInfo['tag_name']), 'TR_RELEASE_DATE' => tr('Release date'), 'RELEASE_DATE' => tohtml($date->format($cfg['DATE_FORMAT'])), 'TR_RELEASE_DESCRIPTION' => tr('Release description'), 'RELEASE_DESCRIPTION' => tohtml($updateInfo['body']), 'TR_DOWNLOAD_LINKS' => tr('Download links'), 'TR_DOWNLOAD_ZIP' => tr('Download ZIP'), 'TR_DOWNLOAD_TAR' => tr('Download TAR'), 'TARBALL_URL' => tohtml($updateInfo['tarball_url']), 'ZIPBALL_URL' => tohtml($updateInfo['zipball_url'])));
                return;
            } else {
                set_page_message($updateVersion->getError(), 'error');
            }
        } elseif ($updateVersion->getError()) {
            set_page_message($updateVersion, 'error');
        } else {
            set_page_message(tr('No update available'), 'static_info');
        }
    }
    $tpl->assign('UPDATE_INFO', '');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:31,代码来源:imscp_updates.php

示例2: client_generateDirectoriesList

/**
 * Generates directories list.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @return void
 */
function client_generateDirectoriesList($tpl)
{
    // Initialize variables
    $path = isset($_GET['cur_dir']) ? clean_input($_GET['cur_dir']) : '';
    $domain = $_SESSION['user_logged'];
    // Create the virtual file system and open it so it can be used
    $vfs = new iMSCP_VirtualFileSystem($domain);
    // Get the directory listing
    $list = $vfs->ls($path);
    if (!$list) {
        set_page_message(tr('Unable to retrieve directories list for your domain. Please contact your reseller.'), 'error');
        $tpl->assign('FTP_CHOOSER', '');
        return;
    }
    // Show parent directory link
    $parent = explode('/', $path);
    array_pop($parent);
    $parent = implode('/', $parent);
    $tpl->assign(array('ACTION_LINK' => '', 'ACTION' => '', 'ICON' => 'parent', 'DIR_NAME' => tr('Parent directory'), 'LINK' => "ftp_choose_dir.php?cur_dir={$parent}"));
    $tpl->parse('DIR_ITEM', '.dir_item');
    // Show directories only
    foreach ($list as $entry) {
        $directory = $path . '/' . $entry['file'];
        if ($entry['type'] != iMSCP_VirtualFileSystem::VFS_TYPE_DIR || ($entry['file'] == '.' || $entry['file'] == '..') || !isAllowedDir(get_user_domain_id($_SESSION['user_id']), $directory)) {
            continue;
        }
        // Create the directory link
        $tpl->assign(array('DIR_NAME' => tohtml($entry['file']), 'CHOOSE_IT' => $directory, 'LINK' => 'ftp_choose_dir.php?cur_dir=' . $directory));
        $tpl->parse('ACTION_LINK', 'action_link');
        $tpl->parse('DIR_ITEM', '.dir_item');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:38,代码来源:ftp_choose_dir.php

示例3: selectedGraphic

/**
 * Generate graph list
 *
 * @param TemplateEngine $tpl
 * @param string $graphName Graphic name
 * @param string $showWhen Period to show
 */
function selectedGraphic($tpl, $graphName, $showWhen)
{
    $cfg = Registry::get('config');
    /** @var PluginManager $pluginManager */
    $pluginManager = Registry::get('pluginManager');
    $graphDirectory = $pluginManager->pluginGetDirectory() . '/Monitorix/themes/default/assets/images/graphs';
    $monitorixGraphics = array();
    if ($dirHandle = @opendir($graphDirectory)) {
        while (($file = @readdir($dirHandle)) !== false) {
            if (!is_dir($file) && preg_match("/^{$graphName}\\d+[a-y]?[z]\\.\\d{$showWhen}\\.png/", $file)) {
                array_push($monitorixGraphics, $file);
            }
        }
        closedir($dirHandle);
        if (count($monitorixGraphics) > 0) {
            sort($monitorixGraphics);
            foreach ($monitorixGraphics as $graphValue) {
                $tpl->assign('MONITORIXGRAPH', pathinfo($graphValue, PATHINFO_FILENAME) . '.png');
                $tpl->parse('MONITORIX_GRAPH_ITEM', '.monitorix_graph_item');
            }
            $tpl->assign('MONITORIXGRAPH_ERROR', '');
        } else {
            $tpl->assign(array('MONITORIXGRAPH_SELECTED' => '', 'MONITORIXGRAPHIC_ERROR' => tr("No graph for your selection is available")));
        }
    } else {
        $tpl->assign(array('MONITORIXGRAPH_SELECTED' => '', 'MONITORIXGRAPHIC_ERROR' => tr("An error occured while opening the directory: %s", $graphDirectory)));
    }
    $htmlSelected = $cfg['HTML_SELECTED'];
    $tpl->assign(array('M_HOUR_SELECTED' => $showWhen == 'hour' ? $htmlSelected : '', 'M_DAY_SELECTED' => $showWhen == 'day' ? $htmlSelected : '', 'M_WEEK_SELECTED' => $showWhen == 'week' ? $htmlSelected : '', 'M_MONTH_SELECTED' => $showWhen == 'month' ? $htmlSelected : '', 'M_YEAR_SELECTED' => $showWhen == 'year' ? $htmlSelected : '', 'MONITORIXGRAPH_NOT_SELECTED' => ''));
}
开发者ID:nciftci,项目名称:plugins,代码行数:37,代码来源:monitorix.php

示例4: client_generatePage

/**
 * Generates page.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @param int $dmn_id Domain unique identifier
 * @return void
 */
function client_generatePage($tpl, &$dmn_id)
{
    if (isset($_GET['uname']) && $_GET['uname'] !== '' && is_numeric($_GET['uname'])) {
        $uuser_id = $_GET['uname'];
        $tpl->assign('UNAME', tohtml(client_getHtaccessUsername($uuser_id, $dmn_id)));
        $tpl->assign('UID', $uuser_id);
    } else {
        if (isset($_POST['nadmin_name']) && !empty($_POST['nadmin_name']) && is_numeric($_POST['nadmin_name'])) {
            $uuser_id = $_POST['nadmin_name'];
            $tpl->assign('UNAME', tohtml(client_getHtaccessUsername($uuser_id, $dmn_id)));
            $tpl->assign('UID', $uuser_id);
        } else {
            redirectTo('protected_user_manage.php');
            exit;
            // Useless but avoid stupid IDE warning about possibled undefined variable
        }
    }
    // get groups
    $query = "SELECT * FROM `htaccess_groups` WHERE `dmn_id` = ?";
    $stmt = exec_query($query, $dmn_id);
    if ($stmt->rowCount() == 0) {
        set_page_message(tr('You have no groups.'), 'error');
        redirectTo('protected_user_manage.php');
    } else {
        $added_in = 0;
        $not_added_in = 0;
        while (!$stmt->EOF) {
            $group_id = $stmt->fields['id'];
            $group_name = $stmt->fields['ugroup'];
            $members = $stmt->fields['members'];
            $members = explode(",", $members);
            $grp_in = 0;
            // let's generete all groups wher the user is assigned
            for ($i = 0, $cnt_members = count($members); $i < $cnt_members; $i++) {
                if ($uuser_id == $members[$i]) {
                    $tpl->assign(array('GRP_IN' => tohtml($group_name), 'GRP_IN_ID' => $group_id));
                    $tpl->parse('ALREADY_IN', '.already_in');
                    $grp_in = $group_id;
                    $added_in++;
                }
            }
            if ($grp_in !== $group_id) {
                $tpl->assign(array('GRP_NAME' => tohtml($group_name), 'GRP_ID' => $group_id));
                $tpl->parse('GRP_AVLB', '.grp_avlb');
                $not_added_in++;
            }
            $stmt->moveNext();
        }
        // generate add/remove buttons
        if ($added_in < 1) {
            $tpl->assign('IN_GROUP', '');
        }
        if ($not_added_in < 1) {
            $tpl->assign('NOT_IN_GROUP', '');
        }
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:64,代码来源:protected_user_assign.php

示例5: generatePhpBlock

/**
 * Generate PHP editor block
 *
 * @param iMSCP_pTemplate $tpl
 * @return void
 */
function generatePhpBlock($tpl)
{
    $phpini = iMSCP_PHPini::getInstance();
    if (!$phpini->resellerHasPermission('phpiniSystem')) {
        $tpl->assign('PHP_EDITOR_BLOCK', '');
    }
    $tpl->assign(array('PHP_EDITOR_YES' => $phpini->clientHasPermission('phpiniSystem') ? ' checked' : '', 'PHP_EDITOR_NO' => $phpini->clientHasPermission('phpiniSystem') ? '' : ' checked', 'TR_PHP_EDITOR' => tr('PHP Editor'), 'TR_PHP_EDITOR_SETTINGS' => tr('PHP Settings'), 'TR_SETTINGS' => tr('PHP Settings'), 'TR_DIRECTIVES_VALUES' => tr('PHP Configuration options'), 'TR_FIELDS_OK' => tr('All fields are valid.'), 'TR_MIB' => tr('MiB'), 'TR_SEC' => tr('Sec.')));
    iMSCP_Events_Aggregator::getInstance()->registerListener('onGetJsTranslations', function ($e) {
        /** @var iMSCP_Events_Event $e */
        $translations = $e->getParam('translations');
        $translations['core']['close'] = tr('Close');
        $translations['core']['fields_ok'] = tr('All fields are valid.');
        $translations['core']['out_of_range_value_error'] = tr('Value for the PHP %%s directive must be in range %%d to %%d.');
        $translations['core']['lower_value_expected_error'] = tr('%%s must be lower than %%s.');
    });
    $permissionsBlock = false;
    if (!$phpini->resellerHasPermission('phpiniAllowUrlFopen')) {
        $tpl->assign('PHP_EDITOR_ALLOW_URL_FOPEN_BLOCK', '');
    } else {
        $tpl->assign(array('TR_CAN_EDIT_ALLOW_URL_FOPEN' => tr('Can edit the PHP %s configuration option', '<b>allow_url_fopen</b>'), 'ALLOW_URL_FOPEN_YES' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? ' checked' : '', 'ALLOW_URL_FOPEN_NO' => $phpini->clientHasPermission('phpiniAllowUrlFopen') ? '' : ' checked'));
        $permissionsBlock = true;
    }
    if (!$phpini->resellerHasPermission('phpiniDisplayErrors')) {
        $tpl->assign('PHP_EDITOR_DISPLAY_ERRORS_BLOCK', '');
    } else {
        $tpl->assign(array('TR_CAN_EDIT_DISPLAY_ERRORS' => tr('Can edit the PHP %s configuration option', '<b>display_errors</b>'), 'DISPLAY_ERRORS_YES' => $phpini->clientHasPermission('phpiniDisplayErrors') ? ' checked' : '', 'DISPLAY_ERRORS_NO' => $phpini->clientHasPermission('phpiniDisplayErrors') ? '' : ' checked'));
        $permissionsBlock = true;
    }
    $cfg = iMSCP_Registry::get('config');
    if ($cfg['HTTPD_SERVER'] == 'apache_itk') {
        $tpl->assign(array('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK' => '', 'PHP_EDITOR_MAIL_FUNCTION_BLOCK' => ''));
    } else {
        if ($phpini->resellerHasPermission('phpiniDisableFunctions')) {
            $tpl->assign(array('TR_CAN_EDIT_DISABLE_FUNCTIONS' => tr('Can edit the PHP %s configuration option', '<b>disable_functions</b>'), 'DISABLE_FUNCTIONS_YES' => $phpini->getClientPermission('phpiniDisableFunctions') == 'yes' ? ' checked' : '', 'DISABLE_FUNCTIONS_NO' => $phpini->getClientPermission('phpiniDisableFunctions') == 'no' ? ' checked' : '', 'TR_ONLY_EXEC' => tr('Only exec'), 'DISABLE_FUNCTIONS_EXEC' => $phpini->getClientPermission('phpiniDisableFunctions') == 'exec' ? ' checked' : ''));
        } else {
            $tpl->assign('PHP_EDITOR_DISABLE_FUNCTIONS_BLOCK', '');
        }
        if ($phpini->resellerHasPermission('phpiniMailFunction')) {
            $tpl->assign(array('TR_CAN_USE_MAIL_FUNCTION' => tr('Can use the PHP %s function', '<b>mail</b>'), 'MAIL_FUNCTION_YES' => $phpini->clientHasPermission('phpiniMailFunction') ? ' checked' : '', 'MAIL_FUNCTION_NO' => $phpini->clientHasPermission('phpiniMailFunction') ? '' : ' checked'));
        } else {
            $tpl->assign('PHP_EDITOR_MAIL_FUNCTION_BLOCK', '');
        }
        $permissionsBlock = true;
    }
    if (!$permissionsBlock) {
        $tpl->assign('PHP_EDITOR_PERMISSIONS_BLOCK', '');
    } else {
        $tpl->assign(array('TR_PERMISSIONS' => tr('PHP Permissions'), 'TR_ONLY_EXEC' => tr('Only exec')));
    }
    $tpl->assign(array('TR_POST_MAX_SIZE' => tr('PHP %s configuration option', '<b>post_max_size</b>'), 'POST_MAX_SIZE' => tohtml($phpini->getDomainIni('phpiniPostMaxSize'), 'htmlAttr'), 'TR_UPLOAD_MAX_FILEZISE' => tr('PHP %s configuration option', '<b>upload_max_filesize</b>'), 'UPLOAD_MAX_FILESIZE' => tohtml($phpini->getDomainIni('phpiniUploadMaxFileSize'), 'htmlAttr'), 'TR_MAX_EXECUTION_TIME' => tr('PHP %s configuration option', '<b>max_execution_time</b>'), 'MAX_EXECUTION_TIME' => tohtml($phpini->getDomainIni('phpiniMaxExecutionTime'), 'htmlAttr'), 'TR_MAX_INPUT_TIME' => tr('PHP %s configuration option', '<b>max_input_time</b>'), 'MAX_INPUT_TIME' => tohtml($phpini->getDomainIni('phpiniMaxInputTime'), 'htmlAttr'), 'TR_MEMORY_LIMIT' => tr('PHP %s configuration option', '<b>memory_limit</b>'), 'MEMORY_LIMIT' => tohtml($phpini->getDomainIni('phpiniMemoryLimit'), 'htmlAttr'), 'POST_MAX_SIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniPostMaxSize'), 'htmlAttr'), 'UPLOAD_MAX_FILESIZE_LIMIT' => tohtml($phpini->getResellerPermission('phpiniUploadMaxFileSize'), 'htmlAttr'), 'MAX_EXECUTION_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxExecutionTime'), 'htmlAttr'), 'MAX_INPUT_TIME_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMaxInputTime'), 'htmlAttr'), 'MEMORY_LIMIT_LIMIT' => tohtml($phpini->getResellerPermission('phpiniMemoryLimit'), 'htmlAttr')));
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:57,代码来源:hosting_plan_edit.php

示例6: client_databasesList

/**
 * Generates databases list
 *
 * @param iMSCP_pTemplate $tpl Template engine
 * @param int $dmnId Domain unique identifier
 * @return void
 */
function client_databasesList($tpl, $dmnId)
{
    $stmt = exec_query('SELECT sqld_id, sqld_name FROM sql_database WHERE domain_id = ? ORDER BY sqld_name ', $dmnId);
    if (!$stmt->rowCount()) {
        set_page_message(tr('You do not have databases.'), 'static_info');
        $tpl->assign('SQL_DATABASES_USERS_LIST', '');
    } else {
        while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
            $tpl->assign(array('DB_ID' => $row['sqld_id'], 'DB_NAME' => tohtml($row['sqld_name']), 'DB_NAME_JS' => tojs($row['sqld_name'])));
            _client_generateDatabaseSqlUserList($tpl, $row['sqld_id']);
            $tpl->parse('SQL_DATABASES_LIST', '.sql_databases_list');
        }
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:21,代码来源:sql_manage.php

示例7: admin_generateLanguagesList

/**
 * Generate page
 *
 * @param iMSCP_pTemplate $tpl Template engine
 * @return void
 */
function admin_generateLanguagesList($tpl)
{
    $cfg = iMSCP_Registry::get('config');
    $defaultLanguage = $cfg['USER_INITIAL_LANG'];
    $availableLanguages = i18n_getAvailableLanguages();
    if (!empty($availableLanguages)) {
        foreach ($availableLanguages as $languageDefinition) {
            $tpl->assign(array('LANGUAGE_NAME' => tohtml($languageDefinition['language']), 'NUMBER_TRANSLATED_STRINGS' => tohtml(tr('%d strings translated', $languageDefinition['translatedStrings'])), 'LANGUAGE_REVISION' => tohtml($languageDefinition['revision']), 'LOCALE_CHECKED' => $languageDefinition['locale'] == $defaultLanguage ? 'checked' : '', 'LOCALE' => tohtml($languageDefinition['locale'], 'htmlAttr')));
            $tpl->parse('LANGUAGE_BLOCK', '.language_block');
        }
    } else {
        $tpl->assign('LANGUAGES_BLOCK', '');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:20,代码来源:multilanguage.php

示例8: generatePageMessage

/**
 * Generates the page messages to display on client browser
 *
 * Note: The default level for message is sets to 'info'.
 * See the {@link set_page_message()} function for more information.
 *
 * @param  iMSCP_pTemplate $tpl iMSCP_pTemplate instance
 * @return void
 */
function generatePageMessage($tpl)
{
    $namespace = new Zend_Session_Namespace('pageMessages');
    if (Zend_Session::namespaceIsset('pageMessages')) {
        foreach (array('success', 'error', 'warning', 'info', 'static_success', 'static_error', 'static_warning', 'static_info') as $level) {
            if (isset($namespace->{$level})) {
                $tpl->assign(array('MESSAGE_CLS' => $level, 'MESSAGE' => $namespace->{$level}));
                $tpl->parse('PAGE_MESSAGE', '.page_message');
            }
        }
        Zend_Session::namespaceUnset('pageMessages');
    } else {
        $tpl->assign('PAGE_MESSAGE', '');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:24,代码来源:Layout.php

示例9: client_generateCatchallItem

/**
 * Generate catchall item
 *
 * @param iMSCP_pTemplate $tpl
 * @param string $action Action
 * @param int $dmnId Domain unique identifier
 * @param string $dmnName Domain name
 * @param int $mailId Mail unique identifier
 * @param string $mailAcc Mail account
 * @param string $mailStatus Mail account status
 * @param string $catchallType Catchall type
 * @return void
 */
function client_generateCatchallItem($tpl, $action, $dmnId, $dmnName, $mailId, $mailAcc, $mailStatus, $catchallType)
{
    $showDmnName = decode_idna($dmnName);
    if ($action == 'create') {
        $tpl->assign(array('CATCHALL_DOMAIN' => tohtml($showDmnName), 'CATCHALL_ACC' => tr('None'), 'TR_CATCHALL_STATUS' => tr('N/A'), 'TR_CATCHALL_ACTION' => tr('Create catch all'), 'CATCHALL_ACTION' => $action, 'CATCHALL_ACTION_SCRIPT' => "mail_catchall_add.php?id={$dmnId};{$catchallType}", 'DEL_ICON' => ''));
    } else {
        list($catchallAction, $catchallActionScript) = client_generateAction($mailId, $mailStatus);
        $showDmnName = decode_idna($dmnName);
        $showMailAcc = decode_idna($mailAcc);
        $tpl->assign(array('CATCHALL_DOMAIN' => tohtml($showDmnName), 'CATCHALL_ACC' => tohtml($showMailAcc), 'TR_CATCHALL_STATUS' => translate_dmn_status($mailStatus), 'TR_CATCHALL_ACTION' => $catchallAction, 'CATCHALL_ACTION' => $catchallAction, 'CATCHALL_ACTION_SCRIPT' => $catchallActionScript));
        if ($catchallActionScript == '#') {
            $tpl->assign('DEL_ICON', '');
        }
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:28,代码来源:mail_catchall.php

示例10: listIPDomains

/**
 * Generate List of Domains assigned to IPs
 *
 * @param  iMSCP_pTemplate $tpl Template engine
 * @return void
 */
function listIPDomains($tpl)
{
    $resellerId = $_SESSION['user_id'];
    $stmt = exec_query('SELECT reseller_ips FROM reseller_props WHERE reseller_id = ?', $resellerId);
    $data = $stmt->fetchRow();
    $resellerIps = explode(';', substr($data['reseller_ips'], 0, -1));
    $stmt = execute_query('SELECT ip_id, ip_number FROM server_ips WHERE ip_id IN (' . implode(',', $resellerIps) . ')');
    while ($ip = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
        $stmt2 = exec_query('
				SELECT
					domain_name
				FROM
					domain
				INNER JOIN
					admin ON(admin_id = domain_admin_id)
				WHERE
					domain_ip_id = :ip_id
				AND
					created_by = :reseller_id
				UNION
				SELECT
					alias_name AS domain_name
				FROM
					domain_aliasses
				INNER JOIN
					domain USING(domain_id)
				INNER JOIN
					admin ON(admin_id = domain_admin_id)
				WHERE
					alias_ip_id = :ip_id
				AND
					created_by = :reseller_id
			', array('ip_id' => $ip['ip_id'], 'reseller_id' => $resellerId));
        $domainsCount = $stmt2->rowCount();
        $tpl->assign(array('IP' => tohtml($ip['ip_number']), 'RECORD_COUNT' => tr('Total Domains') . ': ' . $domainsCount));
        if ($domainsCount) {
            while ($data = $stmt2->fetchRow(PDO::FETCH_ASSOC)) {
                $tpl->assign('DOMAIN_NAME', tohtml(idn_to_utf8($data['domain_name'])));
                $tpl->parse('DOMAIN_ROW', '.domain_row');
            }
        } else {
            $tpl->assign('DOMAIN_NAME', tr('No used yet'));
            $tpl->parse('DOMAIN_ROW', 'domain_row');
        }
        $tpl->parse('IP_ROW', '.ip_row');
        $tpl->assign('DOMAIN_ROW', '');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:54,代码来源:ip_usage.php

示例11: gen_reseller_personal_data

/**
 * @param iMSCP_pTemplate $tpl
 * @param $user_id
 */
function gen_reseller_personal_data($tpl, $user_id)
{
    $cfg = iMSCP_Registry::get('config');
    $query = "\n\t\tSELECT\n\t\t\t`fname`,\n\t\t\t`lname`,\n\t\t\t`gender`,\n\t\t\t`firm`,\n\t\t\t`zip`,\n\t\t\t`city`,\n\t\t\t`state`,\n\t\t\t`country`,\n\t\t\t`street1`,\n\t\t\t`street2`,\n\t\t\t`email`,\n\t\t\t`phone`,\n\t\t\t`fax`\n\t\tFROM\n\t\t\t`admin`\n\t\tWHERE\n\t\t\t`admin_id` = ?\n\t";
    $rs = exec_query($query, $user_id);
    $tpl->assign(array('FIRST_NAME' => $rs->fields['fname'] == null ? '' : tohtml($rs->fields['fname']), 'LAST_NAME' => $rs->fields['lname'] == null ? '' : tohtml($rs->fields['lname']), 'FIRM' => $rs->fields['firm'] == null ? '' : tohtml($rs->fields['firm']), 'ZIP' => $rs->fields['zip'] == null ? '' : tohtml($rs->fields['zip']), 'CITY' => $rs->fields['city'] == null ? '' : tohtml($rs->fields['city']), 'STATE' => $rs->fields['state'] == null ? '' : tohtml($rs->fields['state']), 'COUNTRY' => $rs->fields['country'] == null ? '' : tohtml($rs->fields['country']), 'STREET_1' => $rs->fields['street1'] == null ? '' : tohtml($rs->fields['street1']), 'STREET_2' => $rs->fields['street2'] == null ? '' : tohtml($rs->fields['street2']), 'EMAIL' => $rs->fields['email'] == null ? '' : tohtml($rs->fields['email']), 'PHONE' => $rs->fields['phone'] == null ? '' : tohtml($rs->fields['phone']), 'FAX' => $rs->fields['fax'] == null ? '' : tohtml($rs->fields['fax']), 'VL_MALE' => $rs->fields['gender'] == 'M' ? $cfg->HTML_SELECTED : '', 'VL_FEMALE' => $rs->fields['gender'] == 'F' ? $cfg->HTML_SELECTED : '', 'VL_UNKNOWN' => $rs->fields['gender'] == 'U' || empty($rs->fields['gender']) ? $cfg->HTML_SELECTED : ''));
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:11,代码来源:personal_change.php

示例12: reseller_generatePage

/**
 * Generates page.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 */
function reseller_generatePage($tpl)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    $query = "SELECT domain_created from admin where admin_id = ?";
    $stmt = exec_query($query, (int) $_SESSION['user_id']);
    $tpl->assign(array('TR_ACCOUNT_SUMMARY' => tr('Account summary'), 'TR_USERNAME' => tr('Username'), 'USERNAME' => tohtml($_SESSION['user_logged']), 'TR_ACCOUNT_TYPE' => tr('Account type'), 'ACCOUNT_TYPE' => $_SESSION['user_type'], 'TR_REGISTRATION_DATE' => tr('Registration date'), 'REGISTRATION_DATE' => $stmt->fields['domain_created'] != 0 ? date($cfg->DATE_FORMAT, $stmt->fields['domain_created']) : tr('Unknown')));
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:13,代码来源:profile.php

示例13: generatePage

/**
 * Generates page
 *
 * @param  iMSCP_pTemplate $tpl Template engine
 * @return void
 */
function generatePage($tpl)
{
    global $hpId, $dmnName, $adminName, $email, $customerId, $firstName, $lastName, $gender, $firm, $zip, $city, $state, $country, $street1, $street2, $phone, $fax, $domainIp;
    $adminName = decode_idna($adminName);
    $tpl->assign(array('VL_USERNAME' => tohtml($adminName, 'htmlAttr'), 'VL_MAIL' => tohtml($email, 'htmlAttr'), 'VL_USR_ID' => tohtml($customerId, 'htmlAttr'), 'VL_USR_NAME' => tohtml($firstName, 'htmlAttr'), 'VL_LAST_USRNAME' => tohtml($lastName, 'htmlAttr'), 'VL_USR_FIRM' => tohtml($firm, 'htmlAttr'), 'VL_USR_POSTCODE' => tohtml($zip, 'htmlAttr'), 'VL_USRCITY' => tohtml($city, 'htmlAttr'), 'VL_USRSTATE' => tohtml($state, 'htmlAttr'), 'VL_MALE' => $gender == 'M' ? ' selected' : '', 'VL_FEMALE' => $gender == 'F' ? ' selected' : '', 'VL_UNKNOWN' => $gender == 'U' ? ' selected' : '', 'VL_COUNTRY' => tohtml($country, 'htmlAttr'), 'VL_STREET1' => tohtml($street1, 'htmlAttr'), 'VL_STREET2' => tohtml($street2, 'htmlAttr'), 'VL_PHONE' => tohtml($phone, 'htmlAttr'), 'VL_FAX' => tohtml($fax, 'htmlAttr')));
    reseller_generate_ip_list($tpl, $_SESSION['user_id'], $domainIp);
    $_SESSION['local_data'] = "{$dmnName};{$hpId}";
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:14,代码来源:user_add3.php

示例14: _client_generateItem

/**
 * Generate an external mail server item
 *
 * @access private
 * @param iMSCP_pTemplate $tpl Template instance
 * @param string $externalMail Status of external mail for the domain
 * @param int $domainId Domain id
 * @param string $domainName Domain name
 * @param string $status Item status
 * @param string $type Domain type (normal for domain or alias for domain alias)
 * @return void
 */
function _client_generateItem($tpl, $externalMail, $domainId, $domainName, $status, $type)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    $idnDomainName = decode_idna($domainName);
    $statusOk = 'ok';
    $queryParam = urlencode("{$domainId};{$type}");
    $htmlDisabled = $cfg['HTML_DISABLED'];
    if ($externalMail == 'off') {
        $tpl->assign(array('DOMAIN' => $idnDomainName, 'STATUS' => $status == $statusOk ? tr('Deactivated') : translate_dmn_status($status), 'DISABLED' => $htmlDisabled, 'ITEM_TYPE' => $type, 'ITEM_ID' => $domainId, 'ACTIVATE_URL' => $status == $statusOk ? "mail_external_add.php?item={$queryParam}" : '#', 'TR_ACTIVATE' => $status == $statusOk ? tr('Activate') : tr('N/A'), 'EDIT_LINK' => '', 'DEACTIVATE_LINK' => ''));
        $tpl->parse('ACTIVATE_LINK', 'activate_link');
    } elseif (in_array($externalMail, array('domain', 'wildcard', 'filter'))) {
        $tpl->assign(array('DOMAIN' => $idnDomainName, 'STATUS' => $status == $statusOk ? tr('Activated') : translate_dmn_status($status), 'DISABLED' => $status == $statusOk ? '' : $htmlDisabled, 'ITEM_TYPE' => $type, 'ITEM_ID' => $domainId, 'ACTIVATE_LINK' => '', 'TR_EDIT' => $status == $statusOk ? tr('Edit') : tr('N/A'), 'EDIT_URL' => $status == $statusOk ? "mail_external_edit.php?item={$queryParam}" : '#', 'TR_DEACTIVATE' => $status == $statusOk ? tr('Deactivate') : tr('N/A'), 'DEACTIVATE_URL' => $status == $statusOk ? "mail_external_delete.php?item={$queryParam}" : '#'));
        $tpl->parse('EDIT_LINK', 'edit_link');
        $tpl->parse('DEACTIVATE_LINK', 'deactivate_link');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:29,代码来源:mail_external.php

示例15: client_hideDisabledFeatures

/**
 * Hide disabled feature.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 */
function client_hideDisabledFeatures($tpl)
{
    if (!customerHasFeature('backup')) {
        $tpl->assign('BACKUP_FEATURE', '');
    }
    $webmails = getWebmailList();
    if (!customerHasFeature('mail') || empty($webmails)) {
        $tpl->assign('MAIL_FEATURE', '');
    } else {
        if (in_array('Roundcube', $webmails)) {
            $tpl->assign('WEBMAIL_RPATH', '/webmail');
        } else {
            $tpl->assign('WEBMAIL_RPATH', '/' . strtolower($webmails[0]));
        }
    }
    if (!customerHasFeature('ftp')) {
        $tpl->assign('FTP_FEATURE', '');
    }
    if (!customerHasFeature('aps')) {
        $tpl->assign('APS_FEATURE', '');
    }
    if (!customerHasFeature('webstats')) {
        $tpl->assign('WEBSTATS_FEATURE', '');
    }
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:30,代码来源:webtools.php


注:本文中的iMSCP_pTemplate::assign方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。