Example #1
0
				$dummylayout .= "\n" . $css[$i]->getVar('tpl_source');
			}

			$dummylayout .= "\n" . '</style></head><body><div id="xo-canvas"><{$content}></div></body></html>';
			if ($tplfile->getVar('tpl_type') == 'block') {

				$block = new icms_view_block_Object($tplfile->getVar('tpl_refid'));
				$xoopsTpl->assign('block', $block->buildBlock());
			}

			$dummytpl = '_dummytpl_' . time() . '.html';
			$fp = fopen(ICMS_CACHE_PATH . '/' . $dummytpl, 'w');
			fwrite($fp, $html);
			fclose($fp);
			$xoopsTpl->assign('content', $xoopsTpl->fetch('file:' . ICMS_CACHE_PATH . '/' . $dummytpl));
			$xoopsTpl->clear_compiled_tpl('file:' . ICMS_CACHE_PATH . '/' . $dummytpl);
			unlink(ICMS_CACHE_PATH . '/' . $dummytpl);
			$dummyfile = '_dummy_' . time() . '.html';
			$fp = fopen(ICMS_CACHE_PATH . '/' . $dummyfile, 'w');
			fwrite($fp, $dummylayout);
			fclose($fp);
			$tplset= $tplfile->getVar('tpl_tplset');
			$tform = array('tpl_tplset' => $tplset, 'tpl_id' => $id, 'tpl_file' => $tplfile->getVar('tpl_file'), 'tpl_desc' => $tplfile->getVar('tpl_desc'), 'tpl_lastmodified' => $tplfile->getVar('tpl_lastmodified'), 'tpl_source' => htmlspecialchars($html, ENT_QUOTES), 'tpl_module' => $moddir);
			include_once ICMS_MODULES_PATH . '/system/admin/tplsets/tplform.php';
			icms_cp_header();
			echo '<a href="admin.php?fct=tplsets">'. _MD_TPLMAIN .'</a>' 
				. '&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'
				. '<a href="./admin.php?fct=tplsets&amp;op=listtpl&amp;moddir=' . $moddir 
				. '&amp;tplset=' . urlencode($tplset) . '">' . htmlspecialchars($tplset, ENT_QUOTES) . '</a>'
				. '&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . _MD_EDITTEMPLATE 
				. '<br /><br />';
Example #2
0
						) {
						if ($config->getVar('purifier_Filter_ExtractStyleBlocks') == 1) {
							if (!file_exists(ICMS_PLUGINS_PATH . '/csstidy/class.csstidy.php')) {
								redirect_header('admin.php?fct=preferences', 5, _MD_AM_UNABLECSSTIDY);
							}
							$purifier_style_updated = TRUE;
						}
					}

					// if default template set has been changed
					if (! $tpl_updated && $config->getVar('conf_catid') == ICMS_CONF && $config->getVar('conf_name') == 'template_set') {
						// clear cached/compiled files and regenerate them if default theme has been changed
						if ($icmsConfig['template_set'] != ${$config->getVar('conf_name')}) {
							$newtplset = ${$config->getVar('conf_name')};
							// clear all compiled and cachedfiles
							$xoopsTpl->clear_compiled_tpl();
							// generate compiled files for the new theme
							// block files only for now..
							$tplfile_handler = icms::handler('icms_view_template_file');
							$dtemplates = & $tplfile_handler->find('default', 'block');
							$dcount = count($dtemplates);

							// need to do this to pass to $icmsAdminTpl->template_touch function
							$GLOBALS['icmsConfig']['template_set'] = $newtplset;

							for ($i = 0; $i < $dcount; $i++) {
								$found = & $tplfile_handler->find($newtplset, 'block', $dtemplates[$i]->getVar('tpl_refid'), NULL);
								if (count($found) > 0) {
									// template for the new theme found, compile it
									$icmsAdminTpl->template_touch($found[0]->getVar('tpl_id'));
								} else {