<commit_before><?php 
/**
 * @version $Id$
 * @package Abricos
 * @subpackage Botask
 * @copyright Copyright (C) 2008 Abricos. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @author <NAME> (<EMAIL>)
 */

$mod = new BotaskModule();
CMSRegistry::$instance->modules->Register($mod);;

class BotaskModule extends CMSModule {
	
	public function __construct(){
		$this->version = "0.1";
		$this->name = "botask";
		$this->permission = new BotaskPermission($this);
	}
	
	/**
	 * Получить менеджер
	 *
	 * @return BotaskManager
	 */
	public function GetManager(){
		if (is_null($this->_manager)){
			require_once 'includes/manager.php';
			$this->_manager = new BotaskManager($this);
		}
		return $this->_manager;
	}
	
	public function UProfile_UserFriendList(){
		return $this->GetManager()->UProfile_UserFriendList();
	}
	
}

/**
 * Статус задачи
 */
class BotaskStatus {
	
	/**
	 * Открытая задача
	 * @var integer
	 */
	const TASK_OPEN = 1;

	/**
	 * Открытая задача повторно
	 * @var integer
	 */
	const TASK_REOPEN = 2;
	
	/**
	 * Завершенная (закрытая) задача
	 * @var integer
	 */
	const TASK_CLOSE = 3;
	
	/**
	 * Задача в работе. Принятая самостоятельно.
	 * @var integer
	 */
	const TASK_ACCEPT = 4;

	/**
	 * Задача в работе. Назначенная конкретному лицу.
	 * @var integer
	 */
	const TASK_ASSIGN = 5;
	
	/**
	 * Задача удалена.
	 * @var integer
	 */
	const TASK_REMOVE = 6;

	/**
	 * Задача в архиве.
	 * @var integer
	 */
	const TASK_ARHIVE = 7;
}

class BotaskAction {
	const VIEW	= 10;
	const WRITE	= 30;
	const ADMIN	= 50;
}

class BotaskPermission extends AbricosPermission {
	
	public function BotaskPermission(BotaskModule $module){
		
		$defRoles = array(
			new AbricosRole(BotaskAction::VIEW, UserGroup::REGISTERED),
			new AbricosRole(BotaskAction::VIEW, UserGroup::ADMIN),
			
			new AbricosRole(BotaskAction::WRITE, UserGroup::REGISTERED),
			new AbricosRole(BotaskAction::WRITE, UserGroup::ADMIN),
			
			new AbricosRole(BotaskAction::WRITE, UserGroup::ADMIN),
			new AbricosRole(BotaskAction::ADMIN, UserGroup::ADMIN),
		);
		parent::__construct($module, $defRoles);
	}
	
	public function GetRoles(){
		return array(
			BotaskAction::VIEW => $this->CheckAction(BotaskAction::VIEW),
			BotaskAction::WRITE => $this->CheckAction(BotaskAction::WRITE),
			BotaskAction::ADMIN => $this->CheckAction(BotaskAction::ADMIN)
		);
	}
}
?><commit_msg>Доска задач: вызов класса после объявления (php 5.3)<commit_after><?php 
/**
 * @version $Id$
 * @package Abricos
 * @subpackage Botask
 * @copyright Copyright (C) 2008 Abricos. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * @author <NAME> (<EMAIL>)
 */

class BotaskModule extends CMSModule {
	
	public function __construct(){
		$this->version = "0.1";
		$this->name = "botask";
		$this->permission = new BotaskPermission($this);
	}
	
	/**
	 * Получить менеджер
	 *
	 * @return BotaskManager
	 */
	public function GetManager(){
		if (is_null($this->_manager)){
			require_once 'includes/manager.php';
			$this->_manager = new BotaskManager($this);
		}
		return $this->_manager;
	}
	
	public function UProfile_UserFriendList(){
		return $this->GetManager()->UProfile_UserFriendList();
	}
	
}

/**
 * Статус задачи
 */
class BotaskStatus {
	
	/**
	 * Открытая задача
	 * @var integer
	 */
	const TASK_OPEN = 1;

	/**
	 * Открытая задача повторно
	 * @var integer
	 */
	const TASK_REOPEN = 2;
	
	/**
	 * Завершенная (закрытая) задача
	 * @var integer
	 */
	const TASK_CLOSE = 3;
	
	/**
	 * Задача в работе. Принятая самостоятельно.
	 * @var integer
	 */
	const TASK_ACCEPT = 4;

	/**
	 * Задача в работе. Назначенная конкретному лицу.
	 * @var integer
	 */
	const TASK_ASSIGN = 5;
	
	/**
	 * Задача удалена.
	 * @var integer
	 */
	const TASK_REMOVE = 6;

	/**
	 * Задача в архиве.
	 * @var integer
	 */
	const TASK_ARHIVE = 7;
}

class BotaskAction {
	const VIEW	= 10;
	const WRITE	= 30;
	const ADMIN	= 50;
}

class BotaskPermission extends AbricosPermission {
	
	public function BotaskPermission(BotaskModule $module){
		
		$defRoles = array(
			new AbricosRole(BotaskAction::VIEW, UserGroup::REGISTERED),
			new AbricosRole(BotaskAction::VIEW, UserGroup::ADMIN),
			
			new AbricosRole(BotaskAction::WRITE, UserGroup::REGISTERED),
			new AbricosRole(BotaskAction::WRITE, UserGroup::ADMIN),
			
			new AbricosRole(BotaskAction::WRITE, UserGroup::ADMIN),
			new AbricosRole(BotaskAction::ADMIN, UserGroup::ADMIN),
		);
		parent::__construct($module, $defRoles);
	}
	
	public function GetRoles(){
		return array(
			BotaskAction::VIEW => $this->CheckAction(BotaskAction::VIEW),
			BotaskAction::WRITE => $this->CheckAction(BotaskAction::WRITE),
			BotaskAction::ADMIN => $this->CheckAction(BotaskAction::ADMIN)
		);
	}
}

$mod = new BotaskModule();
CMSRegistry::$instance->modules->Register($mod);;

?>
{'fraction_non_alphanumeric': 0.1448559670781893, 'fraction_numerical': 0.00823045267489712, 'mean_word_length': 3.8805220883534135, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3332630', 'n_tokens_mistral': 1940, 'n_tokens_neox': 1795, 'n_words': 361}