This method is slower than determining the type by file suffix but on the other hand reduces the risk of fail positives during the test. The magic file consists of ASCII characters defining the magic numbers for different file types. Each row has 4 to 5 columns, empty and commented lines (those starting with a hash character) are ignored. Columns are described below. o 1 -- byte number to begin checking from. ">" indicates a dependency upon the previous non-">" line o 2 -- type of data to match. Can be one of following - byte (single character) - short (machine-order 16-bit integer) - long (machine-order 32-bit integer) - string (arbitrary-length string) - date (long integer date (seconds since Unix epoch/1970)) - beshort (big-endian 16-bit integer) - belong (big-endian 32-bit integer) - bedate (big-endian 32-bit integer date) - leshort (little-endian 16-bit integer) - lelong (little-endian 32-bit integer) - ledate (little-endian 32-bit integer date) o 3 -- contents of data to match o 4 -- file description/MIME type if matched o 5 -- optional MIME encoding if matched and if above was a MIME type
Author: Sven Vollbehr (svollbehr@gmail.com)
Exemplo n.º 1
0
 /**
  * Registers spell event with global magic manager
  * @param string $event
  * @param mixed $variables
  * @param callable $callable
  * @param boolean $cacheResponse
  */
 protected function magery($event, $variables, callable $callable, $cacheResponse = false)
 {
     if (!is_string($event)) {
         throw new \InvalidArgumentException();
     }
     Magic::register($this, $event, $variables, $callable, $cacheResponse);
 }
Exemplo n.º 2
0
 public function save(Doctrine_Connection $conn = null)
 {
     $slug = Magic::slugify($this->getTitle());
     if ($this->isNew()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Event')->findOneBySlug($slug);
             if (!$q) {
                 break;
             } else {
                 $slug = Magic::slugify($this->getTitle());
                 $slug .= $i;
             }
         } while ($i);
         $this->setSlug($slug);
     } elseif ($slug != $this->getSlug()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Event')->findOneBySlug($slug);
             if (!$q) {
                 $this->setSlug($slug);
                 break;
             } else {
                 if ($slug == $this->getSlug()) {
                     break;
                 } else {
                     $slug = Magic::slugify($this->getTitle());
                     $slug .= $i;
                 }
             }
         } while ($i);
     }
     if ($this->get('sticky') == 'no') {
         $this->set('sticky', 1000);
     }
     parent::save($conn);
     $config = sfConfig::get('app_sfDoctrineJCroppablePlugin_models');
     $dir = sfConfig::get('sf_upload_dir') . DIRECTORY_SEPARATOR . $config['Events']['directory'];
     $image = $this->getImageSrc('mugshot', 'original');
     if ($this->getMugshot() != '') {
         $arr_filename = explode('.', $this->getMugshot());
         $filename = $arr_filename[0] . '_original.' . $arr_filename[1];
         $file = $dir . DIRECTORY_SEPARATOR . $filename;
         if (is_file($file)) {
             $dims = array(array('w' => 950, 'h' => 534), array('w' => 720, 'h' => 405), array('w' => 250, 'h' => 141));
             $size = getimagesize($file);
             $img = new sfImage($file, $size['mime']);
             foreach ($dims as $dim) {
                 $img->resize($dim['w'], $dim['h']);
                 $img->setQuality(90);
                 $img->saveAs($dir . '/' . $arr_filename[0] . '_' . $dim['w'] . 'x' . $dim['h'] . '.jpg');
             }
         }
     }
 }
