public function SetScript($script) { $this->use_script = $script; if ($this->use_script) { Scripts::Add($this->js()); } else { Scripts::Del($this->js()); } }
<?php if (!defined("__MAGIC__")) { exit; } Scripts::Add($this->path_view('cheditor.js'));
<?php if (!defined("__MAGIC__")) { exit; } /* * 해당 레이아웃에서 사용할 css/js set */ Scripts::Add(Layout::Inst('index')->path_view('script.js'));
<?php if (!defined("__MAGIC__")) { exit; } Scripts::Add($this->path_view('write.js')); /* * view data 불러오기 * 우선순위 * 1.POST로 넘어온 미리보기 데이터 * 2.데이터베이스에 있는 데이터 * 3.기본 데이터 * */ // 1.데이터베이스에 있는 데이터 불러오기 $view = Widget::Inst()->Action('data_explode', $this->wg_no); $data = array(); // 위젯너비 $data['wg_width'] = GV::String('wg_width'); if (!$data['wg_width']) { $data['wg_width'] = $view['wg_width']; } if (!$data['wg_width']) { $data['wg_width'] = $this->Config('wg_width'); } // 위젯너비 단위 $data['wg_width_unit'] = GV::String('wg_width_unit'); if (!$data['wg_width_unit']) { $data['wg_width_unit'] = $view['wg_width_unit']; } if (!$data['wg_width_unit']) {
<?php if (!defined("__MAGIC__")) { exit; } Scripts::Add(Path::MB('js/plugin/external/jquery.cookie.js')); Scripts::Add(Path::MB('js/plugin/external/jquery.hotkeys.js')); Scripts::Add(Path::MB('js/plugin/jquery.jstree.js'));
<?php if (!defined("__MAGIC__")) { exit; } // 쿠키 사용을 위해서 Scripts::Add(Path::Root('magic/js/plugin/external/jquery.cookie.js'));
<?php if (!defined("__MAGIC__")) { exit; } Scripts::Add($this->path_view('widget.js')); /* * view data 불러오기 * 우선순위 * 1.POST로 넘어온 미리보기 데이터 * 2.데이터베이스에 있는 데이터 * 3.기본 데이터 * */ // 데이터베이스에 있는 데이터 불러오기 $view = Widget::Inst()->Action('data_explode', $this->wg_no); $data = array(); // 위젯너비 $data['wg_width'] = GV::String('wg_width'); if (!$data['wg_width']) { $data['wg_width'] = $view['wg_width']; } if (!$data['wg_width']) { $data['wg_width'] = $this->Config('wg_width'); } // 위젯너비 단위 $data['wg_width_unit'] = GV::String('wg_width_unit'); if (!$data['wg_width_unit']) { $data['wg_width_unit'] = $view['wg_width_unit']; } if (!$data['wg_width_unit']) {
<?php if (!defined("__MAGIC__")) { exit; } Styles::Add($this->path_view('jquery.mobile-1.1.0.min.css')); Scripts::Add($this->path_view('jquery.mobile-1.1.0.min.js'));
static function Del($src, $source = '') { if (!$src && $source == '') { return; } $html = self::createHtml($src, $source); if (FALSE !== ($key = array_search($html, self::$js))) { unset(self::$js[$key]); } } static function Get() { return self::$js; } } /* * magic/js/ 폴더의 파일은 모두 인크루드함 */ $core_js = array(); $dir = dir(Path::MB_js()); while ($name = $dir->read()) { if (is_file(Path::MB_js($name))) { $core_js[] = Path::MB_js($name); } } asort($core_js); foreach ($core_js as $v) { Scripts::Add($v); } unset($v); unset($core_js);
/* * 메뉴목록을 재정렬함 */ $list_all = $this->Sql('list'); // 최상위 리스트 구하기 $list = array(); foreach ($list_all as $v) { if ($v['m_parent'] == 0) { $v['children'] = array(); $list[$v['m_no']] = $v; } } // 메인메뉴 구하기 foreach ($list_all as $v) { if ($list[$v['m_parent']]) { $v['children'] = array(); $list[$v['m_parent']]['children'][$v['m_no']] = $v; } } // 서브메뉴 구하기 foreach ($list_all as $v) { foreach ($list as $kk => $vv) { if ($vv['children'][$v['m_parent']]) { $v['children'] = array(); $list[$kk]['children'][$v['m_parent']]['children'][$v['m_no']] = $v; } } } $this->list = $list; Scripts::Add(Path::Group('magic/js/plugin/jquery.jstree.js'));
protected function Init() { if ($this->called_init) { return; } if (is_file($this->path_view('style.css'))) { Styles::Add($this->path_view('style.css')); } if (is_file($this->path_view('script.js'))) { Scripts::Add($this->path_view('script.js')); } if (is_file($this->path_controller('auth.php'))) { include $this->path_controller('auth.php'); } if (is_file($this->path_controller('auth.' . $this->CurrentState() . '.php'))) { include $this->path_controller('auth.' . $this->CurrentState() . '.php'); } // 2012.03.19 - 초기화 함수를 뒤로 옮김 삭제나 추가 같은 액션은 초기화에서 삭제나 추가를 하기때문에.... // 예전에 init을 위로 올린 이유가 있었는데... 지금은 해결되었길 바란다. if (is_file($this->path_controller('init.php'))) { include $this->path_controller('init.php'); } if (is_file($this->path_controller('init.' . $this->CurrentState() . '.php'))) { include $this->path_controller('init.' . $this->CurrentState() . '.php'); } $this->called_init = true; }