Exemplo n.º 1
0
 public function actionAdmin()
 {
     // delete comment request
     if (Rays::isPost()) {
         if (isset($_POST['checked_comments'])) {
             $commentIds = $_POST['checked_comments'];
             foreach ($commentIds as $id) {
                 if (!is_numeric($id)) {
                     return;
                 } else {
                     $comment = new Comment();
                     $comment->id = $id;
                     $comment->delete();
                 }
             }
         }
     }
     $curPage = $this->getPage("page");
     $pageSize = $this->getPageSize('pagesize', 10);
     $count = Comment::find()->count();
     $comments = Comment::find()->join("user")->join("topic")->order_desc("id")->range(($curPage - 1) * $pageSize, $pageSize);
     $pager = new RPager('page', $count, $pageSize, RHtml::siteUrl('comment/admin'), $curPage);
     $this->layout = 'admin';
     $this->setHeaderTitle("Comments administration");
     $data = array('count' => $count, 'comments' => $comments, 'pager' => $pager->showPager());
     $this->render('admin', $data, false);
 }
Exemplo n.º 2
0
 /**
  * View system logs
  */
 public function actionLogs()
 {
     $curPage = $this->getPage("page");
     $pageSize = $this->getPageSize("pagesize", 10);
     $count = SystemLog::find()->count();
     $logs = SystemLog::find()->order_desc("id")->join('user')->range(($curPage - 1) * $pageSize, $pageSize);
     $pager = new RPager('page', $count, $pageSize, RHtml::siteUrl('admin/logs'), $curPage);
     $this->setHeaderTitle("System logs");
     $this->render('logs', ['logs' => $logs, 'pager' => $pager->showPager(), 'count' => $count], false);
 }
Exemplo n.º 3
0
 /**
  * Load the main Searchtools libraries
  *
  * @param   mixed  $debug  Is debugging mode on? [optional]
  *
  * @return  void
  *
  * @since   3.2
  */
 public static function main($debug = null)
 {
     // Only load once
     if (empty(static::$loaded[__METHOD__])) {
         // Requires jQuery but allows to skip its loading
         if ($loadJquery = !isset($options['loadJquery']) || $options['loadJquery'] != 0) {
             RHtml::_('rjquery.framework');
         }
         // Load the jQuery plugin && CSS
         RHelperAsset::load('jquery.searchtools.css', static::EXTENSION);
         RHelperAsset::load('jquery.searchtools.min.js', static::EXTENSION);
         static::$loaded[__METHOD__] = true;
     }
     return;
 }
Exemplo n.º 4
0
 /**
  * Category administration
  */
 public function actionAdmin()
 {
     $data = array();
     if (Rays::isPost()) {
         if (isset($_POST['sub_items'])) {
             $items = $_POST['sub_items'];
             if (is_array($items)) {
                 foreach ($items as $item) {
                     if (!is_numeric($item)) {
                         return;
                     } else {
                         $cat = Category::get($item);
                         if ($cat->pid == 0) {
                             continue;
                         }
                         $cat->delete();
                     }
                 }
             }
         }
         if (isset($_POST['cat-name']) && isset($_POST['parent-id'])) {
             $name = trim($_POST['cat-name']);
             $pid = $_POST['parent-id'];
             if (is_numeric($pid)) {
                 if ($name == '') {
                     $this->flash('error', 'Category name cannot be blank.');
                 } else {
                     $result = Category::get($pid);
                     if ($result != null) {
                         $newCat = new Category();
                         $newCat->name = RHtml::encode(trim($name));
                         $newCat->pid = $pid;
                         $newCat->save();
                         $this->flash('message', 'Category ' . $name . " was created successfully.");
                     } else {
                         $this->flash('error', 'Parent category not exists.');
                     }
                 }
             }
         }
     }
     $data['categories'] = Category::find()->all();
     $this->layout = 'admin';
     $this->setHeaderTitle('Category administration');
     $this->render('admin', $data, false);
 }
Exemplo n.º 5
0
 public function actionAdmin()
 {
     $this->setHeaderTitle('Advertisement');
     $this->layout = 'admin';
     if (Rays::isPost()) {
         if (isset($_POST['checked_ads'])) {
             $selected = $_POST['checked_ads'];
             if (is_array($selected)) {
                 $operation = $_POST['operation_type'];
                 foreach ($selected as $id) {
                     $ad = Ads::get($id);
                     if ($ad == null) {
                         break;
                     }
                     switch ($operation) {
                         case "block":
                             $ad->status = Ads::BLOCKED;
                             $ad->save();
                             break;
                         case "active":
                             $ad->status = Ads::APPROVED;
                             $ad->save();
                             break;
                     }
                 }
             }
         }
     }
     $curPage = $this->getPage('page');
     $pageSize = $this->getPageSize("pagesize", 10);
     $filterStr = Rays::getParam('search', null);
     $query = Ads::find()->join("publisher");
     if ($name = trim($filterStr)) {
         $names = preg_split("/[\\s]+/", $name);
         foreach ($names as $key) {
             $query = $query->like("name", $key);
         }
     }
     $count = $query->count();
     $ads = $query->order_desc("id")->range($pageSize * ($curPage - 1), $pageSize);
     $data = ['ads' => $ads, 'count' => $count];
     $url = RHtml::siteUrl('ads/admin');
     if ($filterStr != null) {
         $url .= '?search=' . urlencode(trim($filterStr));
     }
     $pager = new RPager('page', $count, $pageSize, $url, $curPage);
     $data['pager'] = $pager->showPager();
     $this->render('admin', $data, false);
 }