Exemplo n.º 3
0
 function get()
 {
     $auth_success = false;
     $o .= '<h3>Magic-Auth Diagnostic</h3>';
     if (!local_channel()) {
         notice(t('Permission denied.') . EOL);
         return $o;
     }
     $o .= '<form action="authtest" method="get">';
     $o .= 'Target URL: <input type="text" style="width: 250px;" name="dest" value="' . $_GET['dest'] . '" />';
     $o .= '<input type="submit" name="submit" value="Submit" /></form>';
     $o .= '<br /><br />';
     if (x($_GET, 'dest')) {
         if (strpos($_GET['dest'], '@')) {
             $_GET['dest'] = $_REQUEST['dest'] = 'https://' . substr($_GET['dest'], strpos($_GET['dest'], '@') + 1) . '/channel/' . substr($_GET['dest'], 0, strpos($_GET['dest'], '@'));
         }
         $_REQUEST['test'] = 1;
         $mod = new Magic();
         $x = $mod->init($a);
         $o .= 'Local Setup returns: ' . print_r($x, true);
         if ($x['url']) {
             $z = z_fetch_url($x['url'] . '&test=1');
             if ($z['success']) {
                 $j = json_decode($z['body'], true);
                 if (!$j) {
                     $o .= 'json_decode failure from remote site. ' . print_r($z['body'], true);
                 }
                 $o .= 'Remote site responded: ' . print_r($j, true);
                 if ($j['success'] && strpos($j['message'], 'Authentication Success')) {
                     $auth_success = true;
                 }
             } else {
                 $o .= 'fetch url failure.' . print_r($z, true);
             }
         }
         if (!$auth_success) {
             $o .= 'Authentication Failed!' . EOL;
         }
     }
     return str_replace("\n", '<br />', $o);
 }
Exemplo n.º 4
0
 public function save(Doctrine_Connection $conn = null)
 {
     $slug = Magic::slugify($this->getTitle());
     if ($this->isNew()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 break;
             } else {
                 $slug = Magic::slugify($this->getTitle());
                 $slug .= $i;
             }
         } while ($i);
         $this->setSlug($slug);
     } elseif ($slug != $this->getSlug()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 $this->setSlug($slug);
                 break;
             } else {
                 if ($slug == $this->getSlug()) {
                     break;
                 } else {
                     $slug = Magic::slugify($this->getTitle());
                     $slug .= $i;
                 }
             }
         } while ($i);
     }
     parent::save($conn);
     // generamos thumbnails
     $file = sfConfig::get('sf_upload_dir') . '/pictures/' . $this->getPicture();
     if (is_file($file)) {
         $dims = array(array('w' => 950, 'h' => 534), array('w' => 720, 'h' => 405), array('w' => 250, 'h' => 141), array('w' => 60, 'h' => 60));
         $size = getimagesize($file);
         $img = new sfImage($file, $size['mime']);
         if (!is_dir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'))) {
             mkdir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'), 0777);
         }
         foreach ($dims as $dim) {
             $img->thumbnail($dim['w'], $dim['h']);
             $img->setQuality(90);
             $img->saveAs(sfConfig::get('sf_upload_dir') . '/' . $this->get('id') . '/img_' . $this->get('id') . '_' . $dim['w'] . 'x' . $dim['h'] . '.jpg');
         }
     }
 }
Exemplo n.º 5
0
 /**
  * Runs [Magic::check] and loads the image.
  *
  * @return  void
  */
 public function __construct($file)
 {
     if (!Magic::$_checked) {
         // Run the install check
         Magic::check();
     }
     parent::__construct($file);
     $this->im = new Imagick();
     $this->im->readImage($file);
     if (!$this->im->getImageAlphaChannel()) {
         // Force the image to have an alpha channel
         $this->im->setImageAlphaChannel(Imagick::ALPHACHANNEL_SET);
     }
 }
Exemplo n.º 6
0
 public function save(Doctrine_Connection $conn = null)
 {
     $slug = Magic::slugify($this->getTitle());
     if ($this->isNew()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Category')->findOneBySlug($slug);
             if (!$q) {
                 break;
             } else {
                 $slug = Magic::slugify($this->getTitle());
                 $slug .= $i;
             }
         } while ($i);
         $this->setSlug($slug);
     } elseif ($slug != $this->getSlug()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Category')->findOneBySlug($slug);
             if (!$q) {
                 $this->setSlug($slug);
                 break;
             } else {
                 if ($slug == $this->getSlug()) {
                     break;
                 } else {
                     $slug = Magic::slugify($this->getTitle());
                     $slug .= $i;
                 }
             }
         } while ($i);
     }
     parent::save($conn);
 }
