예제 #1
0
 public function show($id = 0)
 {
     if (!($id && ($article_info = render_cell('site_cache_cell', 'article', $id)))) {
         return redirect_message(array('articles'), array('_flash_message' => '找不到該筆資料。'));
     }
     $article = $article_info['article'];
     $tags = $article_info['tags'];
     $others = $article_info['others'];
     $user = $article_info['user'];
     $sources = $article_info['sources'];
     $this->set_title($article['title'] . ' - ' . Cfg::setting('site', 'site', 'title'))->add_hidden(array('id' => 'id', 'value' => $article['id']))->add_meta(array('name' => 'keywords', 'content' => $article['title'] . ',' . implode(',', Cfg::setting('site', 'site', 'keywords'))))->add_meta(array('name' => 'description', 'content' => $article['mini_content']['150']))->add_meta(array('property' => 'og:title', 'content' => $article['title'] . ' - ' . Cfg::setting('site', 'site', 'title')))->add_meta(array('property' => 'og:description', 'content' => $article['mini_content']['300']))->add_meta(array('property' => 'og:image', 'tag' => 'larger', 'content' => $img = $article['cover_url']['1200x630c'], 'alt' => $article['title'] . ' - ' . Cfg::setting('site', 'site', 'title')))->add_meta(array('property' => 'og:image:type', 'tag' => 'larger', 'content' => 'image/' . pathinfo($img, PATHINFO_EXTENSION)))->add_meta(array('property' => 'og:image:width', 'tag' => 'larger', 'content' => '1200'))->add_meta(array('property' => 'og:image:height', 'tag' => 'larger', 'content' => '630'))->add_meta(array('property' => 'article:modified_time', 'content' => $article['updated_at']['c']))->add_meta(array('property' => 'article:published_time', 'content' => $article['created_at']['c']))->add_param('tags', $tags);
     if (($tags = column_array($tags, 'name')) || ($tags = Cfg::setting('site', 'site', 'keywords'))) {
         foreach ($tags as $i => $tag) {
             if (!$i) {
                 $this->add_meta(array('property' => 'article:section', 'content' => $tag))->add_meta(array('property' => 'article:tag', 'content' => $tag));
             } else {
                 $this->add_meta(array('property' => 'article:tag', 'content' => $tag));
             }
         }
     }
     if ($others) {
         foreach ($others as $other) {
             $this->add_meta(array('property' => 'og:see_also', 'content' => base_url('article', $other['site_show_page_last_uri'])));
         }
     }
     $this->add_css(resource_url('resource', 'css', 'fancyBox_v2.1.5', 'my.css'))->add_js(resource_url('resource', 'javascript', 'fancyBox_v2.1.5', 'my.js'))->load_view(array('article' => $article, 'sources' => $sources, 'user' => $user));
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     if (in_array($this->uri->rsegments(2, 0), array('edit', 'update', 'destroy'))) {
         if (!(($id = $this->uri->rsegments(3, 0)) && ($this->invoice = Invoice::find('one', array('conditions' => array('id = ? AND destroy_user_id IS NULL', $id)))))) {
             return redirect_message(array('admin', $this->get_class()), array('_flash_message' => '找不到該筆資料。'));
         }
     }
     $this->add_tab('帳務列表', array('href' => base_url('admin', $this->get_class()), 'index' => 1))->add_tab('新增帳務', array('href' => base_url('admin', $this->get_class(), 'add'), 'index' => 2))->add_css(resource_url('resource', 'css', 'jquery-ui_v1.10.3', 'jquery-ui-1.10.3.custom.min.css'))->add_js(resource_url('resource', 'javascript', 'jquery-ui_v1.10.3', 'jquery-ui-1.10.3.custom.min.js'))->add_js(resource_url('resource', 'javascript', 'jquery-ui_v1.10.3', 'datepicker.lang', 'jquery.ui.datepicker-zh-TW.js'));
 }
예제 #3
0
 public function all()
 {
     $columns = array(array('key' => 'title', 'title' => '標題', 'sql' => 'title LIKE ?'), array('key' => 'content', 'title' => '內容', 'sql' => 'content LIKE ?'));
     $configs = array('admin', $this->get_class(), '%s');
     $conditions = conditions($columns, $configs);
     Work::addConditions($conditions, 'destroy_user_id IS NOT NULL');
     $limit = 25;
     $works = Work::find('all', array('order' => 'id DESC', 'include' => array('pictures'), 'conditions' => $conditions));
     return $this->add_tab('所有刪除作品', array('href' => base_url('admin', $this->get_class(), 'add'), 'index' => 3))->set_tab_index(3)->set_subtitle('所有刪除作品')->add_css(resource_url('resource', 'css', 'fancyBox_v2.1.5', 'my.css'))->add_js(resource_url('resource', 'javascript', 'fancyBox_v2.1.5', 'my.js'))->load_view(array('works' => $works, 'columns' => $columns));
 }
