*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ACTIONS.php,v 1.5 2007-02-26 23:42:01 kmorimatsu Exp $
- * @version $NucleusJP: ACTIONS.php,v 1.4 2007/02/04 06:28:45 kimitake Exp $
+ * @version $Id: ACTIONS.php,v 1.6 2007-03-13 05:17:37 shizuki Exp $
+ * @version $NucleusJP: ACTIONS.php,v 1.5 2007/02/26 23:42:01 kmorimatsu Exp $
*/
class ACTIONS extends BaseActions {
// reference to the skin object for which a part is being parsed
var $skin;
-
// used when including templated forms from the include/ dir. The $formdata var
// contains the values to fill out in there (assoc array name -> value)
var $formdata;
-
// filled out with the number of displayed items after calling one of the
-
// (other)blog/(other)searchresults skinvars.
-
var $amountfound;
+ /**
+ * Constructor for a new ACTIONS object
+ */
function ACTIONS($type) {
// call constructor of superclass first
$this->BaseActions();
$this->linkparams = array('catid' => $catid);
}
+ /**
+ * Set the skin
+ */
function setSkin(&$skin) {
$this->skin =& $skin;
}
+ /**
+ * Set the parser
+ */
function setParser(&$parser) {
$this->parser =& $parser;
}
* @param string $value value of property
*/
function checkCondition($field, $name='', $value = '') {
- global $catid, $blog, $member, $itemidnext, $itemidprev, $manager;
+ global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;
$condition = 0;
switch($field) {
case 'previtem':
$condition = ($itemidprev != '');
break;
+ case 'archiveprevexists':
+ $condition = ($archiveprevexists == true);
+ break;
+ case 'archivenextexists':
+ $condition = ($archivenextexists == true);
+ break;
case 'skintype':
$condition = ($name == $this->skintype);
break;
return $condition;
}
+ /**
+ * Checks if a plugin exists and call its doIf function
+ */
function _ifPlugin($name, $key = '', $value = '') {
global $manager;
return call_user_func_array(array(&$plugin, 'doIf'), $params);
}
+ /**
+ * Different checks for a category
+ */
function _ifCategory($name = '', $value='') {
global $blog, $catid;
return false;
}
+ /**
+ * Checks if a member is on the team of a blog and return his rights
+ */
function _ifOnTeam($blogName = '') {
global $blog, $member, $manager;
return $member->teamRights($blogid);
}
+ /**
+ * Checks if a member is admin of a blog
+ */
function _ifAdmin($blogName = '') {
global $blog, $member, $manager;
echo $this->_link($url, $linktext);
}
+ /**
+ * Creates an item link and if no id is given a todaylink
+ */
function _itemlink($id, $linktext = '') {
global $CONF;
if ($id)
else
$this->parse_todaylink($linktext);
}
-
+
+ /**
+ * Creates an archive link and if no id is given a todaylink
+ */
function _archivelink($id, $linktext = '') {
global $CONF, $blog;
if ($id)
else
$this->parse_todaylink($linktext);
}
-
+
/**
* Helper function that sets the category that a blog will need to use
*
else
$blog->setSelectedCategory($catid);
}
-
+
+ /**
+ * Notifies the Manager that a PreBlogContent event occurs
+ */
function _preBlogContent($type, &$blog) {
global $manager;
$manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));
}
+ /**
+ * Notifies the Manager that a PostBlogContent event occurs
+ */
function _postBlogContent($type, &$blog) {
global $manager;
$manager->notify('PostBlogContent',array('blog' => &$blog, 'type' => $type));
}
-
+
/**
* Parse skinvar additemform
*/
$blog->InsertJavaScriptInfo();
$this->doForm('additemform');
}
-
+
/**
* Parse skinvar adminurl
* (shortcut for admin url)
echo strftime($format,mktime(0,0,0,$m,$d?$d:1,$y));
}
+ /**
+ * Parse skinvar archivedaylist
+ */
function parse_archivedaylist($template, $category = 'all', $limit = 0) {
global $blog;
if ($category == 'all') $category = '';
$this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);
$this->_postBlogContent('blog',$blog);
}
-
+
/*
* Parse skinvar bloglist
* Shows a list of all blogs
function parse_bloglist($template, $bnametype = '') {
BLOG::showBlogList($template, $bnametype);
}
-
+
/**
* Parse skinvar blogsetting
*/
break;
}
}
-
+
/**
* Parse callback
*/
global $manager;
$manager->notify($eventName, array('type' => $type));
}
-
+
/**
* Parse skinvar category
*/
break;
}
}
-
+
/**
* Parse categorylist
*/
$this->_postBlogContent('categorylist',$b);
}
}
-
+
/**
* Parse skinvar charset
*/
function parse_charset() {
echo _CHARSET;
}
-
+
/**
* Parse skinvar commentform
*/
$this->doForm('commentform-loggedin');
}
}
-
+
/**
* Parse skinvar comments
* include comments for one item
if ($errormessage)
echo '<div class="error">', htmlspecialchars($errormessage),'</div>';
}
-
+
/**
* Parse skinvar errormessage
*/
global $errormessage;
echo $errormessage;
}
-
+
/**
* Parse formdata
*/
function parse_formdata($what) {
echo $this->formdata[$what];
}
-
+
/**
* Parse ifcat
*/
break;
}
}
-
+
/**
* Parse skinvar imagetext
*/
global $itemid;
echo $itemid;
}
-
+
/**
* Parse skinvar itemlink
*/
/**
* Parse skinvar member
- * (includes a member info thingie)
+ * (includes a member info thingie)
*/
function parse_member($what) {
global $memberinfo, $member;
break;
case 'id':
echo htmlspecialchars($memberinfo->getID());
- break;
+ break;
}
}
}
}
-
+
/**
* Parse skinvar nextarchive
*/
/**
* Parse skinvar nextitemtitle
* (include itemtitle of next item)
- */
+ */
function parse_nextitemtitle($format = '') {
global $itemtitlenext;
);
$this->doForm('nucleusbutton');
}
-
+
+ /**
+ * Parse skinvar otherarchive
+ */
function parse_otherarchive($blogname, $template, $category = '') {
global $archive, $manager;
sscanf($archive,'%d-%d-%d',$y,$m,$d);
$b->showArchive($template, $y, $m, $d);
$this->_postBlogContent('otherachive',$b);
}
-
+
/**
* Parse skinvar otherarchivedaylist
*/
$b->showArchiveList($template, 'day', $limit);
$this->_postBlogContent('otherarchivelist',$b);
}
-
+
/**
* Parse skinvar otherarchivelist
*/
$b->showArchiveList($template, 'month', $limit);
$this->_postBlogContent('otherarchivelist',$b);
}
-
+
/**
* Parse skinvar otherblog
*/
call_user_func_array(array(&$plugin,'doSkinVar'), $params);
}
-
+
/**
* Parse skinvar prevarchive
*/
global $query;
echo htmlspecialchars($query);
}
-
+
/**
* Parse skinvar referer
*/
}
/**
+ * Parse skintype (experimental)
+ */
+ function parse_skintype() {
+ echo $this->skintype;
+ }
+
+ /**
* Parse text
*/
function parse_text($which) {
eval("echo $which;");
}
}
-
+
/**
* Parse ticket
*/
}
}
-?>
+?>
\ No newline at end of file