Exemplo n.º 6
0
                    <th>Host</th>
                    <th>Timestamp</th>
                </tr>
                </thead>
                <tbody>
                <?php 
foreach ($logs as $log) {
    echo '<tr>';
    echo '<td>' . $log->type . '</td>';
    echo '<td>' . $log->severity . '</td>';
    echo '<td>' . $log->message . '</td>';
    echo '<td>' . RHtml::link($log->path, $log->path, $log->path) . '</td>';
    if ($log->userId == 0) {
        echo '<td>Anonymous</td>';
    } else {
        echo '<td>' . RHtml::linkAction('user', $log->user->name, 'view', $log->user->id) . '</td>';
    }
    echo '<td>' . $log->host . '</td>';
    echo '<td>' . $log->timestamp . '</td>';
    echo '</tr>';
}
?>
                </tbody>
            </table>

        </div>
        <?php 
echo $pager;
?>
    </div>
Exemplo n.º 7
0
?>
        <div><br/><b>Select friends to invite:</b></div>
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="checkbox friends-list">
                    <?php 
foreach ($friends as $friend) {
    echo '<div class="col-lg-2 friend-item" style="height: 90px;">';
    if (!isset($friend->user->picture) || $friend->user->picture == '') {
        $friend->user->picture = User::$defaults['picture'];
    }
    $picture = RImage::styleSrc($friend->user->picture, User::getPicOptions());
    echo RHtml::image($picture, $friend->user->name, array('width' => '64px'));
    echo '<br/>';
    echo RForm::input(array('type' => 'checkbox', 'name' => 'select_friends[]', 'value' => $friend->user->id, 'class' => 'btn btn-default'));
    echo RHtml::linkAction('user', $friend->user->name, 'view', $friend->user->id);
    echo '</div>';
}
?>
                </div>
            </div>
        </div>

        <hr>

        <div><b>Write something as an invitation (optional)</b></div>

        <?php 
echo RForm::textarea(array('class' => 'form-control', 'rows' => '3', 'name' => 'invitation', 'placeholder' => 'Say something!'));
echo '<br/>';
echo RForm::input(array('class' => 'btn btn-lg btn-primary', 'type' => 'submit', 'value' => 'Invite Now'));
Exemplo n.º 8
0
        <?php 
echo RForm::label("Region", 'region');
echo RForm::input(array('id' => 'region', 'name' => 'region', 'class' => 'form-control', 'value' => $user->region, 'placeholder' => "region"));
echo RForm::label("Mobile", 'mobile');
echo RForm::input(array('id' => 'mobile', 'name' => 'mobile', 'class' => 'form-control', 'value' => $user->mobile, 'placeholder' => "Mobile"));
echo RForm::label("QQ", 'qq');
echo RForm::input(array('id' => 'qq', 'name' => 'qq', 'class' => 'form-control', 'value' => $user->qq, 'placeholder' => "QQ"));
echo RForm::label("Weibo", 'weibo');
echo RForm::input(array('id' => 'weibo', 'name' => 'weibo', 'class' => 'form-control', 'value' => $user->weibo, 'placeholder' => "Weibo"));
echo RForm::label("Homepage", 'homepage');
echo RForm::input(array('id' => 'homepage', 'name' => 'homepage', 'class' => 'form-control', 'value' => $user->homepage, 'placeholder' => "Homepage"));
echo RForm::label("Introduction", 'intro');
echo RForm::input(array('id' => 'intro', 'name' => 'intro', 'class' => 'form-control', 'value' => $user->intro, 'placeholder' => "your introduction"));
echo RForm::label("Picture");
echo '<br/>';
if ($user->picture) {
    $picture = RImage::styleSrc($user->picture, User::getPicOptions());
    echo RHtml::image($picture, $user->name, array("width" => '120px', 'class' => 'img-thumbnail'));
}
echo '<br/><br/>';
echo RForm::input(array('type' => 'file', 'name' => 'user_picture', 'accept' => 'image/gif, image/jpeg,image/png'));
echo "<br/>";
echo RForm::input(array('type' => 'submit', 'value' => 'Complete', 'class' => "btn btn-lg btn-primary"));
echo RForm::endForm();
?>
    </div>
</div>


