-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master commit 'ac528e6a2300b092ad285339bf0c002b030c3be2' into f…
…ramework
- Loading branch information
Showing
28 changed files
with
849 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/*------------------------------------------------------- | ||
* | ||
* LiveStreet Engine Social Networking | ||
* Copyright © 2008 Mzhelskiy Maxim | ||
* | ||
*-------------------------------------------------------- | ||
* | ||
* Official site: www.livestreet.ru | ||
* Contact e-mail: rus.engine@gmail.com | ||
* | ||
* GNU General Public License, version 2: | ||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
* | ||
--------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Модуль Tools - различные вспомогательные методы | ||
* | ||
* @package modules.tools | ||
* @since 1.0 | ||
*/ | ||
class ModuleTools extends Module { | ||
/** | ||
* Инициализация | ||
* | ||
*/ | ||
public function Init() { | ||
|
||
} | ||
|
||
/** | ||
* Строит логарифмическое облако - расчитывает значение size в зависимости от count | ||
* У объектов в коллекции обязательно должны быть методы getCount() и setSize() | ||
* | ||
* @param aray $aCollection Список тегов | ||
* @param int $iMinSize Минимальный размер | ||
* @param int $iMaxSize Максимальный размер | ||
* @return array | ||
*/ | ||
public function MakeCloud($aCollection,$iMinSize=1,$iMaxSize=10) { | ||
if (count($aCollection)) { | ||
$iSizeRange=$iMaxSize-$iMinSize; | ||
|
||
$iMin=10000; | ||
$iMax=0; | ||
foreach($aCollection as $oObject) { | ||
if ($iMax<$oObject->getCount()) { | ||
$iMax=$oObject->getCount(); | ||
} | ||
if ($iMin>$oObject->getCount()) { | ||
$iMin=$oObject->getCount(); | ||
} | ||
} | ||
$iMinCount=log($iMin+1); | ||
$iMaxCount=log($iMax+1); | ||
$iCountRange=$iMaxCount-$iMinCount; | ||
if ($iCountRange==0) { | ||
$iCountRange=1; | ||
} | ||
foreach($aCollection as $oObject) { | ||
$iTagSize=$iMinSize+(log($oObject->getCount()+1)-$iMinCount)*($iSizeRange/$iCountRange); | ||
$oObject->setSize(round($iTagSize)); | ||
} | ||
} | ||
return $aCollection; | ||
} | ||
|
||
/** | ||
* Преобразует спец символы в html последовательнось, поведение аналогично htmlspecialchars, кроме преобразования амперсанта "&" | ||
* | ||
* @param string $sText | ||
* | ||
* @return string | ||
*/ | ||
public function Urlspecialchars($sText) { | ||
$aTable=get_html_translation_table(); | ||
unset($aTable['&']); | ||
return strtr($sText,$aTable); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Options -Indexes | ||
<Files ~ "\.tpl$"> | ||
<Files ~ "(\.tpl)|(\.php)$"> | ||
Order allow,deny | ||
Deny from all | ||
</Files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Buttons | ||
*/ | ||
|
||
.button { | ||
display: inline-block; | ||
|
||
padding: 4px 12px; | ||
margin: 0; | ||
|
||
text-align: center; | ||
vertical-align: middle; | ||
text-decoration: none; | ||
|
||
font-size: 14px; | ||
line-height: 20px; | ||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); | ||
|
||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
|
||
color: #333; | ||
|
||
background: #fafafa; | ||
background: -moz-linear-gradient(top, #fff 0%, #e6e6e6 100%); | ||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fff), color-stop(100%,#e6e6e6)); | ||
background: -webkit-linear-gradient(top, #fff 0%,#e6e6e6 100%); | ||
background: -o-linear-gradient(top, #fff 0%,#e6e6e6 100%); | ||
background: -ms-linear-gradient(top, #fff 0%,#e6e6e6 100%); | ||
background: linear-gradient(top, #fff 0%,#e6e6e6 100%); | ||
|
||
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); | ||
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); | ||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); | ||
|
||
cursor: pointer; | ||
|
||
*margin-right: 5px; | ||
*border: 0; | ||
} | ||
.button:hover { text-decoration: none; background: #eee; } | ||
.button:active, | ||
.button.active { | ||
background: #eaeaea; | ||
border-color: #ccc; | ||
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .2) inset; | ||
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, .2) inset; | ||
box-shadow: 0 0 5px rgba(0, 0, 0, .2) inset; | ||
} | ||
.button.fl-r { *margin-right: 0; } | ||
|
||
|
||
/* Button Primary */ | ||
.button.button-primary { | ||
color: #fff; | ||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); | ||
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); | ||
|
||
background: #006DCC; | ||
background: -moz-linear-gradient(top, #0088cc 0%, #0044cc 100%); | ||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0088cc), color-stop(100%,#0044cc)); | ||
background: -webkit-linear-gradient(top, #0088cc 0%,#0044cc 100%); | ||
background: -o-linear-gradient(top, #0088cc 0%,#0044cc 100%); | ||
background: -ms-linear-gradient(top, #0088cc 0%,#0044cc 100%); | ||
background: linear-gradient(top, #0088cc 0%,#0044cc 100%); | ||
} | ||
.button.button-primary:hover { background: #0044cc; } | ||
.button.button-primary.active { background: #006DCC; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Dropdowns | ||
* | ||
* TODO: Add submenu | ||
* TODO: Add arrow support in IE7 | ||
*/ | ||
|
||
|
||
/* Base class */ | ||
.dropdown { | ||
display: inline-block; | ||
*display: inline; *zoom: 1; /* IE7 */ | ||
background: #2891d3; | ||
color: #fff; | ||
border-radius: 2px; | ||
padding: 5px 12px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
|
||
/* Dropdown toggle */ | ||
.dropdown-toggle { | ||
padding-right: 25px !important; | ||
position: relative; | ||
*zoom: 1; | ||
cursor: pointer; | ||
} | ||
.dropdown-toggle:after { | ||
content: ""; | ||
position: absolute; | ||
top: 50%; right: 9px; | ||
height: 0; width: 0; | ||
margin-top: -1px; | ||
border: 4px solid transparent; /* IE7 */ | ||
border: 4px solid rgba(255,255,255,0); | ||
border-top-color: #fff; | ||
} | ||
.dropdown-toggle.open { background: #0088cc; color: #fff; } | ||
.dropdown-toggle.open:after { border-top-color: #fff; } | ||
|
||
|
||
/* Dropdown menu */ | ||
.dropdown-menu { | ||
position: absolute; | ||
top: 0; left: 0; | ||
z-index: 900; | ||
display: none; | ||
min-width: 150px; | ||
padding: 5px 0; | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
border-radius: 6px; | ||
box-shadow: 0 5px 10px rgba(0,0,0,.2); | ||
} | ||
.dropdown-menu li > a { display: block; padding: 5px 12px; white-space: nowrap; } | ||
.dropdown-menu > li.active > a { background: #c8ecff; color: #48a4d5; } | ||
.dropdown-menu > li > a:hover { background: #0088cc; color: #fff; } | ||
|
||
.dropdown-menu > li.divider { height: 0; border-top: 1px solid #e1e1e1; margin: 5px 0; } |
Oops, something went wrong.