02. 그래프(pchart) 에디터 컴포넌트 pchart.class.php 구현하기

조회 수 1024 추천 수 0 2010.09.08 08:22:04
sol *.13.13.164
제목 작성자 날짜
02. 그래프(pchart) 에디터 컴포넌트 pchart.class.php 구현하기 (current) sol 2010.09.08 08:22:04
복원
<div class="eArea xe_content xe_dr_hx"><h3 id="h1250735208005">pchart class 및 생성자 작성</h3></div><div class="eArea xe_content xe_dr_txt"><p>에디터 컴포넌트의 기본 class인 pchart.class.php파일에 EditorHandler를 상속받는 pchart class를 작성합니다.</p></div><div class="eArea xe_content xe_dr_txt"><p>class <span style="color: rgb(255, 0, 0); font-weight: bold;">pchart</span> extends <span style="background-color: rgb(225, 225, 225);"><span style="background-color: rgb(225, 225, 225);">EditorHandler</span></span> {<br>}<br></p></div><div class="eArea xe_content xe_dr_txt"><p>editorModel::getComponentObject()에서 아래와 같이 에디터 컴포넌트 객체를 생성하시는 부분을 참고하여 생성자 인수를 $editor_sequence와 $component_path를 받는 생성자 pchart를 작성하고 그 인수를 class member variable에 등록합니다.</p><p>XE_ROOT/modules/editor/editor.model.php:388 <br></p><p>388&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $editor_sequence, $class_path);<br>389&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @eval($eval_str);<br><br></p></div><div class="eArea xe_content xe_dr_txt"><p>class pchart extends EditorHandler {<br><span style="background-color: rgb(225, 225, 225);"><span style="background-color: rgb(225, 225, 225);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function <span style="font-weight: bold;">pchart</span>($editor_sequence, $component_path) {</span></span><br><span style="background-color: rgb(225, 225, 225);"><span style="background-color: rgb(225, 225, 225);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;editor_sequence = $editor_sequence;</span></span><br><span style="background-color: rgb(225, 225, 225);"><span style="background-color: rgb(225, 225, 225);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $this-&gt;component_path = $component_path;</span></span><br><span style="background-color: rgb(225, 225, 225);"><span style="background-color: rgb(225, 225, 225);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span><br>}</p></div>
sol 2009.08.20 11:26:56