本文整理汇总了PHP中HTML::print_template方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::print_template方法的具体用法?PHP HTML::print_template怎么用?PHP HTML::print_template使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::print_template方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
try {
if (isset($new_parts)) {
$new_parts_loop = Part::build_template_table_array($new_parts, 'imported_parts');
}
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('upload');
if (isset($import_data)) {
$html->set_loop('table', $table_loop);
$html->set_variable('table_rowcount', count($import_data), 'integer');
$html->print_template('check_data');
}
if (strlen($file_content) > 0) {
$html->print_template('file_content');
}
if (isset($new_parts_loop)) {
$html->set_loop('table', $new_parts_loop);
$html->print_template('new_parts');
}
if ($action == 'default') {
$html->print_template('file_examples');
}
示例2: Category
$html->set_variable('manufacturer_list', $manufacturer_list, 'string');
$html->set_variable('category_list', $category_list, 'string');
$html->set_variable('storelocation_list', $storelocation_list, 'string');
$html->set_variable('footprint_list', $footprint_list, 'string');
// global/category stuff
$category = new Category($database, $current_user, $log, $category_id);
$html->set_variable('disable_footprints', $config['footprints']['disable'] || $category->get_disable_footprints(true), 'boolean');
$html->set_variable('disable_manufacturers', $config['manufacturers']['disable'] || $category->get_disable_manufacturers(true), 'boolean');
$html->set_variable('max_upload_filesize', ini_get('upload_max_filesize'), 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
// an empty string in "$reload_link" means that the reload-button won't be visible
$reload_link = $fatal_error && $action != 'delete_part_confirmed' ? 'edit_part_info.php?pid=' . $part_id : '';
$html->print_header($messages, $reload_link);
if (!$fatal_error) {
$html->print_template('part');
if (!($is_new_part || $add_one_more_part)) {
$html->print_template('orderdetails');
$html->print_template('attachements');
$html->print_template('actions');
}
}
$html->print_footer();
示例3: phpversion
$html->set_variable('tools_footprints_autoload', $config['tools']['footprints']['autoload'], 'boolean');
$html->set_variable('developer_mode_available', file_exists(BASE . '/development'), 'boolean');
$html->set_variable('enable_developer_mode', $config['developer_mode'], 'boolean');
$html->set_variable('enable_dokuwiki_write_perms', file_exists(DOKUWIKI_PERMS_FILENAME), 'boolean');
// popup settings
$html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean');
$html->set_variable('popup_width', $config['popup']['width'], 'integer');
$html->set_variable('popup_height', $config['popup']['height'], 'integer');
// site properties
$html->set_variable('page_title', $config['page_title'], 'string');
$html->set_variable('startup_banner', $config['startup']['custom_banner'], 'string');
// server
$html->set_variable('php_version', phpversion(), 'string');
$html->set_variable('htaccess_works', getenv('htaccessWorking') == 'true', 'boolean');
$html->set_variable('is_online_demo', $config['is_online_demo'], 'boolean');
// check if the server supports the selected language and print a warning if not
if (!own_setlocale(LC_ALL, $config['language'])) {
$messages[] = array('text' => 'Achtung:', 'strong' => true, 'color' => 'red');
$messages[] = array('text' => 'Die gewählte Sprache "' . $config['language'] . '" wird vom Server nicht unterstützt!', 'color' => 'red');
$messages[] = array('text' => 'Bitte installieren Sie diese Sprache oder wählen Sie eine andere.', 'color' => 'red');
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('system_config');
}
$html->print_footer();
示例4: catch
$html->set_loop('table', $table_loop);
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->use_javascript(array('popup'));
if (!$fatal_error) {
// global stuff
$html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean');
$html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean');
$html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean');
$html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean');
$html->set_variable('popup_width', $config['popup']['width'], 'integer');
$html->set_variable('popup_height', $config['popup']['height'], 'integer');
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('show_noprice_parts');
}
$html->print_footer();
示例5: catch
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->set_loop('authors', $authors);
if (!$fatal_error) {
$html->set_variable('banner', $config['startup']['custom_banner'], 'string');
try {
$system_version = $system->get_installed_version();
$html->set_variable('system_version', $system_version->as_string(false, true, true, false), 'string');
$html->set_variable('system_version_full', $system_version->as_string(false, false, false, true), 'string');
$html->set_variable('git_branch', get_git_branch_name(), 'string');
$html->set_variable('git_commit', get_git_commit_hash(10), 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'startup.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
if (!$fatal_error) {
$html->print_template('startup');
}
$html->print_footer();
示例6: catch
$name = $new_name;
$filename = $new_filename;
} else {
$parent_id = 0;
$name = '';
$filename = '';
}
$html->set_variable('name', $name, 'string');
$html->set_variable('filename', str_replace(BASE . '/', '', $filename), 'string');
$footprint_list = $root_footprint->build_html_tree($selected_id, true, false);
$html->set_variable('footprint_list', $footprint_list, 'string');
$parent_footprint_list = $root_footprint->build_html_tree($parent_id, true, true);
$html->set_variable('parent_footprint_list', $parent_footprint_list, 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'edit_footprints.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
if (!$fatal_error) {
$html->print_template('edit_footprints');
}
$html->print_footer();
示例7: count
$noprice_parts = Part::get_noprice_parts($database, $current_user, $log);
$count_of_parts_with_price = Part::get_count($database) - count($noprice_parts);
// :-)
$html->set_variable('parts_count_with_prices', $count_of_parts_with_price, 'integer');
$html->set_variable('parts_count_sum_value', Part::get_sum_price_instock($database, $current_user, $log, true), 'string');
$html->set_variable('parts_count', Part::get_count($database), 'integer');
$html->set_variable('parts_count_sum_instock', Part::get_sum_count_instock($database), 'integer');
$html->set_variable('categories_count', Category::get_count($database), 'integer');
$html->set_variable('footprint_count', Footprint::get_count($database), 'integer');
$html->set_variable('location_count', Storelocation::get_count($database), 'integer');
$html->set_variable('suppliers_count', Supplier::get_count($database), 'integer');
$html->set_variable('manufacturers_count', Manufacturer::get_count($database), 'integer');
$html->set_variable('devices_count', Device::get_count($database), 'integer');
$html->set_variable('attachements_count', Attachement::get_count($database), 'integer');
$html->set_variable('footprint_picture_count', count(find_all_files(BASE . '/img/footprints/', true)), 'integer');
$html->set_variable('iclogos_picture_count', count(find_all_files(BASE . '/img/iclogos/', true)), 'integer');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('statistics');
}
$html->print_footer();
示例8: catch
$name = '';
$disable_footprints = false;
$disable_manufacturers = false;
$disable_autodatasheets = false;
}
$html->set_variable('name', $name, 'string');
$html->set_variable('disable_footprints', $disable_footprints, 'boolean');
$html->set_variable('disable_manufacturers', $disable_manufacturers, 'boolean');
$html->set_variable('disable_autodatasheets', $disable_autodatasheets, 'boolean');
$category_list = $root_category->build_html_tree($selected_id, true, false);
$html->set_variable('category_list', $category_list, 'string');
$parent_category_list = $root_category->build_html_tree($parent_id, true, true);
$html->set_variable('parent_category_list', $parent_category_list, 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'edit_categories.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
if (!$fatal_error) {
$html->print_template('edit_categories');
}
$html->print_footer();
示例9: elseif
// step "set_db_settings"
$tmpl_site_to_show = 'set_db_settings';
$html->set_loop('db_type_loop', array_to_template_loop($config['db_types'], $config['db']['type']));
$html->set_loop('db_charset_loop', array_to_template_loop($config['db_charsets'], $config['db']['charset']));
$html->set_variable('db_host', $config['db']['host'], 'string');
$html->set_variable('db_name', $config['db']['name'], 'string');
$html->set_variable('db_user', $config['db']['user'], 'string');
} elseif (!$config['installation_complete']['db_backup_path']) {
// step "set_db_backup_path"
$tmpl_site_to_show = 'set_db_backup_path';
$html->set_variable('db_backup_name', $config['db']['backup']['name'], 'string');
$html->set_variable('db_backup_path', $config['db']['backup']['url'], 'string');
} else {
// installation/update complete
$tmpl_site_to_show = 'finish';
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'install.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
$html->print_template('header');
if (!$fatal_error) {
$html->print_template($tmpl_site_to_show);
}
$html->print_footer();
示例10: elseif
$html->set_variable('fax_number', $selected_manufacturer->get_fax_number(), 'string');
$html->set_variable('email_address', $selected_manufacturer->get_email_address(), 'string');
$html->set_variable('website', $selected_manufacturer->get_website(), 'string');
$html->set_variable('auto_product_url', $selected_manufacturer->get_auto_product_url(NULL), 'string');
} elseif ($action == 'add') {
$parent_id = $new_parent_id;
} else {
$parent_id = 0;
}
$manufacturer_list = $root_manufacturer->build_html_tree($selected_id, true, false);
$html->set_variable('manufacturer_list', $manufacturer_list, 'string');
$parent_manufacturer_list = $root_manufacturer->build_html_tree($parent_id, true, true);
$html->set_variable('parent_manufacturer_list', $parent_manufacturer_list, 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'edit_manufacturers.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
if (!$fatal_error) {
$html->print_template('edit_manufacturers');
}
$html->print_footer();
示例11: basename
* Set all HTML variables
*
*********************************************************************************/
$html->set_variable('current_system_version', $config['system']['version'], 'string');
if (file_exists($release_package_filename)) {
$html->set_variable('release_archive_link', str_replace(BASE, BASE_RELATIVE, $release_package_filename), 'string');
$html->set_variable('release_archive_basename', basename($release_package_filename), 'string');
}
$html->set_variable('packing_checklist_link', BASE_RELATIVE . '/development/package_output/readme.txt', 'string');
if (isset($doxygen_output_loop)) {
//$html->set_variable('exec_successful', $doxygen_successful, 'boolean');
$html->set_loop('exec_output', $doxygen_output_loop);
}
if (isset($tab2spaces_output_loop)) {
//$html->set_variable('exec_successful', $tab2spaces_successful, 'boolean');
$html->set_loop('exec_output', $tab2spaces_output_loop);
}
if (isset($release_packing_output_loop)) {
//$html->set_variable('exec_successful', $release_packing_successful, 'boolean');
$html->set_loop('exec_output', $release_packing_output_loop);
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('developer_tools');
}
$html->print_footer();
示例12: array
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
include_once 'start_session.php';
$messages = array();
$fatal_error = false;
// if a fatal error occurs, only the $messages will be printed, but not the site content
/********************************************************************************
*
* Initialize Objects
*
*********************************************************************************/
$html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Labels');
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('labels');
}
$html->print_footer();
?>
示例13: elseif
$name = $selected_attachement_type->get_name();
} elseif ($action == 'add') {
$parent_id = $new_parent_id;
$name = $new_name;
} else {
$parent_id = 0;
$name = '';
}
$html->set_variable('name', $name, 'string');
$attachement_types_list = $root_attachement_type->build_html_tree($selected_id, true, false);
$html->set_variable('attachement_types_list', $attachement_types_list, 'string');
$parent_attachement_types_list = $root_attachement_type->build_html_tree($parent_id, true, true);
$html->set_variable('parent_attachement_types_list', $parent_attachement_types_list, 'string');
} catch (Exception $e) {
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
$fatal_error = true;
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'edit_attachement_types.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
if (!$fatal_error) {
$html->print_template('edit_attachement_types');
}
$html->print_footer();
示例14: array
$html->set_variable('disable_calculator', $config['menu']['disable_calculator'], 'boolean');
$html->set_variable('disable_iclogos', $config['menu']['disable_iclogos'], 'boolean');
$html->set_variable('disable_tools_footprints', $config['menu']['disable_footprints'], 'boolean');
$html->set_variable('developer_mode', $config['developer_mode'], 'boolean');
$html->set_variable('db_backup_name', $config['db']['backup']['name'], 'string');
$html->set_variable('db_backup_url', $config['db']['backup']['url'], 'string');
if ($config['debug']['enable']) {
if ($config['debug']['request_debugging_enable']) {
$messages[] = array('html' => '<input type="submit" name="disable_request_debugging" value="REQUEST-Debugging deaktivieren">');
} else {
$messages[] = array('html' => '<input type="submit" name="enable_request_debugging" value="REQUEST-Debugging aktivieren">');
}
if ($config['debug']['template_debugging_enable']) {
$messages[] = array('html' => '<input type="submit" name="disable_template_debugging" value="Template-Debugging deaktivieren">');
} else {
$messages[] = array('html' => '<input type="submit" name="enable_template_debugging" value="Template-Debugging aktivieren">');
}
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$reload_link = $fatal_error ? 'navigation.php' : '';
// an empty string means that the...
$html->print_header($messages, $reload_link);
// ...reload-button won't be visible
//if (! $fatal_error)
// --> we do not hide the navigation, because this way you can reach the debug-link in the menu
$html->print_template('navigation');
$html->print_footer();
示例15: htmlspecialchars
}
/********************************************************************************
*
* Set the rest of the HTML variables
*
*********************************************************************************/
$html->use_javascript(array('popup', 'validatenumber'));
if (!$fatal_error) {
// export formats
$html->set_loop('export_formats', build_export_formats_loop('orderparts', $export_format_id));
if (isset($export_string)) {
$html->set_variable('export_result', str_replace("\n", '<br>', str_replace("\n ", '<br> ', str_replace("\n ", '<br> ', htmlspecialchars($export_string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8')))), 'string');
}
// global stuff
$html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean');
$html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean');
$html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean');
$html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean');
$html->set_variable('popup_width', $config['popup']['width'], 'integer');
$html->set_variable('popup_height', $config['popup']['height'], 'integer');
}
/********************************************************************************
*
* Generate HTML Output
*
*********************************************************************************/
$html->print_header($messages);
if (!$fatal_error) {
$html->print_template('show_order_parts');
}
$html->print_footer();