Exemplo n.º 7
0
 /**
  *  copy一份布局并返回布局的信息
  */
 public function get_layout_preview()
 {
     if (!$this->input['layout_id']) {
         $this->errorOutput('LAYOUT OR TEMPLATE ID IS EMPTY');
     }
     $layout_id = intval($this->input['layout_id']);
     $template_id = intval($this->input['template_id']);
     //copy一份此布局里的单元
     $sql = "SELECT * FROM " . DB_PREFIX . "layout_cell WHERE layout_id = " . $layout_id;
     $q = $this->db->query($sql);
     $new_cell_ids = array();
     while ($row = $this->db->fetch_array($q)) {
         $new_cell_name = date('YmdHis') . hg_generate_user_salt(6);
         $find[] = $row['cell_name'];
         $replace[] = $new_cell_name;
         $row['cell_name'] = $new_cell_name;
         $row['cell_code'] = str_replace($row['cell_name'], $new_cell_name, $row['cell_code']);
         $row['original_id'] = $row['id'];
         $row['param_asso'] = addslashes($row['param_asso']);
         unset($row['id'], $row['layout_id']);
         //unset掉layout_id防止更新操作不成功对原始布局产生有影响
         $new_cell_ids[] = $row['id'] = $this->db->insert_data($row, 'layout_cell');
         $row['param_asso'] = unserialize(stripslashes($row['param_asso']));
         $layout_cell[] = $row;
     }
     //布局详细信息
     $condition = ' AND id = ' . $layout_id;
     $layout_info = $this->layout->detail($condition);
     $layout_info['content'] = html_entity_decode($layout_info['content']);
     $layout_info['css'] = html_entity_decode($layout_info['css']);
     //重新生成一份布局
     $layout_info['content'] = str_replace($find, $replace, $layout_info['content']);
     $layout_info['original_id'] = $layout_info['id'];
     unset($layout_info['id']);
     $layout_info['id'] = $this->db->insert_data($layout_info, 'layout');
     if ($new_cell_ids) {
         $this->db->update_data('layout_id=' . $layout_info['id'], 'layout_cell', ' id IN(' . implode(',', $new_cell_ids) . ')');
     }
     $layout_info['content'] = str_replace($find, $replace, $layout_info['content']);
     //布局命名空间和头部处理
     $layout_info = $this->layout->layout_namespace_and_header_process($layout_info);
     $ret = array();
     //处理布局中单元的信息、生成html
     $return_cell = isset($this->input['return_cell']) ? $this->input['return_cell'] : true;
     if ($return_cell) {
         if (!class_exists('Magic')) {
             include CUR_CONF_PATH . 'lib/magic.class.php';
         }
         $objMagic = new Magic();
         foreach ($layout_cell as $k => $v) {
             $layout_cell[$k] = $objMagic->cellProcess($v);
         }
         $ret['cells'] = $layout_cell;
         $ret = array_merge($ret, $layout_info);
     }
     $this->addItem($ret);
     $this->output();
 }
Exemplo n.º 8
0
 * version 1.0
 * 사용자의 구미에 맞도록 초기설치 제어를 수행함
 */