Exemplo n.º 9
0
 /**
  * Method to get the field input markup for a media selector.
  * Use attributes to identify specific created_by and asset_id fields
  *
  * @return  string  The field input markup.
  *
  * @todo    Create a layout and put all the output HTML there!
  */
 protected function getInput()
 {
     $assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';
     $authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by';
     $asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id'];
     if ($asset == '') {
         $asset = JFactory::getApplication()->input->get('option');
     }
     $link = (string) $this->element['link'];
     $modalTitle = isset($this->element['modal_title']) ? JText::_($this->element['modal_title']) : JText::_('LIB_REDCORE_MEDIA_MANAGER');
     $modalId = 'modal-' . $this->id;
     if (!self::$initialised) {
         // Build the script.
         $script = array();
         $script[] = '	function jInsertFieldValue(value, id) {';
         $script[] = '		var old_value = document.id(id).value;';
         $script[] = '		if (old_value != value) {';
         $script[] = '			var elem = document.id(id);';
         $script[] = '			elem.value = value;';
         $script[] = '			elem.fireEvent("change");';
         $script[] = '			if (typeof(elem.onchange) === "function") {';
         $script[] = '				elem.onchange();';
         $script[] = '			}';
         $script[] = '			jMediaRefreshPreview(id);';
         $script[] = '		};';
         $script[] = '		jQuery("#' . $modalId . '").modal("hide");';
         $script[] = '	}';
         $script[] = '	function jMediaRefreshPreview(id) {';
         $script[] = '		var value = document.id(id).value;';
         $script[] = '		var img = document.id(id + "_preview");';
         $script[] = '		if (img) {';
         $script[] = '			if (value) {';
         $script[] = '				img.src = "' . JUri::root() . '" + value;';
         $script[] = '				document.id(id + "_preview_empty").setStyle("display", "none");';
         $script[] = '				document.id(id + "_preview_img").setStyle("display", "");';
         $script[] = '			} else { ';
         $script[] = '				img.src = ""';
         $script[] = '				document.id(id + "_preview_empty").setStyle("display", "");';
         $script[] = '				document.id(id + "_preview_img").setStyle("display", "none");';
         $script[] = '			} ';
         $script[] = '		} ';
         $script[] = '	}';
         $script[] = '	function jMediaRefreshPreviewTip(tip)';
         $script[] = '	{';
         $script[] = '		var img = tip.getElement("img.media-preview");';
         $script[] = '		tip.getElement("div.tip").setStyle("max-width", "none");';
         $script[] = '		var id = img.getProperty("id");';
         $script[] = '		id = id.substring(0, id.length - "_preview".length);';
         $script[] = '		jMediaRefreshPreview(id);';
         $script[] = '		tip.setStyle("display", "block");';
         $script[] = '	}';
         $script[] = '	function jSetIframeHeight(iframe)';
         $script[] = '	{';
         $script[] = '		var newheight;';
         $script[] = '		if(iframe) {';
         $script[] = '			newheight = iframe.contentWindow.document.body.scrollHeight;';
         $script[] = '			iframe.height= (newheight) + "px";';
         $script[] = '			iframe.setStyle("max-height", iframe.height);';
         $script[] = '		}';
         $script[] = '	}';
         $script[] = "\n\t\t\t\tfunction closeModal(fieldId)\n\t\t\t\t{\n\t\t\t\t\tjQuery('#modal-' + fieldId).modal('hide');\n\t\t\t\t}\n\t\t\t";
         // Add the script to the document head.
         JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
         self::$initialised = true;
     }
     $html = array();
     $attr = '';
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     // Initialize JavaScript field attributes.
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     // The text field.
     $html[] = '<div class="input-prepend input-append input-group">';
     // The Preview.
     $preview = (string) $this->element['preview'];
     $showPreview = true;
     $showAsTooltip = false;
     switch ($preview) {
         case 'no':
             // Deprecated parameter value
         // Deprecated parameter value
         case 'false':
         case 'none':
             $showPreview = false;
             break;
         case 'yes':
             // Deprecated parameter value
         // Deprecated parameter value
         case 'true':
         case 'show':
             break;
         case 'tooltip':
         default:
             $showAsTooltip = true;
             $options = array('onShow' => 'jMediaRefreshPreviewTip');
             JHtml::_('rbootstrap.tooltip', '.hasTipPreview', $options);
             break;
     }
     if ($showPreview) {
         if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
             $src = JUri::root() . $this->value;
         } else {
             $src = '';
         }
         $width = isset($this->element['preview_width']) ? (int) $this->element['preview_width'] : 300;
         $height = isset($this->element['preview_height']) ? (int) $this->element['preview_height'] : 200;
         $style = '';
         $style .= $width > 0 ? 'max-width:' . $width . 'px;' : '';
         $style .= $height > 0 ? 'max-height:' . $height . 'px;' : '';
         $imgattr = array('id' => $this->id . '_preview', 'class' => 'media-preview', 'style' => $style);
         $img = JHtml::image($src, JText::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr);
         $previewImg = '<div id="' . $this->id . '_preview_img"' . ($src ? '' : ' style="display:none"') . '>' . $img . '</div>';
         $previewImgEmpty = '<div id="' . $this->id . '_preview_empty"' . ($src ? ' style="display:none"' : '') . '>' . JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') . '</div>';
         if ($showAsTooltip) {
             $html[] = '<div class="media-preview add-on input-group-addon">';
             $tooltip = $previewImgEmpty . $previewImg;
             $options = array('title' => JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE'), 'text' => '<i class="icon-eye-open"></i>', 'class' => 'hasTipPreview');
             $html[] = RHtml::tooltip($tooltip, $options);
             $html[] = '</div>';
         } else {
             $html[] = '<div class="media-preview add-on input-group-addon" style="height:auto">';
             $html[] = ' ' . $previewImgEmpty;
             $html[] = ' ' . $previewImg;
             $html[] = '</div>';
         }
     }
     $html[] = '	<input type="text" class="input-small input-sm" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" readonly="readonly"' . $attr . ' />';
     $directory = (string) $this->element['directory'];
     if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
         $folder = explode('/', $this->value);
         $folder = array_diff_assoc($folder, explode('/', JComponentHelper::getParams('com_media')->get('image_path', 'images')));
         array_pop($folder);
         $folder = implode('/', $folder);
     } elseif (file_exists(JPATH_ROOT . '/' . JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $directory)) {
         $folder = $directory;
     } else {
         $folder = '';
     }
     $link = ($link ? $link : 'index.php?option=com_media&amp;view=images&amp;layout=modal&amp;tmpl=component&amp;asset=' . $asset . '&amp;author=' . $this->form->getValue($authorField)) . '&amp;fieldid=' . $this->id . '&amp;folder=' . $folder . '&amp;redcore=true';
     // Create the modal object
     $modal = RModal::getInstance(array('attribs' => array('id' => $modalId, 'class' => 'modal hide', 'style' => 'width: 820px; height: 500px; margin-left: -410px; top: 50%; margin-top: -250px;'), 'params' => array('showHeader' => true, 'showFooter' => false, 'showHeaderClose' => true, 'title' => $modalTitle, 'link' => $link, 'events' => array('onload' => 'jSetIframeHeight'))), $modalId);
     $html[] = RLayoutHelper::render('fields.rmedia', array('modal' => $modal, 'field' => $this));
     $html[] = '</div>';
     return implode("\n", $html);
 }
