Skip to content

Commit

Permalink
Merge pull request #1390 from voltan/develop
Browse files Browse the repository at this point in the history
Improve core modules
  • Loading branch information
taiwen committed Jan 4, 2016
2 parents a2cf08b + 10e0b82 commit a4a4e3a
Show file tree
Hide file tree
Showing 120 changed files with 5,302 additions and 2,861 deletions.
2 changes: 1 addition & 1 deletion lib/Pi/Application/Service/SocialSharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function buildItem($item, $title, $url, $image)
if ($item) {
$item['url'] = str_replace(
array('%title%', '%url%', '%image%'),
array($title, $url, $image),
array($title . ' ', $url, $image),
$item['url']
);
}
Expand Down
62 changes: 51 additions & 11 deletions lib/Pi/View/Helper/ThemeAssemble.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,60 @@ public function renderStrategy($module)
{
$headTitle = $this->view->headTitle();
$separator = $headTitle->getSeparator();

// Set postfix
$postfix = $headTitle->getPostfix();
if (!$postfix) {
$postfix = Pi::config('sitename');
if ($headTitle->count()) {
if ($module && 'system' != $module) {
$moduleMeta = Pi::registry('module')->read($module);
$postfix = $moduleMeta['title'] . $separator . $postfix;
$prefix = $headTitle->getPrefix();
$type = Pi::config('title_type');

// Set prefix or postfix
switch ($type) {
case 1:
if (!$postfix) {
$postfix = Pi::config('sitename');
if ($headTitle->count()) {
if ($module && 'system' != $module) {
$moduleMeta = Pi::registry('module')->read($module);
$postfix = $moduleMeta['title'] . $separator . $postfix;
}
}
$postfix = $separator . $postfix;
$headTitle->setPostfix($postfix);
}
}
$postfix = $separator . $postfix;
$headTitle->setPostfix($postfix);
break;

case 2:
if (!$postfix) {
$postfix = Pi::config('sitename');
$postfix = $separator . $postfix;
$headTitle->setPostfix($postfix);
}
break;

case 3:
if (!$prefix) {
$prefix = Pi::config('sitename');
if ($headTitle->count()) {
if ($module && 'system' != $module) {
$moduleMeta = Pi::registry('module')->read($module);
$prefix = $prefix . $separator . $moduleMeta['title'];
}
}
$prefix = $prefix . $separator;
$headTitle->setPrefix($prefix);
}
break;

case 4:
if (!$prefix) {
$prefix = Pi::config('sitename');
$prefix = $prefix . $separator;
$headTitle->setPrefix($prefix);
}
break;

case 5:
break;
}

// Set head title
if (!$headTitle->count()) {
$headTitleStr = Pi::config('head_title', $module);
Expand Down
4 changes: 4 additions & 0 deletions usr/custom/module/user/config/form.register.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ return array(
),
'attributes' => array(
'type' => 'password',
'required' => true,
),
),

Expand Down Expand Up @@ -61,6 +62,9 @@ return array(
'separator' => '<br />',
'captcha_position' => 'append',
),
'attributes' => array(
'required' => true,
),
),
),

Expand Down
38 changes: 19 additions & 19 deletions usr/module/message/asset/script/front.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/* Message */
.message-item {
padding: 12px 20px 18px 15px;
padding-left: 12px\9;
padding-left: 12px \9;
margin-top: 0;
cursor: pointer;
}
Expand All @@ -30,7 +30,7 @@
}

.message-detail-primary:hover .message-hidden,
.message-item:hover .message-hidden{
.message-item:hover .message-hidden {
display: block;
}

Expand All @@ -53,7 +53,7 @@
}

.message-media-left {
padding-right: 5px;
padding-right: 5px;
}

.message-detail img,
Expand All @@ -64,18 +64,18 @@

.message-media-left img {
margin: 3px 0 0 15px;
margin-left: 12px\9;
margin-left: 12px \9;
}

.message-head span {
color: #999;
}

.message-head a{
.message-head a {
color: #000;
}

.message-head a:hover{
.message-head a:hover {
color: #005580;
}

Expand All @@ -93,15 +93,15 @@
.message-content p a {
color: #888;
text-decoration: none;
}
}

.message-foot-form {
margin: 15px 0 0 15px;
margin-left: 12px\9;
margin: 15px 0 0 15px;
margin-left: 12px \9;
}

.message-pagination {
margin-top: 15px;
margin-top: 15px;
}

.message-hidden span {
Expand Down Expand Up @@ -148,7 +148,7 @@
border-bottom: 1px solid #e5e5e5;
}

.message-detail-head,.message-detail-primary {
.message-detail-head, .message-detail-primary {
padding: 0 20px 0 15px;
}

Expand Down Expand Up @@ -190,11 +190,11 @@
}

.message-form-posi span {
margin:5px 15px 0 0;
margin: 5px 15px 0 0;
}

.message-input-right {
margin-left: 90px!important;
margin-left: 90px !important;
}

.message-input-posi span {
Expand All @@ -212,13 +212,13 @@
.message-btn-margin {
position: absolute;
left: 520px;
top:195px;
top: 172px\9;
top: 195px;
top: 172px \9;
}

@-moz-document url-prefix(){
@-moz-document url-prefix() {
.message-btn-margin {
top:210px;
top: 210px;
}
.message-send-text span {
top: 215px;
Expand All @@ -245,8 +245,8 @@
}

.message-username {
border: 1px #b94a48 solid!important;
box-shadow: 0 0 6px #D59392!important;
border: 1px #b94a48 solid !important;
box-shadow: 0 0 6px #D59392 !important;
}

.message-error {
Expand Down
22 changes: 11 additions & 11 deletions usr/module/message/asset/script/index-detail.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
(function($) {
(function ($) {
var options;
var app = {
init: function() {
init: function () {
this.cacheElements();
this.bindEvents();
},
$: function(selector) {
$: function (selector) {
return this.$el.find(selector);
},
cacheElements: function() {
cacheElements: function () {
this.$el = $('#message-js');
this.$form = this.$('form');
this.$content = this.$("[name='content']");
this.$delete = this.$('a[data-confirm]');
},
bindEvents: function() {
bindEvents: function () {
this.$form.submit(this.submitAction);
this.$content.focus(this.conFocus);
this.$delete.click(this.deleteAction);
},
submitAction: function() {
submitAction: function () {
var self = $('[name="content"]'),
val = self.val();
app.$form.find('span').remove();
Expand All @@ -28,22 +28,22 @@
app.$form.find('span').addClass('pull-right message-error').html('You can’t send a empty message');
self.addClass('message-username');
return false;
}
}
},
conFocus: function() {
conFocus: function () {
$(this).removeClass('message-username');
app.$form.find('span').empty();
},
deleteAction: function() {
deleteAction: function () {
var href = app.$delete.attr('href');
$('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm'));
$('.confirm-ok').attr('href', href);
$('#confirm-modal').modal({show:true});
$('#confirm-modal').modal({show: true});
return false;
},
};

this.messageIndex = function(opts) {
this.messageIndex = function (opts) {
options = opts || {};
app.init();
};
Expand Down
Loading

0 comments on commit a4a4e3a

Please sign in to comment.