Esempio n. 1
0
 /**
  * Update watch status
  * 
  * @access  public
  * @param   string  $foreign_table  target related table
  * @param   int     $foreign_id  target related table id
  * @return  Response (json)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 public function post_update_watch_status($foreign_table = null, $foreign_id = null)
 {
     $this->controller_common_api(function () use($foreign_table, $foreign_id) {
         if (!is_enabled('notice')) {
             throw new \HttpNotFoundException();
         }
         if (\Input::post('foreign_table')) {
             $foreign_table = \Input::post('foreign_table');
         }
         $foreign_id = intval(\Input::post('foreign_id') ?: $foreign_id);
         if (!$foreign_table || !$foreign_id) {
             throw new \HttpNotFoundException();
         }
         if (!in_array($foreign_table, Site_Util::get_accept_foreign_tables())) {
             throw new \HttpNotFoundException();
         }
         $this->response_body['errors']['message_default'] = term('form.watch') . '状態の変更に失敗しました。';
         $model = \Site_Model::get_model_name($foreign_table);
         $foreign_obj = $model::check_authority($foreign_id);
         $member_id = $foreign_table == 'album_image' ? $foreign_obj->album->member_id : $foreign_obj->member_id;
         $this->check_browse_authority($foreign_obj->public_flag, $member_id);
         if ($member_id == $this->u->id) {
             throw new \HttpBadRequestException();
         }
         \DB::start_transaction();
         $is_registerd = (bool) Model_MemberWatchContent::change_registered_status4unique_key(array('foreign_table' => $foreign_table, 'foreign_id' => $foreign_id, 'member_id' => $this->u->id));
         \DB::commit_transaction();
         $data = array('result' => $is_registerd, 'message' => $is_registerd ? term('form.watch') . '対象に追加しました。' : term('form.watch') . 'を解除しました。', 'html' => icon_label($is_registerd ? 'form.do_unwatch' : 'form.do_watch', 'both', false));
         $this->set_response_body_api($data);
     });
 }
Esempio n. 2
0
 /**
  * Change timeline follow status
  * 
  * @access  public
  * @param   int  $id  timeline id
  * @return  Response (json)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 public function post_update_follow_status($id = null)
 {
     $this->controller_common_api(function () use($id) {
         $this->response_body['errors']['message_default'] = term('form.fallow') . '状態の変更に失敗しました。';
         $id = intval(\Input::post('id') ?: $id);
         $timeline = Model_Timeline::check_authority($id);
         $this->check_browse_authority($timeline->public_flag, $timeline->member_id);
         if ($timeline->member_id == $this->u->id) {
             throw new \HttpBadRequestException();
         }
         // 自分のタイムラインはフォロー解除不可
         \DB::start_transaction();
         $is_registerd = (int) Model_MemberFollowTimeline::change_registered_status4unique_key(array('member_id' => $this->u->id, 'timeline_id' => $timeline->id));
         \DB::commit_transaction();
         $data = array('result' => $is_registerd, 'message' => $is_registerd ? term('follow') . 'しました。' : term('follow') . 'を解除しました。', 'html' => icon_label($is_registerd ? 'followed' : 'do_follow', 'both', false));
         $this->set_response_body_api($data);
     });
 }
Esempio n. 3
0
<?php 
        echo render('news::_parts/news_subinfo', array('news' => $news, 'tags' => $tags, 'is_simple_view' => true));
        ?>
	</div>

<?php 
    }
    ?>
</div>
<?php 
}
?>

<?php 
if (!empty($see_more_link)) {
    $anchor_text_default = icon_label('site.see_more', 'both', false, null, 'fa fa-');
    $href = Uri::create_url($see_more_link['uri']);
    $anchor_text = !empty($see_more_link['text']) ? $see_more_link['text'] : $anchor_text_default;
    $load_after_link_attr = array('class' => 'listMoreBox');
    echo Html::anchor($href, $anchor_text, $load_after_link_attr);
} elseif (!empty($next_page)) {
    ?>
<nav id="page-nav">
<?php 
    $uri = sprintf('news/api4site/list.html?page=%d', $next_page);
    if (!empty($category_name)) {
        $uri .= '&category=' . $category_name;
    }
    if (!empty($tag_string)) {
        $uri .= '&tag=' . $tag_string;
    }
Esempio n. 4
0
<script type="text/x-handlebars-template" id="tl_dropdown_menu-tpl">
{{#if detail_uri}}
<li><a href="{{detail_uri}}"><?php 
echo icon_label('site.show_detail', 'both', false);
?>
</a></li>
{{else}}
<li><span class="disabled"><?php 
echo icon_label('site.show_detail', 'both', false);
?>
</span></li>
{{/if}}
{{#if delete_uri}}<li><a href="#" class="js-ajax-delete" data-uri="{{delete_uri}}" data-parent="#{{parent_id}}"><?php 
echo icon_label('form.do_delete', 'both', false);
?>
</a></li>{{/if}}
</script>
Esempio n. 5
0
<?php

$link_attr_default = array('class' => 'js-insert_text', 'data-parent_id' => $target_id, 'data-text' => '@' . $member_name, 'data-open' => '#commentPostBox_' . $target_id, 'data-hide' => '#link_show_comment_form_' . $target_id, 'data-input' => '#textarea_comment_' . $target_id);
if (!isset($link_attr)) {
    $link_attr = array();
}
$link_attr = Util_Toolkit::convert_to_attr($link_attr, $link_attr_default);
if ((Auth::check() || !empty($link_display_absolute)) && empty($link_hide_absolute)) {
    ?>
<small class="mr10"><?php 
    echo anchor('#', icon_label('form.do_reply'), false, $link_attr);
    ?>
</small>
<?php 
}
Esempio n. 6
0
    echo form_anchor(conf('login_uri.site'), icon_label('site.login', 'both', false), array('class' => 'btn btn-default btn-primary'), $col_offset_size);
}
?>

<?php 
if (FBD_FACEBOOK_APP_ID) {
    ?>
	<?php 
    echo form_anchor(conf('login_uri.site') . '/facebook', icon_label('Facebookで' . term('site.login'), 'both', false, 'facebook-square', 'fa fa-'), array('class' => 'btn btn-default'), $col_offset_size);
}
if (FBD_TWITTER_APP_ID) {
    ?>
	<?php 
    echo form_anchor(conf('login_uri.site') . '/twitter', icon_label('Twitterで' . term('site.login'), 'both', false, 'twitter', 'fa fa-'), array('class' => 'btn btn-default'), $col_offset_size);
}
if (FBD_GOOGLE_APP_ID) {
    ?>
	<?php 
    echo form_anchor(conf('login_uri.site') . '/google', icon_label('Googleで' . term('site.login'), 'both', false, 'google', 'fa fa-'), array('class' => 'btn btn-default'), $col_offset_size);
}
?>
	<?php 
echo form_anchor('member/register/signup', icon_label('member.registration', 'both', false), array('class' => 'btn btn-default btn-warning'), $col_offset_size);
?>

<?php 
echo form_close();
if (empty($in_popover)) {
    ?>
</div><?php 
}
Esempio n. 7
0
    echo render('timeline::_parts/list', $timelines);
}
?>

<?php 
if (!empty($news_list['list'])) {
    ?>
<h3><?php 
    echo term('site.latest', 'news.view');
    ?>
</h3>
<?php 
    $view = View::forge('news::_parts/list', $news_list);
    $view->set_safe('html_bodys', $html_bodys);
    echo $view->render();
}
?>

<?php 
if (!empty($album_images['list'])) {
    ?>
<h3><?php 
    echo term('site.latest', 'album_image');
    ?>
</h3>
<?php 
    echo render('album::image/_parts/list', $album_images);
    if (isset($album_images['next_page']) && $album_images['next_page'] > 1) {
        echo Html::anchor('album/image', icon_label('site.see_more', 'both', false, null, 'fa fa-'), array('class' => 'listMoreBox'));
    }
}
Esempio n. 8
0
        $textarea_attr['data-provide'] = 'markdown';
    }
    echo form_textarea($val, 'body', isset($news) ? $news->body : '', 12, true, null, null, $textarea_attr, true);
} else {
    ?>
	<?php 
    echo form_textarea($val, 'body', isset($news) ? $news->body : '');
}
?>
</small>
<?php 
if (conf('image.isEnabled', 'news')) {
    if (conf('image.isModalUpload', 'news')) {
        ?>
	<?php 
        echo form_modal(icon_label('form.add_picture'), sprintf('admin/news/image/api/list/%d.html', $news->id), 'modal_images', term('form.add_picture'), null, term('site.picture'));
    } else {
        $insert_target = null;
        if (conf('image.isInsertBody', 'news')) {
            $insert_target = isset($news) && $news->format == 1 ? '.note-editable' : '#form_body';
        }
        echo form_upload_files($images, false, true, 'M', array(), 'news', term('site.picture'), !empty($news) ? sprintf('admin/news/image/api/upload/%d.json', $news->id) : null, $insert_target);
    }
}
if (conf('file.isEnabled', 'news')) {
    ?>
	<?php 
    echo form_upload_files($files, false, true, 'M', array(), 'news', term('site.file'), null, null, 2, 'file');
}
if (Config::get('news.link.isEnabled')) {
    ?>
Esempio n. 9
0
">
<?php 
        echo render('_parts/member_profile', array('member' => !empty($related_member_table_name) ? $obj->{$related_member_table_name} : $obj, 'next_id' => $next_id, 'access_from' => Auth::check() ? 'member' : 'guest', 'is_list' => true, 'page_type' => 'list', 'display_type' => 'summary', 'is_simple_list' => $is_simple_list));
        ?>
	</div>
<?php 
    }
    ?>
</div>
<?php 
}
?>

<?php 
if ($next_id) {
    $gete_data_list = array();
    $gete_data_list['max_id'] = $next_id;
    if (!empty($since_id)) {
        $gete_data_list['since_id'] = $since_id;
    }
    $load_after_link_attr = array('data-get_data' => json_encode($gete_data_list));
    $href = IS_API ? '#' : Uri::create_url(Uri::string(), array('max_id' => $next_id));
    echo Html::anchor($href, icon_label('site.see_more', 'both', false, null, 'fa fa-'), array_merge($load_after_link_attr, $load_link_attr_default));
}
?>

<?php 
if (IS_API) {
    ?>
</body></html><?php 
}
Esempio n. 10
0
<?php 
echo form_open(true);
if (!empty($configs['title'])) {
    ?>
	<?php 
    echo form_input($val, 'title', $configs['title']);
}
?>
	<?php 
echo form_textarea($val, 'body', $configs['body']);
?>
	<?php 
echo form_button('form.do_edit', 'submit', 'submit', array('class' => 'btn btn-default btn-warning'));
?>
	<?php 
echo form_anchor_delete('admin/content/template/mail/reset/' . $db_key, icon_label('form.do_reset_default', 'both', false), array('data-msg' => 'デフォルトに戻します。よろしいですか?'));
echo form_close();
?>

<?php 
if (!empty($configs['variables'])) {
    ?>
<h4 class="col-sm-offset-2 mt20">使用可能な変数</h4>
<?php 
    foreach ($configs['variables'] as $val_name => $explain) {
        ?>
<div class="row">
	<div class="col-sm-offset-2 col-xs-3 col-xs-4"><label><?php 
        echo $val_name;
        ?>
</label></div>
Esempio n. 11
0
<div class="tag-group">
	<h5><?php 
echo icon_label('site.tag');
?>
</h5>
	<ul>
	<?php 
foreach ($tags as $tag) {
    ?>
		<li><?php 
    echo anchor('news/tag/' . urlencode($tag), $tag, IS_ADMIN, array('class' => 'label label-default'));
    ?>
</li>
	<?php 
}
?>
	</ul>
</div>

Esempio n. 12
0
function get_public_flag_label($public_flag, $view_icon_only = false, $return_type = 'array', $is_hidden_xs = false)
{
    if (!in_array($return_type, array('array', 'icon_term', 'label'))) {
        throw new InvalidArgumentException('Second parameter is invalid.');
    }
    $public_flag_key = 'public_flag.options.' . $public_flag;
    $icon = icon_label($public_flag_key, 'icon', $is_hidden_xs, null, 'fa fa-', 'i');
    $name = $view_icon_only ? '' : icon_label($public_flag_key, 'label', $is_hidden_xs, null, 'fa fa-', 'i');
    if ($return_type == 'icon_term') {
        return $icon . $name;
    }
    $color = Site_Util::get_public_flag_coloer_type($public_flag);
    if ($return_type == 'label') {
        return html_tag('span', array('class' => 'label label-' . $color), $icon . $name);
    }
    return array($name, $icon, 'btn-' . $color);
}
Esempio n. 13
0
		<li<?php 
                echo $li_class;
                ?>
><?php 
                echo anchor($href, $label, false, $attr);
                ?>
</li>
<?php 
            }
        } elseif ($menu['tag'] == 'disabled') {
            ?>
		<li<?php 
            echo $li_class;
            ?>
><span class="disabled"><?php 
            echo isset($menu['icon_term']) ? icon_label($menu['icon_term'], 'both', false) : $label;
            ?>
</span></li>
<?php 
        } elseif ($menu['tag'] == 'divider') {
            ?>
		<li class="divider<?php 
            echo !empty($is_ajax_loaded) ? ' ajax_loaded' : '';
            ?>
"></li>
<?php 
        } else {
            ?>
		<li<?php 
            echo $li_class;
            ?>
Esempio n. 14
0
function anchor_icon($href, $icon_term, $attr = array(), $type = 'both', $is_hidden_xs = false, $absolute_icon_key = null, $is_admin = false, $is_absolute_ext_uri = false, $class_prefix = 'glyphicon glyphicon-', $tag = 'i', $delimitter = ' ')
{
    $element = icon_label($icon_term, $type, $is_hidden_xs, $absolute_icon_key, $class_prefix, $tag, $delimitter);
    return anchor($href, $element, $is_admin, $attr, $is_absolute_ext_uri);
}
Esempio n. 15
0
function form_anchor_delete($post_uri, $anchor_label = null, $attr = null, $offset_size = 2, $secure = null, $is_enclose_small_tag = false)
{
    if (is_null($anchor_label)) {
        $anchor_label = icon_label('form.do_delete', 'both', false);
    }
    $attr_default = array('id' => 'btn_delete', 'class' => 'btn btn-default btn-danger js-simplePost', 'data-uri' => $post_uri, 'data-msg' => '削除します。よろしいですか?');
    if (!is_array($attr)) {
        $attr = (array) $attr;
    }
    $attr = array_merge($attr_default, $attr);
    $data = array('href' => '#', 'atter' => $attr, 'secure' => $secure, 'offset_size' => $offset_size, 'is_enclose_small_tag' => $is_enclose_small_tag);
    $view = \View::forge('_parts/form/anchor', $data);
    $view->set_safe('anchor_label', $anchor_label);
    return $view;
}