Exemplo n.º 10
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: Raysmond
 * Date: 13-10-16
 * Time: AM8:57
 * To change this template use File | Settings | File Templates.
 */
if (isset($validation_errors)) {
    RHtml::showValidationErrors($validation_errors);
}
$form = array();
if (isset($newForm)) {
    $form = $newForm;
}
echo RForm::openForm('category/new', array('id' => 'new-category-form', 'class' => 'new-category-form'));
echo '<h2>Create new category</h2>';
echo RForm::label("Category name", 'name');
echo RForm::input(array('id' => 'name', 'name' => 'name', 'class' => 'form-control', 'placeholder' => 'Category name'), $form);
echo '<br/>';
echo RForm::label("Category parent", 'parent');
echo RForm::input(array('id' => 'parent', 'name' => 'parent', 'class' => 'form-control', 'placeholder' => 'Category parent'), $form);
echo '<br/>';
echo RForm::input(array('type' => 'hidden', 'name' => 'id'), $form);
echo RForm::input(array('class' => 'btn btn-lg btn-primary btn-block', 'type' => 'submit', 'value' => 'Save'));
echo RForm::endForm();
Exemplo n.º 11
0
                setTimeout('ad_loop_display()',10000);
            }
        );

        //$('.Ad_List a').attr('target','_blank');

        $('.Ad_List a').click(
            function() {
                var element = $(this).parent();
                while ($(element).attr('class') != 'Ad_List') {
                    element = $(element).parent();
                }
                $.ajax({
                    type: 'POST',
                    url: '<?php 
echo RHtml::siteUrl('ads/hitAd');
?>
',
                    data: {'adId':$(element).attr('adid')}
                });
            }
        );

        function ad_loop_next(){
            ad_loop_show(current_ad + 1);
        }

        function ad_loop_prev(){
            ad_loop_show(current_ad - 1);
        }
Exemplo n.º 12
0
 * Bootstrap file.
 * Including this file into your application will make redCORE available to use.
 *
 * @package    Redcore
 * @copyright  Copyright (C) 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('JPATH_PLATFORM') or die;
define('JPATH_REDCORE', dirname(__FILE__));
require JPATH_REDCORE . '/functions.php';
// Use our own base field
if (!class_exists('JFormField', false)) {
    $baseField = JPATH_LIBRARIES . '/redcore/joomla/form/field.php';
    if (file_exists($baseField)) {
        require_once $baseField;
    }
}
// Register the classes for autoload.
JLoader::registerPrefix('R', JPATH_REDCORE);
// Setup the RLoader.
RLoader::setup();
// Make available the redCORE fields
JFormHelper::addFieldPath(JPATH_REDCORE . '/form/fields');
// Make available the redCORE form rules
JFormHelper::addRulePath(JPATH_REDCORE . '/form/rules');
// HTML helpers
JHtml::addIncludePath(JPATH_REDCORE . '/html');
RHtml::addIncludePath(JPATH_REDCORE . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_redcore', JPATH_SITE);
Exemplo n.º 13
0
                    </div>
                    <div>
                        <?php 
echo isset($pager) ? $pager : "";
?>
                    </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $(".message-list .message-item .message-body a").click(function () {
            var id = $(this).parents(".message-body").attr("messageId");
            if (id) {
                $.ajax({
                    url: "<?php 
echo RHtml::siteUrl("message/read");
?>
",
                    type: "post",
                    data: {messageId: id},
                    success: function (data) {
                        if (data == "success") {
                            // do some thing
                        }
                    }
                });
            }
            return true;
        });
    });
