public function getCheckboxes($fid, $is_admmod, $is_subscribed)
    {
        Container::get('hooks')->fire('model.post.get_checkboxes_start', $fid, $is_admmod, $is_subscribed);

        $cur_index = 1;

        $checkboxes = [];
        if ($fid && $is_admmod) {
            $checkboxes[] = '<label class="checkbox-inline">'.
                '<input type="checkbox" name="stick_topic" value="1" tabindex="'.
                ($cur_index++).'"'.(Input::post('stick_topic') ? ' checked="checked"' : '').' />'.
                __('Stick topic').'<br /></label>';
        }

        if (!User::get()->is_guest) {
            if (ForumSettings::get('o_smilies') == '1') {
                $checkboxes[] = '<label class="checkbox-inline">'.
                    '<input type="checkbox" name="hide_smilies" value="1" tabindex="'.
                    ($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.
                    __('Hide smilies').'<br /></label>';
            }

            if (ForumSettings::get('o_topic_subscriptions') == '1') {
                $subscr_checked = false;

                // If it's a preview
                if (Input::post('preview')) {
                    $subscr_checked = (Input::post('subscribe')) ? true : false;
                } // If auto subscribed
                elseif (User::get()->auto_notify) {
                    $subscr_checked = true;
                } // If already subscribed to the topic
                elseif ($is_subscribed) {
                    $subscr_checked = true;
                }

                $checkboxes[] = '<label class="checkbox-inline">'.
                    '<input type="checkbox" name="subscribe" value="1" tabindex="'.
                    ($cur_index++).'"'.($subscr_checked ? ' checked="checked"' : '').' />'.
                    ($is_subscribed ? __('Stay subscribed') : __('Subscribe')).'<br /></label>';
            }
        } elseif (ForumSettings::get('o_smilies') == '1') {
            $checkboxes[] = '<label class="checkbox-inline">'.
                '<input type="checkbox" name="hide_smilies" value="1" tabindex="'.
                ($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.
                __('Hide smilies').'<br /></label>';
        }

        $checkboxes = Container::get('hooks')->fire('model.post.get_checkboxes', $checkboxes);

        return $checkboxes;
    }
public function getCheckboxes($fid, $is_admmod, $is_subscribed)
    {
        Container::get('hooks')->fire('model.post.get_checkboxes_start', $fid, $is_admmod, $is_subscribed);

        $cur_index = 1;

        $checkboxes = [];
        if ($fid && $is_admmod) {
            $checkboxes[] = '<label class="checkbox-inline">'.
                '<input type="checkbox" name="stick_topic" value="1" tabindex="'.
                ($cur_index++).'"'.(Input::post('stick_topic') ? ' checked="checked"' : '').' />'.
                __('Stick topic').'<br /></label>';
        }

        if (!User::get()->is_guest) {
            if (ForumSettings::get('o_smilies') == '1') {
                $checkboxes[] = '<label class="checkbox-inline">'.
                    '<input type="checkbox" name="hide_smilies" value="1" tabindex="'.
                    ($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.
                    __('Hide smilies').'<br /></label>';
            }

            if (ForumSettings::get('o_topic_subscriptions') == '1') {
                $subscr_checked = false;

                // If it's a preview
                if (Input::post('preview')) {
                    $subscr_checked = (Input::post('subscribe')) ? true : false;
                } // If auto subscribed
                elseif (User::get()->auto_notify) {
                    $subscr_checked = true;
                } // If already subscribed to the topic
                elseif ($is_subscribed) {
                    $subscr_checked = true;
                }

                $checkboxes[] = '<label class="checkbox-inline">'.
                    '<input type="checkbox" name="subscribe" value="1" tabindex="'.
                    ($cur_index++).'"'.($subscr_checked ? ' checked="checked"' : '').' />'.
                    ($is_subscribed ? __('Stay subscribed') : __('Subscribe')).'<br /></label>';
            }
        } elseif (ForumSettings::get('o_smilies') == '1') {
            $checkboxes[] = '<label class="checkbox-inline">'.
                '<input type="checkbox" name="hide_smilies" value="1" tabindex="'.
                ($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.
                __('Hide smilies').'<br /></label>';
        }

        $checkboxes = Container::get('hooks')->fire('model.post.get_checkboxes', $checkboxes);

        return $checkboxes;
    }
public function getCheckboxes ( $ fid , $ is_admmod , $ is_subscribed ) { Container :: get ( 'hooks' ) -> fire ( 'model.post.get_checkboxes_start' , $ fid , $ is_admmod , $ is_subscribed ) ; $ cur_index = 1 ; $ checkboxes = [ ] ; if ( $ fid && $ is_admmod ) { $ checkboxes [ ] = '<label class="checkbox-inline">' . '<input type="checkbox" name="stick_topic" value="1" tabindex="' . ( $ cur_index ++ ) . '"' . ( Input :: post ( 'stick_topic' ) ? ' checked="checked"' : '' ) . ' />' . __ ( 'Stick topic' ) . '<br /></label>' ; } if ( ! User :: get ( ) -> is_guest ) { if ( ForumSettings :: get ( 'o_smilies' ) == '1' ) { $ checkboxes [ ] = '<label class="checkbox-inline">' . '<input type="checkbox" name="hide_smilies" value="1" tabindex="' . ( $ cur_index ++ ) . '"' . ( Input :: post ( 'hide_smilies' ) ? ' checked="checked"' : '' ) . ' />' . __ ( 'Hide smilies' ) . '<br /></label>' ; } if ( ForumSettings :: get ( 'o_topic_subscriptions' ) == '1' ) { $ subscr_checked = false ; // If it's a preview if ( Input :: post ( 'preview' ) ) { $ subscr_checked = ( Input :: post ( 'subscribe' ) ) ? true : false ; } // If auto subscribed elseif ( User :: get ( ) -> auto_notify ) { $ subscr_checked = true ; } // If already subscribed to the topic elseif ( $ is_subscribed ) { $ subscr_checked = true ; } $ checkboxes [ ] = '<label class="checkbox-inline">' . '<input type="checkbox" name="subscribe" value="1" tabindex="' . ( $ cur_index ++ ) . '"' . ( $ subscr_checked ? ' checked="checked"' : '' ) . ' />' . ( $ is_subscribed ? __ ( 'Stay subscribed' ) : __ ( 'Subscribe' ) ) . '<br /></label>' ; } } elseif ( ForumSettings :: get ( 'o_smilies' ) == '1' ) { $ checkboxes [ ] = '<label class="checkbox-inline">' . '<input type="checkbox" name="hide_smilies" value="1" tabindex="' . ( $ cur_index ++ ) . '"' . ( Input :: post ( 'hide_smilies' ) ? ' checked="checked"' : '' ) . ' />' . __ ( 'Hide smilies' ) . '<br /></label>' ; } $ checkboxes = Container :: get ( 'hooks' ) -> fire ( 'model.post.get_checkboxes' , $ checkboxes ) ; return $ checkboxes ; }
Get the current state of checkboxes
Get the current state of checkboxes