$cfg = array();
// 데이터베이스 정보
$cfg['dbinfo'] = array('host' => 'localhost', 'user' => '', 'password' => '', 'db' => '', 'prefix' => 'm3_');
// 관리자 정보
$cfg['admin_info'] = array('id' => 'admin', 'password' => '', 'password_confirm' => '', 'name' => '최고관리자');
// 홈페이지 기본정보
$cfg['hp_info'] = array('title' => '매직보드');
// data 폴더 목록
// '폴더명'=>'권한값'
$cfg['data_folder'] = array(Path::data() => 0707, Path::data_file() => 0707, Path::data('cache') => 0707, Path::data('zmLog') => 0707, Path::data('zmLogConnect') => 0755, Path::data('cheditor') => 0707, Path::data_member() => 0707);
// 설치 테이블 정보
// '테이블명'=>'설치모듈 인스턴스'
$cfg['tables'] = array('magic' => Magic::Inst(), 'config' => Config::Inst(), 'write' => Write::Inst(), 'board' => Board::Inst(), 'file' => File::Inst(), 'comment' => Comment::Inst(), 'member' => Member::Inst(), 'tag' => Tag::Inst(), 'widget' => Widget::Inst());
/*
* 메뉴구성 및 기본 컨텐츠 설정
$cfg['default_data'] = "
kr:index				=widget:page=write:index.html
+메뉴얼:basic			=widget:page=write=widget:webclip:sub_title+=widget:page
++영문홈페이지:basic	=widget:page=write=widget:webclip:sub_title+=widget:page
++모바일홈페이지:basic	=widget:page=write=widget:webclip:sub_title+=widget:page
+게시판:basic			=widget:page=write=widget:webclip:sub_title+=widget:page
++공지사항:basic		=widget:page=write=widget:webclip:sub_title+=widget:write=board:공지

eng:index				=widget:page=write:index.html
+English Sample:basic	=widget:page=write

member:member
<?php

require '_MagicMethods.php';
$a = new Magic();
$a->overload('pawan', 'saxena');
$a->overload(new Magic());
Exemplo n.º 10
0
$menu_all = Magic::Inst()->Sql('list');
$i = 0;
foreach ($menu_main as $k => $v) {
    if ($v['m_hidden'] == 0) {
        $v['children'] = array();
        foreach ($menu_all as $vv) {
            if ($v['m_no'] == $vv['m_parent']) {
                $v['children'][] = array('m_id' => $vv['m_id'], 'link' => Path::Root('?id1=' . $v['m_id'] . '&id2=' . $vv['m_id']));
            }
        }
        $menu_main[$k] = $v;
    } else {
        unset($menu_main[$k]);
    }
}
$root = Magic::Inst()->Action('root');
$path = Layout::Inst('index');
?>

<ul class="list">
<?php 
foreach ($menu_main as $v) {
    ?>
  <li class="<?php 
    echo $v['first'] ? 'first' : '';
    ?>
 <?php 
    echo $v['active'] ? ' active' : '';
    ?>
">
    <a href="<?php 
Exemplo n.º 11
0
$link = array();
// 위젯 추가
$params = $this->Config('add_widget');
$link['write']['include'][$mode_name] = 'write';
$link['write']['include'][$params['pos']] = $att[1];
$link['write']['include'][$params['table']] = $att[2];
$link['write']['include'][$params['key_name']] = $att[3];
$link['write']['include'][$params['key']] = $att[4];
$link['write']['include'][$params['field']] = $att[5];
$link['write']['include'][Magic::Inst()->Config('root')] = 'popup';
$link['write']['exclude'][] = 'id1';
$link['write']['exclude'][] = 'id2';
// 위젯 수정
$link['edit']['include'][$mode_name] = 'write';
$link['edit']['include'][$key_name] = $att[1];
$link['edit']['include'][Magic::Inst()->Config('root')] = 'popup';
$link['edit']['exclude'][] = 'id1';
$link['edit']['exclude'][] = 'id2';
// 위젯 삭제
$link['delete']['include'][$mode_name] = 'delete';
$link['delete']['include'][$key_name] = $att[1];
$link['delete']['include']['ret_url'] = $att[2];
$link['delete']['include'][Magic::Inst()->Config('root')] = 'popup';
$link['delete']['exclude'][] = 'id1';
$link['delete']['exclude'][] = 'id2';
// 위젯 스킨 선택시 이동
$link['skin']['include']['wgSkin'] = $att[1];
// 위젯 스킨 선택 해제
$link['skin_cancel']['exclude'] = 'wgSkin';
$link['list']['exclude'][] = $mode_name;
$link['list']['exclude'][] = $key_name;
Exemplo n.º 12
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
// 메인메뉴
$this->menu_main = Magic::Inst()->Action('menu_main');
/*
 * 메인메뉴에 대한 기본설정
 */