Exemplo n.º 14
0
echo RHtml::image('files/images/category/more.png', '', ['style' => 'width:24px;height:24px;']);
?>
&nbsp;
            更多...
        </a>
        <script>
            function packCategory() {
                $('#category-children-level-bar').slideToggle();
            }
        </script>
    </div>
    <div id="category-children-level-bar" style="display:none;">
        <?php 
foreach ($categories as $category) {
    $subCategory = $category->children();
    ?>
            <div class="category-children-container">
                <ul>
                <?php 
    foreach ($subCategory as $cat) {
        echo '<li>' . RHtml::linkAction('category', $cat->name, 'groups', $cat->id, ['class' => 'btn btn-sm children-category ' . (in_array($cat->id, $cid) ? 'active' : '')]) . '</li>';
    }
    ?>
                </ul>
            </div>
        <?php 
}
?>
    </div>
</div>
Exemplo n.º 15
0
        ?>
</td>
                <td><?php 
        echo RHtml::linkAction('user', $users[$count]->name, 'view', $users[$count]->id);
        ?>
</td>
                <td><?php 
        echo RHtml::decode($apply->content);
        ?>
</td>
                <td>
                    <?php 
        echo RHtml::linkAction('user', 'Accept', 'processVIP?censorId=' . $apply->id . '&op=0', [], ['class' => 'btn btn-xs btn-success']);
        ?>
                    <?php 
        echo RHtml::linkAction('user', 'Decline', 'processVIP?censorId=' . $apply->id . '&op=1', [], ['class' => 'btn btn-xs btn-danger']);
        ?>

                </td>
                <?php 
        echo '</tr>';
        ++$count;
    }
    ?>
            </tbody>
        </table>

        <?php 
    echo isset($pager) ? $pager : '';
    ?>
        <?php 
Exemplo n.º 16
0
 /**
  * Add javascript support for Bootstrap accordians and insert the accordian
  *
  * @param   string  $selector  The ID selector for the tooltip.
  * @param   array   $params    An array of options for the tooltip.
  *                             Options for the tooltip can be:
  *                             - parent  selector  If selector then all collapsible elements under the specified parent will be closed when this
  *                                                 collapsible item is shown. (similar to traditional accordion behavior)
  *                             - toggle  boolean   Toggles the collapsible element on invocation
  *                             - active  string    Sets the active slide during load
  *
  * @return  string  HTML for the accordian
  */
 public static function startAccordion($selector = 'myAccordian', $params = array())
 {
     $sig = md5(serialize(array($selector, $params)));
     if (!isset(static::$loaded[__METHOD__][$sig])) {
         // Include Bootstrap framework
         static::framework();
         // Setup options object
         $opt['parent'] = isset($params['parent']) && $params['parent'] ? (bool) $params['parent'] : false;
         $opt['toggle'] = isset($params['toggle']) && $params['toggle'] ? (bool) $params['toggle'] : true;
         $opt['active'] = isset($params['active']) && $params['active'] ? (string) $params['active'] : '';
         $options = RHtml::getJSObject($opt);
         // Attach accordion to document
         JFactory::getDocument()->addScriptDeclaration("(function(\$){\n\t\t\t\t\t\$('#{$selector}').collapse({$options});\n\t\t\t\t})(jQuery);");
         // Set static array
         static::$loaded[__METHOD__][$sig] = true;
         static::$loaded[__METHOD__]['active'] = $opt['active'];
     }
     return '<div id="' . $selector . '" class="accordion">';
 }
Exemplo n.º 17
0
                <th>View</th>
            </tr>
            </thead>
            <tbody>
            <?php 
