\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /usr/local/lsws/admin/html.6.0.11/classes/

Viewing File: DPage.php

<?php

class DPage
{
	public $_type;//serv, vh, sl, admin
	public $_id;
	public $_name;
	public $_title;
	public $_helpLink;
	public $_tblIds;
	public $_includeScript;

	public function __construct($type, $id, $name, $title, $tblIds)
	{
		$this->_type = $type;
		$this->_id = $id;
		$this->_name = $name;
		$this->_title = $title;
		$this->_tblIds = $tblIds;
		$this->_helpLink = 'index.html';
	}

	public function PrintHtml(&$confData, $disp)
	{
		$viewTags = 'vbsDdBCiI';
		$editTags = 'eEaScn';
		$isEdit = ( strpos($editTags, $disp->_act) !== false );

		if ( $disp->_act == 'd' || $disp->_act == 'i' )
			$this->printActionConfirm($disp);

		if ( $disp->_err != null ) {
			echo GUIBase::message("",$disp->_err,"error");
		}

		$tblDef = DTblDef::GetInstance();
		if ( $disp->_tid == null ) {
			$tids = $this->_tblIds;
		}
		else {
			$tid = DUtil::getLastId($disp->_tid);
			$tids = array($tid);
		}
		$ref = DUtil::getLastId($disp->_ref);

		foreach ($tids as $ti )
		{
			$tbl = $tblDef->GetTblDef($ti);
			$isExtract = false;

			if ( $disp->_act == 'a' ) {
				$d = array();
			}
			else if ( $disp->_act == 'S'
					  || $disp->_act == 'c'
					  || $disp->_act == 'n') //save failed or in change
			{
				$isExtract = true;
				$d = &$confData;
			}
			else
			{
				$d = DUtil::locateData($confData, $tbl->_dataLoc, $disp->_ref);
			}
			if ( $tbl->_holderIndex != null )
			{
				if ( $disp->_act == 'e' || $disp->_act == 'E' || $disp->_act == 'a')
				{
					$disp->_info['holderIndex'] = is_array($d)? array_keys($d):null;
					$disp->_info['holderIndex_cur'] = $ref;
				}
				if ( !$isExtract && $ref != null && substr($ti, -3) != 'TOP')
					$d = &$d[$ref];
			}
			else {
				$disp->_info['holderIndex'] = null;
            }
			echo "<div>";
			$tbl->PrintHtml($d, $ref, $disp, $isEdit);
			echo "</div>";

			if ($isEdit == false && $tbl->_linkedTbls != null && isset($tbl->_linkedTbls['disp'])) {
				foreach($tbl->_linkedTbls['disp'] as $lti) {
					$linkedtbl = $tblDef->GetTblDef($lti);
					$dlinked = DUtil::locateData($d, $linkedtbl->_dataLoc);
					echo "<div>";
					$linkedtbl->PrintHtml($dlinked, $ref, $disp, false);
					echo "</div>";
				}
			}
		}


	}

	private function printActionConfirm($disp)
	{
		$hasB = (strpos($disp->_tid, '`') !== false );
		echo '<div class=message>';
		if ( $disp->_act == 'd' )
		{
			$actString = $hasB ? 'DC' : 'Dc';
			//should validate whether there is reference to this entry
			echo 'Are you sure you want to delete this entry?<br>'.
				'<span class="edit-link">'.
				$this->getActionLink($disp, $actString) . '</span>'.
				'<br>This will be permanently removed from the configuration file.';
		}
		else if ( $disp->_act == 'i' )
		{
			$actString = $hasB ? 'IC' : 'Ic';
			echo 'Are you sure you want to instantiate this virtual host?<br>'.
				'<span class="edit-link">'.
				$this->getActionLink($disp, $actString) . '</span>'.
				'<br>This will create a dedicated configuration file for this virtual host.';
		}

		echo "</div>";

	}

	private function getActionLink($disp, $actions)
	{
		$buf = '';
		$allActions = ['D'=>'Yes', 'c'=>'Cancel', 'C'=>'Cancel','I'=>'Yes'];
		$chars = preg_split('//', $actions, -1, PREG_SPLIT_NO_EMPTY);
		foreach ( $chars as $act )
		{
			$query_param = [
				'm' => $disp->_mid,
				'p' => $disp->_pid,
			];
			$t = '';
			$r = '';
			$buf .= '&nbsp;&nbsp;&nbsp;';
			$name = $allActions[$act];
			if ( $act == 'b' || $act == 'c' ) {
				$act = 'b';
			}
			elseif ( strpos('vEdDCBiI', $act) !== false ) {
				if ( $act == 'C' ) {
					$act = 'B';
				}

                $t = $disp->_tid;
                $r = $disp->_ref;
			}
			if ($t) {
				$query_param['t'] = $t;
			}
			if ($r) {
				$query_param['r'] = $r;
			}

			$query_param['a'] = $act;
			$query_param['tk'] = $disp->_token;

			$buf .= '<a href="' . $disp->_ctrlUrl . http_build_query($query_param) . '">' . $name . '</a>';
		}
		return $buf;
	}

}