예제 #4
0
 public function __construct()
 {
     parent::__construct();
     if (!(($id = $this->uri->rsegments(3, 0)) && (is_numeric($id) ? $this->tag = ArticleTag::find_by_id($id) : ($this->tag = ArticleTag::find_by_name(trim(urldecode($id))))))) {
         return redirect_message(array('articles'), array('_flash_message' => '找不到該筆資料。'));
     }
     if (in_array($this->uri->rsegments(2, 0), array('edit', 'update', 'destroy', 'sort'))) {
         if (!(($id = $this->uri->rsegments(4, 0)) && ($this->article = Article::find_by_id($id)))) {
             return redirect_message(array('articles', $this->tag->id, 'articles'), array('_flash_message' => '找不到該筆資料。'));
         }
     }
     $this->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'jquery.timeago.js'))->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'locales', 'jquery.timeago.zh-TW.js'));
 }
예제 #5
0
		#map {
			width: 100%;
			height: 100%;
		}
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
	<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js"></script>
	<script type="text/javascript" src= <?php 
echo resource_url('js/proj4js-compressed.js');
?>
></script>
	<script type="text/javascript" src= <?php 
echo resource_url('js/proj4leaflet.js');
?>
></script>
    <script type="text/javascript">
    
    
    var crs = new L.Proj.CRS('ESRI:53009', '+proj=moll +lon_0=0 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs', {
        resolutions: [65536, 32768, 16384, 8192, 4096, 2048],
		origin: [0, 0] });
	
	var map = L.map('map', {
        crs: crs,
        maxZoom: 5,
		continuousWorld: true,
		worldCopyJump: false
    });
예제 #6
0
파일: maptest_view.php 프로젝트: kidaa/IWP
	<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js"></script>

	<script type="text/javascript" src= <?php 
echo resource_url('js/proj4js-compressed.js');
?>
></script>
	<script type="text/javascript" src= <?php 
echo resource_url('js/proj4leaflet.js');
?>
></script>
	<script type="text/javascript" src= <?php 
echo resource_url('js/countries-110m.js');
?>
></script>
	<script type="text/javascript" src= <?php 
echo resource_url('js/L.Graticule.js');
?>
></script>


<script type="text/javascript">

var map = L.map('map').setView([0,0], 2.5);