foreach ($comments as $comment) {
    echo '<tr>';
    echo '<td>' . RForm::input(array('name' => 'checked_comments[]', 'type' => 'checkbox', 'value' => $comment->id)) . '</td>';
    echo '<td>' . RHtml::linkAction('user', $comment->user->name, 'view', $comment->user->id) . '</td>';
    echo '<td>' . $comment->createdTime . '</td>';
    if (mb_strlen($comment->content) > 140) {
        $comment->content = mb_substr($comment->content, 0, 140, 'UTF-8') . '...';
    }
    echo '<td>' . RHtml::linkAction('post', $comment->topic->title, 'view', $comment->topic->id) . '</td>';
    echo '<td>' . $comment->content . '</td>';
    echo '<td>' . RHtml::linkAction('post', 'View', 'view', $comment->topic->id . '#comment-item-' . $comment->id) . '</td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
echo isset($pager) ? $pager : "";
?>
    </div>
</div>
<?php 
echo RForm::endForm();
?>

Exemplo n.º 18
0
<div class="panel panel-default">
    <div class="panel-heading">Friends</div>
    <div class="panel-body">
        <?php 
echo '<div class="user-list">';
if (empty($friends)) {
    echo '<div>&nbsp;&nbsp;You don\'t have any friends yet!</div>';
}
foreach ($friends as $friend) {
    echo '<div class="user-item col-lg-4" style="overflow: hidden;height: 80px;">';
    $picture = isset($friend->picture) && $friend->picture != '' ? $friend->picture : User::$defaults['picture'];
    $picture = RImage::styleSrc($picture, User::getPicOptions());
    echo '<a href="' . RHtml::siteUrl('user/view/' . $friend->id) . '">' . RHtml::image($picture, $friend->name, array('width' => '58px', 'height' => '58px')) . '</a>';
    $name = $friend->name;
    if (mb_strlen($name) > 7) {
        $name = mb_substr($name, 0, 7) . "..";
    }
    echo RHtml::linkAction('user', $name, 'view', $friend->id, array('title' => $friend->name)) . "  ";
    echo '</div>';
}
//        if ($friNumber) {
//            echo '<div class="clearfix"></div>'.RHtml::linkAction('friend', 'Show all my '.$friNumber.' friends >>', 'myFriend', null, ['id' => 'list-all-friends']);
//        }
echo '</div>';
?>
    </div>
</div>
Exemplo n.º 19
0
 /**
  * View messages
  * @access authenticated user
  * @param string $msgType
  */
 public function actionView($msgType = 'unread')
 {
     $this->setHeaderTitle("My Messages");
     $userId = Rays::user()->id;
     $curPage = $this->getPage('page');
     $pageSize = $this->getPageSize("pagesize", 5);
     /* TODO: Maybe move these model-related things into Message model directly */
     $query = Message::find("receiverId", $userId);
     switch ($msgType) {
         case "all":
             $query = $query->where("[status] != ? ", array(Message::STATUS_TRASH));
             break;
         case "read":
             $query = $query->find("status", Message::STATUS_READ);
             break;
         case "unread":
             $query = $query->find("status", Message::STATUS_UNREAD);
             break;
         case "trash":
             $query = $query->find("status", Message::STATUS_TRASH);
             break;
         default:
             $this->page404();
             return;
     }
     $count = $query->count();
     $messages = $query->join('type')->order_desc("id")->range(($curPage - 1) * $pageSize, $pageSize);
     $data = array('msgs' => $messages, 'type' => $msgType, 'count' => $count);
     if ($count > $pageSize) {
         $url = RHtml::siteUrl('message/view/' . $msgType);
         $pager = new RPager('page', $count, $pageSize, $url, $curPage);
         $data['pager'] = $pager->showPager();
     }
     $this->render('view', $data, false);
 }
Exemplo n.º 20
0
echo RHtml::image("files/images/site/17.png", "", array('style' => "width: 100%;"));
?>
        单击右上角的edit(褐色标记部分),即可修改个人信息,上传照片等。你也可以申请成为VIP用户,成为VIP后,您将享受更多特权和优惠。

        </div>

        <div class="row" id="advertisement">
        <h2>Advertisement</h2>
        该条目将指引您在本网站上发布广告。
        注意!只有VIP用户才有资格申请发布广告。关于如何成为VIP用户,详见profile指引。
            <?php 
echo RHtml::image("files/images/site/18.png", "", array('style' => "width: 100%;"));
?>
        如上图所示,单击个人主页的“advertisement”条目,界面如上图所示。在这里,您可以发布诸如征友、销售、教育等广告信息,通过publish按钮提交,待管理员审核通过后,即可在屏幕右下方看到您的广告,如下图所示:
            <?php 
echo RHtml::image("files/images/site/19.png", "", array('style' => "width: 100%;"));
?>
        我们引入虚拟营收机制。用户发布的广告每被点击一次,用户获得1 Group Coin。用户账户中的Group Coins可以支付广告投放费用。广告的展示顺序与用户支付的Group Coin数量和投放时间有关,采用公式 支付金额 + 发布时间的Unix纪元/10000 计算。
        通过审核的广告将在所有用户的个人中心右下角展示。未通过审核的广告所支付费用不退回。请阅读本网站About Publish部分以便广告通过审核。

        </div>

        <div class="row" id="about-publish">
        <h2>About Publish</h2>
        依据相关法律规定,网站禁止传播以下内容:
        (一)反对宪法所确定的基本原则的;
        (二)危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;
        (三)损害国家荣誉和利益的;
        (四)煽动民族仇恨、民族歧视,破坏民族团结的;
        (五)破坏国家宗教政策,宣扬邪教和封建迷信的;
        (六)散布谣言,扰乱社会秩序,破坏社会稳定的;
Exemplo n.º 21
0
    ?>
            <a href="<?php 
    echo RHtml::siteUrl('message/view');
    ?>
"><span class="glyphicon glyphicon-envelope"></span> &nbsp; Messages</a>
            <?php 
    echo "</li>";
} else {
    echo '<li ' . ($isMessageUrl ? 'class="active"' : "") . '><a href="' . RHtml::siteUrl('message/view') . '">';
    echo '<span class="glyphicon glyphicon-envelope"></span> &nbsp; ';
    echo 'Messages <span class="badge">' . $count . '</span></a></li>';
}
if ($user->roleId == Role::VIP_ID) {
    ?>
            <li <?php 
    echo Rays::app()->request()->urlMatch(array('ads/view', 'ads/view/*'), $currentUrl) ? 'class="active"' : "";
    ?>
>
                <a href="<?php 
    echo RHtml::siteUrl('ads/view');
    ?>
">
                    <span class="glyphicon glyphicon-euro"></span> &nbsp;
                    Advertisement <span class="badge badge-vip">VIP</span>
                </a>
            </li>
        <?php 
}
?>
    </ul>