$i = 0;
$total = sizeof($this->menu_main);
foreach ($this->menu_main as $k => $v) {
    if (++$i == $total) {
        $this->menu_main[$k]['last'] = true;
    }
    $this->menu_main[$k]['icon'] = $this->path_img($v['m_image']);
}
Exemplo n.º 13
0
        if ($vvv['m_no'] == $vv['m_parent']) {
            $menu_chain[] = $vvv;
            break;
        }
    }
}
$view['root'] = array_pop($menu_chain);
$view['main'] = array_pop($menu_chain);
// 하위 첫번째 메뉴 구하기
$child_first = '';
foreach ($list_all as $v) {
    if ($key == $v['m_parent']) {
        $link = './?' . Magic::Inst()->Config('root') . '=' . $view['root']['m_id'];
        // main이 있을때 즉 현재 아이디가 서브메뉴일때
        if ($view['main']) {
            $link .= '&' . Magic::Inst()->Config('main') . '=' . $view['main']['m_id'];
            $link .= '&' . Magic::Inst()->Config('sub') . '=' . $v['m_id'];
            // main이 없을때 즉 현재 아이디가 메인 메뉴일때
        } else {
            $link .= '&' . Magic::Inst()->Config('main') . '=' . $v['m_id'];
        }
        $v['link'] = $link;
        $child_first = $v;
        break;
    }
}
$view['child_first'] = $child_first;
$this->root_list = $root_list;
$this->list = $list;
$this->action = $this->Link('update');
$this->view = $view;
Exemplo n.º 14
0
<?php

class Base
{
}
class NoMagic extends Base
{
    public function checkCallables()
    {
        $meths = array('parent::foobar', array(get_class($this), 'foobar'));
        foreach ($meths as $meth) {
            var_dump(is_callable($meth));
        }
    }
}
class Magic extends NoMagic
{
    function __call($meth, $args)
    {
    }
}
$nomagic = new NoMagic();
$nomagic->checkCallables();
$magic = new Magic();
$magic->checkCallables();
Exemplo n.º 15
0
 public function get_cell_list($site_id, $page_id, $page_data_id, $content_type, $template_sign = '', $site_info = '', $column_info = '')
 {
     if (!class_exists('Maigc')) {
         include CUR_CONF_PATH . 'lib/magic.class.php';
     }
     $objMagic = new Magic($site_id, $page_id, $page_data_id, $content_type);
     $response = $objMagic->searchCell(false, $material_url);
     ###取站点、栏目信息
     include_once ROOT_PATH . 'lib/class/publishconfig.class.php';
     $this->pub = new publishconfig();
     if (!$site_info) {
         $site_info = $this->pub->get_site_first('*', $site_id);
     }
     if ($page_data_id && !$column_info) {
         $page_data = self::get_page_data($page_id, '', '', '', '', $page_data_id);
         $column_info = $page_data['page_data'][0];
     }
     $deploy = self::merge_cell($site_id, $page_id, $page_data_id, $content_type, $site_info, $template_sign);
     $cell = $deploy['default_cell'];
     ###单元中样式、数据源参数处理、样式代码、css、js代码解析
     if (is_array($cell) && count($cell) > 0) {
         $data_source_ids = array();
         foreach ($cell as $key => $value) {
             $mode_info = self::get_mode_info($value['cell_mode'], $value['id'], $value['css_id'], $value['js_id'], $value['param_asso']);
             if ($value['data_source']) {
                 $data_source_ids[$value['id']] = $value['data_source'];
                 $data_source = self::get_datasource_info($value['data_source'], $value['param_asso']);
                 $map = self::get_cell_map($mode_info, $data_source, $value['param_asso']);
             } else {
                 $map = self::get_mode_map($mode_info);
             }
             $cache_file = $value['id'] . '.php';
             include_once CUR_CONF_PATH . 'lib/parse.class.php';
             $parse = new Parse();
             $content = $mode_info['mode_info']['content'];
             $parse->parse_template($content, $value['id'], $mode_info['mode_info'], $map['relation_map'], $map['mode_variable_map'], $map['variable_function_relation']);
             $parse->built_mode_cache($cache_file);
             //专题链接处理
             if (strpos($cell[$key]['more_href'], 'COLURL') !== false) {
             }
             $cell[$key] = array_merge($cell[$key], $mode_info);
             $cell[$key]['mode_detail'] = $cell[$key]['mode_info'];
             unset($cell[$key]['mode_info']);
             $cell[$key]['data_source_info'] = $data_source['info'];
             $cell[$key]['input_param'] = $data_source['input_param'];
             $cell[$key]['input_param_other'] = $map['data_input_variable'];
             $cell[$key]['site_id'] = $site_id;
             $cell[$key]['page_id'] = $page_id;
             $cell[$key]['page_data_id'] = $page_data_id;
             $cell[$key]['content_type'] = $content_type;
         }
     }
     return array('default_style' => $deploy['default_style'], 'curr_style' => $deploy['curr_style'], 'template_sign' => $deploy['template_sign'], 'default_cell' => $cell, 'data_source_ids' => $data_source_ids);
 }