/*
	var cshapes=L.tileLayer.wms("http://dsph-dev.provost.uiowa.edu:8080/geoserver/IWP/wms", {
    	layers:'IWP:cshapes_mw',
		format: 'image/png',
		transparent: true,
		version: '1.1.0',
		attribution: "myattribution"
예제 #7
0
 public function edit()
 {
     $posts = Session::getData('posts', true);
     $posts['sources'] = isset($posts['sources']) && $posts['sources'] ? array_slice(array_filter($posts['sources'], function ($source) {
         return isset($source['title']) && $source['title'] || isset($source['href']) && $source['href'];
     }), 0) : ($this->article->sources ? array_filter(array_map(function ($source) {
         return array('title' => $source->title, 'href' => $source->href);
     }, $this->article->sources), function ($source) {
         return isset($source['title']) && $source['title'] || isset($source['href']) && $source['href'];
     }) : array());
     return $this->add_tab('編輯文章', array('href' => base_url('admin', $this->get_class(), $this->article->id, 'edit'), 'index' => 3))->set_tab_index(3)->set_subtitle('編輯文章')->add_js(resource_url('resource', 'javascript', 'ckeditor_d2015_05_18', 'ckeditor.js'), false)->add_js(resource_url('resource', 'javascript', 'ckeditor_d2015_05_18', 'config.js'), false)->add_js(resource_url('resource', 'javascript', 'ckeditor_d2015_05_18', 'adapters', 'jquery.js'), false)->load_view(array('posts' => $posts, 'article' => $this->article));
 }
예제 #8
0
<!DOCTYPE html>
<html lang="zh">
  <head>
    <?php 
echo isset($meta_list) ? $meta_list : '';
?>
    <link rel="chitorch icon" href="<?php 
echo resource_url('resource', 'image', 'logo', 'favicon.ico');
?>
">

    <title><?php 
echo isset($title) ? $title : '';
?>
</title>

    <link rel="alternate" href="<?php 
echo current_url();
?>
" hreflang="zh-Hant" />
    <meta name="msvalidate.01" content="337867F91709D9322F7258F220946159" />

<?php 
echo isset($css_list) ? $css_list : '';
?>

<?php 
echo isset($js_list) ? $js_list : '';
?>

  </head>
예제 #9
0
 private function _add_js()
 {
     return $this->add_js(resource_url('resource', 'javascript', 'jquery_v1.10.2', 'jquery-1.10.2.min.js'))->add_js(resource_url('resource', 'javascript', 'imgLiquid_v0.9.944', 'imgLiquid-min.js'))->add_js(resource_url('resource', 'javascript', 'autosize_v3.0.8', 'autosize.min.js'));
 }
예제 #10
0
<header class='_h'>
  <a href='<?php 
echo base_url();
?>
'>
    <img src='<?php 
echo resource_url('resource', 'image', 'logo', 'logo.png');
?>
' alt='<?php 
echo Cfg::setting('site', 'site', 'title');
?>
'>
  </a>

  <nav>
    <a href='<?php 
echo base_url();
?>
'<?php 
echo $key == 'index' ? 'class="a"' : '';
?>
>Home</a>
    <a href='<?php 
echo base_url('works');
?>
'<?php 
echo $key == 'works' ? 'class="a"' : '';
?>
>設計作品</a>
    <a href='<?php 
echo base_url('articles');
예제 #11
0
 public function index($offset = 0)
 {
     $conditions = $this->_conditions($offset, Contact::IS_VISIBLED);
     return $this->set_tab_index(1)->set_subtitle('留言列表')->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'jquery.timeago.js'))->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'locales', 'jquery.timeago.zh-TW.js'))->add_hidden(array('id' => 'no_replied_url', 'value' => base_url('admin', $this->get_class(), 'no_replied')))->load_view(array('contacts' => $conditions['contacts'], 'pagination' => $conditions['pagination'], 'columns' => $conditions['columns']));
 }
예제 #12
0
 public function index()
 {
     return;
     $pokmons = Pokemon::find('all');
     $this->set_frame_path('frame', 'pure')->add_css(resource_url('resource', 'css', 'fancyBox_v2.1.5', 'my.css'))->add_js(resource_url('resource', 'javascript', 'fancyBox_v2.1.5', 'my.js'))->add_js(resource_url('resource', 'javascript', 'lazyload_v1.9.7', 'jquery.lazyload.min.js'))->load_view(array('pokmons' => $pokmons));
 }
예제 #13
0
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>IWP Authors Map</title>
        <?php 
echo link_tag('resources/css/style.css');
?>
        <script type="text/javascript" src="<?php 
echo resource_url('OpenLayers/OpenLayers.js');
?>
"></script>
    </head>
    <body onload='init();'>
<!-- Map DOM element -->
<div id="ch3_feature_markers" style="width: 100%; height: 100%;"></div>

<!-- The magic comes here -->
<script type="text/javascript">

    // Create the map using the specified DOM element
    var map = new OpenLayers.Map("ch3_feature_markers");    
    
    var layer = new OpenLayers.Layer.OSM("OpenStreetMap");
    map.addLayer(layer);
    
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.setCenter(new OpenLayers.LonLat(0,0), 2);
            
    var pointLayer = new OpenLayers.Layer.Vector("Features", {
        projection: "EPSG:933913"
예제 #14
0
 private function _add_js()
 {
     return $this->add_js(resource_url('resource', 'javascript', 'jquery_v1.10.2', 'jquery-1.10.2.min.js'))->add_js(resource_url('resource', 'javascript', 'jquery-rails_d2015_03_09', 'jquery_ujs.js'))->add_js(resource_url('resource', 'javascript', 'imgLiquid_v0.9.944', 'imgLiquid-min.js'))->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'jquery.timeago.js'))->add_js(resource_url('resource', 'javascript', 'jquery-timeago_v1.3.1', 'locales', 'jquery.timeago.zh-TW.js'))->add_js(resource_url('resource', 'javascript', 'autosize_v3.0.8', 'autosize.min.js'))->add_js(resource_url('resource', 'javascript', 'masonry_v3.1.2', 'masonry.pkgd.min.js'))->append_js(base_url('application', 'cell', 'views', 'admin_frame_cell', 'navbar', 'content.js'))->add_js(base_url('application', 'cell', 'views', 'admin_frame_cell', 'wrapper_left', 'content.js'))->append_js(base_url('application', 'cell', 'views', 'admin_frame_cell', 'tabs', 'content.js'));
 }
예제 #15
0
                map.addLayer(wms);

        var vectorLayer = new OpenLayers.Layer.Vector("Overlay");
        var feature = new OpenLayers.Feature.Vector(
            new OpenLayers.Geometry.Point(-71, 42),
            {some:'data'},
            {externalGraphic: '<?php 
echo resource_url("img/marker.png");
?>
', graphicHeight: 21, graphicWidth: 16});
        vectorLayer.addFeatures(feature);   
        var feature = new OpenLayers.Feature.Vector(
            new OpenLayers.Geometry.Point(-0, 0),
            {some:'data'},
            {externalGraphic: '<?php 
echo resource_url("img/marker.png");
?>
', graphicHeight: 60, graphicWidth: 60});
        vectorLayer.addFeatures(feature);   

        map.addLayer(vectorLayer);
                
                

                map.addControl(new OpenLayers.Control.LayerSwitcher());
                map.zoomToMaxExtent();
             }              
           
           </script>
    </body>
</html>
예제 #16
0
 public function index()
 {
     $posts = Session::getData('posts', true);
     $this->set_title('聯絡我們' . ' - ' . Cfg::setting('site', 'site', 'title'))->add_param('_method', $this->get_class())->add_js(resource_url('resource', 'javascript', 'jquery.validate_v1.9.0', 'jquery.validate.min.js'))->add_js(resource_url('resource', 'javascript', 'jquery.validate_v1.9.0', 'jquery.validate.lang.js'))->load_view(array('posts' => $posts));
 }