</div>
Exemplo n.º 22
0
 /**
  * Add javascript support for Bootstrap modals
  *
  * @param   string  $selector  The ID selector for the modal.
  * @param   array   $params    An array of options for the modal.
  *                             Options for the modal can be:
  *                             - backdrop  boolean  Includes a modal-backdrop element.
  *                             - keyboard  boolean  Closes the modal when escape key is pressed.
  *                             - show      boolean  Shows the modal when initialized.
  *                             - remote    string   An optional remote URL to load
  *
  * @return  void
  */
 public static function modal($selector = 'modal', $params = array())
 {
     $sig = md5(serialize(array($selector, $params)));
     if (!isset(static::$loaded[__METHOD__][$sig])) {
         // Include Bootstrap framework
         static::framework();
         // Setup options object
         $opt['backdrop'] = isset($params['backdrop']) && $params['backdrop'] ? (bool) $params['backdrop'] : true;
         $opt['keyboard'] = isset($params['keyboard']) && $params['keyboard'] ? (bool) $params['keyboard'] : true;
         $opt['show'] = isset($params['show']) && $params['show'] ? (bool) $params['show'] : true;
         $opt['remote'] = isset($params['remote']) && $params['remote'] ? $params['remote'] : '';
         $options = RHtml::getJSObject($opt);
         // Attach the modal to document
         JFactory::getDocument()->addScriptDeclaration("(function(\$){\n\t\t\t\t\t\$('#{$selector}').modal({$options});\n\t\t\t\t\t})(jQuery);");
         // Set static array
         static::$loaded[__METHOD__][$sig] = true;
     }
     return;
 }
Exemplo n.º 23
0
<?php

/**
 * "Add friends" request message content.
 * @author: Raysmond
 */
echo '<p>';
echo RHtml::linkAction('user', $user->name, 'view', $user->id);
echo ' wants to be your friends. <br/>';
echo '</p>';
echo '<p>';
echo RHtml::linkAction('friend', 'Confirm', 'confirm', $user->id, array('class' => 'btn btn-xs btn-success'));
echo '&nbsp;&nbsp;';
echo RHtml::linkAction('friend', 'Decline', 'decline', $user->id, array('class' => 'btn btn-xs btn-danger'));
echo '</p>';
Exemplo n.º 24
0
        <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation"> -->

            <?php 
// $self->module("new_users",array('id'=>'new_users','name'=>"New Users"));
?>

       <!-- </div>--><!--/span-->


    </div>

    <hr>

    <footer>
        <p><?php 
echo "© Copyright " . Rays::app()->getName() . " 2013, All Rights Reserved.";
?>
</p>
    </footer>

</div>
<!--/.container-->

<!-- Placed at the end of the document so the pages load faster -->
<?php 
// link custom script files
echo RHtml::linkScriptArray(Rays::app()->client()->script);
?>
</body>

</html>
Exemplo n.º 25
0
<?php

/**
 * @package     Redcore
 * @subpackage  Layout
 *
 * @copyright   Copyright (C) 2012 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later, see LICENSE.
 */