Exemplo n.º 16
0
 public function cellDataUpdate()
 {
     $intCellId = intval($this->input['intCellId']);
     $intContentId = $this->input['intContentId'];
     if (!$intCellId || !$intContentId) {
         $this->errorOutput('NO ID');
     }
     if (!empty($this->input['arIndexPic'])) {
         $this->input['arIndexPic'] = array('host' => $this->input['arIndexPic']['host'], 'dir' => $this->input['arIndexPic']['dir'], 'filepath' => $this->input['arIndexPic']['filepath'], 'filename' => $this->input['arIndexPic']['filename']);
     }
     $arData = array('title' => $this->input['strTitle'], 'brief' => $this->input['strBrief'], 'content_url' => $this->input['strContentUrl'], 'indexpic' => $this->input['arIndexPic'] ? serialize($this->input['arIndexPic']) : '');
     if (!class_exists('cell')) {
         include CUR_CONF_PATH . 'lib/cell.class.php';
     }
     $objCell = new cell();
     $arContent = $objCell->detail(' AND cell_id = ' . $intCellId . ' AND content_id = ' . $intContentId, 'cell_data');
     if (empty($arContent)) {
         $arData['cell_id'] = $intCellId;
         $arData['content_id'] = $intContentId;
         $this->db->insert_data($arData, 'cell_data');
     } else {
         $this->db->update_data($arData, 'cell_data', 'cell_id = ' . $intCellId . ' AND content_id = ' . $intContentId);
     }
     $arCellInfo = $objCell->detail(' AND id = ' . $intCellId);
     //删除单元内容缓存
     $objCell->delete_cell_data_cache($intCellId);
     //重新处理该单元信息
     if (!class_exists('Magic')) {
         include CUR_CONF_PATH . 'lib/magic.class.php';
     }
     $objMagic = new Magic();
     $arCellInfo = $objMagic->cellProcess($arCellInfo, true);
     $this->addItem($arCellInfo);
     $this->output();
 }