defined('JPATH_BASE') or die;
$data = $displayData;
$metatitle = RHtml::tooltipText(JText::_($data->tip ? $data->tip : $data->title), JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN'), 0);
JHtml::_('rbootstrap.tooltip');
?>
<a href="#"
	onclick="return false;"
	class="js-order-col hasTooltip"
	data-order="<?php 
echo $data->order;
?>
"
	data-direction="<?php 
echo strtoupper($data->direction);
?>
"
	data-name="<?php 
echo JText::_($data->title);
?>
"
	title="<?php 
echo $metatitle;
Exemplo n.º 26
0
 /**
  * Method to sort a column in a grid
  *
  * @param   string  $title          The link title
  * @param   string  $order          The order field for the column
  * @param   string  $direction      The current direction
  * @param   mixed   $selected       The selected ordering
  * @param   string  $task           An optional task override
  * @param   string  $new_direction  An optional direction for the new column
  * @param   string  $tip            An optional text shown as tooltip title instead of $title
  * @param   string  $icon           Icon to show
  *
  * @return  string
  *
  * @deprecated  1.1  Use the function self::sort() that already supports icons and uses layouts
  */
 public static function sorto($title, $order, $direction = 'asc', $selected = 0, $task = null, $new_direction = 'asc', $tip = '', $icon = null)
 {
     JHtml::_('rbootstrap.tooltip');
     static::main();
     $direction = strtolower($direction);
     $icon = array('chevron-up', 'chevron-down');
     $index = (int) ($direction == 'desc');
     if ($order != $selected) {
         $direction = $new_direction;
     } else {
         $direction = $direction == 'desc' ? 'asc' : 'desc';
     }
     $html = '<a href="#" onclick="Joomla.tableOrdering(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\');return false;"' . ' class="hasTooltip" title="' . RHtml::tooltipText(JText::_($tip ? $tip : $title), JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN'), 0) . '">';
     $html .= '<i class="icon-sort"></i>';
     if ($order == $selected) {
         $html .= ' <i class="icon-' . $icon[$index] . '"></i>';
     }
     $html .= '</a>';
     return $html;
 }
Exemplo n.º 27
0
                                        var height = $("#load-more-groups").position().top;
                                        var curHeight = $(window).scrollTop() + $(window).height();
                                        if(!isLoading&&curHeight>=height && !nomore){
                                            loadMoreGroups();
                                        }
                                    });
                                });


                                function loadMoreGroups(){
                                    isLoading = true;
                                    $('#loading-groups').show(0);
                                    //$('#load-more-groups').hide(0);
                                    $.ajax({
                                        url: "<?php 
                echo RHtml::siteUrl('user/view/' . $user->id);
                ?>
",
                                        type: "post",
                                        data:{page: ++curPage},
                                        success: function(data){
                                            $('#loading-groups').hide(0);
                                            //$('#load-more-groups').show(0);
                                            if (data == 'nomore') {
                                                nomore = true;
                                                $('#loading-groups').hide(0);
                                                //$('#load-more-groups').hide(0);
                                                return;
                                            }
                                            var $blocks = jQuery(data).filter('div.item');
                                            $("#waterfall-groups").append($blocks);
Exemplo n.º 28
0
<div id="category-bar" class="row posts-category-wrapper">

    <ul class="posts-category">
        <?php 
foreach ($categories as $category) {
    ?>
            <li>
                <a class="btn btn-sx parent-category <?php 
    echo $category->id == $id ? "active" : "";
    ?>
" href="<?php 
    echo RHtml::siteUrl('post/find/' . $category->id);
    ?>
">
                    <?php 
    echo RHtml::image('files/images/category/' . $category->id . '.png', '', ['style' => 'width:24px;height:24px;']);
    ?>
                    &nbsp;
                    <?php 
    echo $category->name;
    ?>
                </a>
            </li>
        <?php 
}
?>
    </ul>

</div>
Exemplo n.º 29
0
<?php

if ($show) {
    ?>
    <textarea id="<?php 
    echo $id;
    ?>
" name="<?php 
    echo $id;
    ?>
" <?php 
    echo RHtml::parseAttributes($attributes);
    ?>
 >
    <?php 
    echo RHtml::decode($data);
    ?>
    </textarea>

    <?php 
    if (!isset($customInitialJs)) {
        ?>
    <script>
        $(document).ready(function() {
            //var editor = CKEDITOR.replace( "<?php 
        echo $id;
        ?>
" );
            var path = "<?php 
        echo $path;
        ?>
Exemplo n.º 30
0
 /**
  * Effectively bootstrap redCORE.
  *
  * @param   bool  $loadBootstrap  Load bootstrap with redcore plugin options
  *
  * @return  void
  */
 public static function bootstrap($loadBootstrap = true)
 {
     if ($loadBootstrap && !defined('REDCORE_BOOTSTRAPPED')) {
         define('REDCORE_BOOTSTRAPPED', 1);
     }
     if (!defined('REDCORE_LIBRARY_LOADED')) {
         // Sets bootstrapped variable, to avoid bootstrapping redCORE twice
         define('REDCORE_LIBRARY_LOADED', 1);
         // Use our own base field
         if (!class_exists('JFormField', false)) {
             $baseField = JPATH_LIBRARIES . '/redcore/joomla/form/field.php';
             if (file_exists($baseField)) {
                 require_once $baseField;
             }
         }
         // Register the classes for autoload.
         JLoader::registerPrefix('R', JPATH_REDCORE);
         // Setup the RLoader.
         RLoader::setup();
         // Make available the redCORE fields
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/field');
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/fields');
         // Make available the redCORE form rules
         JFormHelper::addRulePath(JPATH_REDCORE . '/form/rules');
         // HTML helpers
         JHtml::addIncludePath(JPATH_REDCORE . '/html');
         RHtml::addIncludePath(JPATH_REDCORE . '/html');
         // Load library language
         $lang = JFactory::getLanguage();
         $lang->load('lib_redcore', JPATH_REDCORE);
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
         }
         // Make available the fields
         JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields');
         // Make available the rules
         JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules');
         // Replaces Joomla database driver for redCORE database driver
         JFactory::$database = null;
         JFactory::$database = RFactory::getDbo();
         if (self::getConfig('enable_translations', 0) == 1 && !JFactory::getApplication()->isAdmin()) {
             // This is our object now
             $db = JFactory::getDbo();
             // Enable translations
             $db->translate = self::getConfig('enable_translations', 0) == 1;
             // Reset plugin translations params if needed
             RTranslationHelper::resetPluginTranslation();
         }
     }
 }