Exemplo n.º 17
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$table = array();
$table['magic'] = Magic::Inst()->Table();
Exemplo n.º 18
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$menu_sub = Magic::Inst()->Action('menu_sub');
$main_menu = Magic::Inst()->main;
?>
<div class="title"><h3><?php 
echo $main_menu['m_id'];
?>
</h3></div>
<?php 
if (sizeof($menu_sub) != 0) {
    ?>
<ul><?php 
    foreach ($menu_sub as $v) {
        ?>
<li <?php 
        echo $v['active'] ? 'class="active"' : '';
        ?>
><a href="<?php 
        echo $v['link'];
        ?>
" <?php 
        echo $v['popup'] ? 'class="popup"' : '';
        ?>
><?php 
        echo $v['m_id'];
        ?>
</a></li>
Exemplo n.º 19
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$menu_sub = Magic::Inst()->Action('menu_sub');
$this->list = $menu_sub;
Exemplo n.º 20
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
?>
<div class="sub_title">
  <h2><?php 
echo Magic::Inst()->Action('title');
?>
</h2>
  <span class="etc"><?php 
echo $this->mini_nav;
?>
</span>
</div><!-- .sub_title -->
Exemplo n.º 21
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$hierarachy = Magic::Inst()->Action('hierarachy');
$current = array_shift($hierarachy);
$hierarachy = array_reverse($hierarachy);
?>
<div id="breadcrumb">
  <h1><?php 
echo $current['m_id'];
?>
</h1>							 
  <ul>
    <?php 
foreach ($hierarachy as $v) {
    ?>
    <li><a href="<?php 
    echo $v['link'];
    ?>
"><?php 
    echo $v['m_id'];
    ?>
</a>&nbsp;&gt;&nbsp;</li>
    <?php 
}
?>
    <li class="bold"><?php 
echo $current['m_id'];
?>
Exemplo n.º 22
0
 public function __construct($name, Magic $instance)
 {
     if (!$instance instanceof Magic) {
         throw new ClassException('php class "' . $name . '" is not Magic implemented');
     }
     parent::__construct($name);
     $this->magicClassName = $instance->getMagicClassName();
     $this->magicClassFullName = $instance->getMagicClassFullName();
 }
Exemplo n.º 23
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$v = Widget::Inst()->Action('data_explode', $this->wg_no);
echo Magic::Inst('admin')->html();
Exemplo n.º 24
0
<?php

require_once 'Magic.php';
echo 'enter string:';
$input = fgets(STDIN);
$Magic = new Magic($input);
echo $Magic->magic();
Exemplo n.º 25
0
$data['skin'] = GV::String('skin');
if (!$data['skin']) {
    $data['skin'] = $view['skin'];
}
$this->data = $data;
/*
 * 폼 업데이트 링크 생성
 */
$key_name = $this->KN();
$key = GV::Number($key_name);
$this->action = $this->Link('insert');
if ($key) {
    $this->action = $this->Link('update');
}
/*
 * 게시판 스킨 목록
 */
$skin_list = array();
$skin_list[] = array('name' => '최신글스킨선택');
foreach (Magic::Inst()->SkinList() as $v) {
    if ($data['skin'] == $v['skin']) {
        $v['selected'] = 'selected';
    }
    $skin_list[] = $v;
}
$this->skin_list = $skin_list;
/*
 * 하단 버튼 링크생성
 */
$this->btn_ok = Widget::Inst()->path_img('btn_ok.gif');
$this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
Exemplo n.º 26
0
    public function __get($name)
    {
        if (in_array($name, $this->names) && isset($name)) {
        }
        return $this->attrs[$name];
    }
    public function __set($name, $value)
    {
        if (in_array($name, $this->names)) {
            $this->attrs[$name] = $value;
        }
    }
    public function __isset($name)
    {
        return in_array($name, $this->names);
    }
    public function __unset($name)
    {
        if (isset($name)) {
            unset($this->attrs[$name]);
        }
    }
    public function __call($name, $arguments)
    {
        echo 'Appel méthode ' . $name . ' avec arguments ' . $arguments . implode(',', $arguments) . PHP_EOL;
    }
}
$m = new Magic();
$m->toto = 'Hello';
echo $m->toto;
$m->mamethode('lol', 'bla');
Exemplo n.º 27
0
 public function cellPreview()
 {
     $intCellId = intval($this->input['intCellId']);
     $arData = $this->input['arData'];
     if (!$intCellId) {
         $this->errorOutput('NO CELLID');
     }
     if (!class_exists('cell')) {
         include CUR_CONF_PATH . 'lib/cell.class.php';
     }
     $objCell = new cell();
     $arCellInfo = $objCell->detail(' AND id = ' . $intCellId);
     if (!class_exists('Magic')) {
         include CUR_CONF_PATH . 'lib/magic.class.php';
     }
     $objMagic = new Magic();
     $arCellInfo = $objMagic->cellProcess($arCellInfo, 'false', $arData);
     $this->addItem($arCellInfo);
     $this->output();
 }
Exemplo n.º 28
0
<?php

include_once '_path.php';
echo Magic::Inst()->html();
Exemplo n.º 29
0
 public static final function thumb($mode, $source, $target, $width, $height = null, $color = null)
 {
     if ($height === null) {
         $height = $width;
     }
     if ($mode === "square") {
         Magic::square($source, $target, $width);
     } elseif ($mode === "rational") {
         Magic::rational($source, $target, $width, $height);
     }
 }
Exemplo n.º 30
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$cfg = array();
/*
 * 기본값
 */
if (Config::Inst()->hp_title) {
    $cfg['title'][0] = Config::Inst()->hp_title;
}
$cfg['title'] = Magic::Inst()->Action('title_chain');
$cfg['script'] = Scripts::Get();
$cfg['style'] = Styles::Get();