本文整理汇总了PHP中Tags::getTagNames方法的典型用法代码示例。如果您正苦于以下问题:PHP Tags::getTagNames方法的具体用法?PHP Tags::getTagNames怎么用?PHP Tags::getTagNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tags
的用法示例。
在下文中一共展示了Tags::getTagNames方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_tags
/**
* List all tags
*
*/
function list_tags()
{
ajx_current("empty");
$order = array_var($_GET, 'order', 'count');
$ts = array();
$tags = Tags::getTagNames($order);
$extra = array();
$extra['tags'] = $tags;
ajx_extra_data($extra);
}
示例2: listTags
function listTags($username, $password) {
if ($this->loginUser($username, $password)) {
$tags = Tags::getTagNames();
$this->initXml('tags');
if (is_array($tags)) {
foreach ($tags as $tag) {
$this->instance->startElement('tag');
$this->instance->text($tag['name']);
$this->instance->endElement();
}
}
$result = $this->endXml();
} else $result = '';
return $result;
}
示例3: get_ext_values
private function get_ext_values($field, $manager = null)
{
$values = array(array('id' => '', 'name' => '-- ' . lang('select') . ' --'));
if ($field == 'company_id' || $field == 'assigned_to_company_id') {
$companies = Companies::getVisibleCompanies(logged_user());
foreach ($companies as $company) {
$values[] = array('id' => $company->getId(), 'name' => $company->getName());
}
} else {
if ($field == 'user_id' || $field == 'created_by_id' || $field == 'updated_by_id' || $field == 'assigned_to_user_id' || $field == 'completed_by_id') {
$users = Users::getVisibleUsers(logged_user());
foreach ($users as $user) {
$values[] = array('id' => $user->getId(), 'name' => $user->getDisplayName());
}
} else {
if ($field == 'milestone_id') {
$milestones = ProjectMilestones::getActiveMilestonesByUser(logged_user());
foreach ($milestones as $milestone) {
$values[] = array('id' => $milestone->getId(), 'name' => $milestone->getName());
}
} else {
if ($field == 'workspace') {
$workspaces = logged_user()->getWorkspaces(false, 0);
foreach ($workspaces as $ws) {
$values[] = array('id' => $ws->getId(), 'name' => $ws->getName());
}
} else {
if ($field == 'tag') {
$tags = Tags::getTagNames();
foreach ($tags as $tag) {
$values[] = array('id' => $tag['name'], 'name' => $tag['name']);
}
} else {
if ($field == 'object_subtype') {
$object_types = ProjectCoTypes::findAll(array('conditions' => !is_null($manager) ? "`object_manager`='{$manager}'" : ""));
foreach ($object_types as $object_type) {
$values[] = array('id' => $object_type->getId(), 'name' => $object_type->getName());
}
}
}
}
}
}
}
return $values;
}
示例4: add_file
/**
* Add file
*
* @access public
* @param void
* @return null
*/
function add_file()
{
if (logged_user()->isGuest()) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$file_data = array_var($_POST, 'file');
$file = new ProjectFile();
tpl_assign('file', $file);
tpl_assign('file_data', $file_data);
tpl_assign('tags', Tags::getTagNames());
if (is_array(array_var($_POST, 'file'))) {
$this->setLayout("html");
$upload_option = array_var($file_data, 'upload_option');
$skipSettings = false;
try {
DB::beginWork();
if ($upload_option && $upload_option != -1) {
$skipSettings = true;
$file = ProjectFiles::findById($upload_option);
$old_subs = $file->getSubscribers();
// Mantain old subscribers
foreach ($old_subs as $user) {
$value = "user_" . $user->getId();
if (is_array($_POST['subscribers'])) {
if (array_var($_POST['subscribers'], $value, null) != 'checked') {
$_POST['subscribers'][$value] = 'checked';
}
}
}
if ($file->isCheckedOut()) {
if (!$file->canCheckin(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$file->setCheckedOutById(0);
} else {
// Check for edit permissions
if (!$file->canEdit(logged_user())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
}
} else {
$type = array_var($file_data, 'type');
$file->setType($type);
$file->setFilename(array_var($file_data, 'name'));
$file->setFromAttributes($file_data);
$file->setIsPrivate(false);
if (!logged_user()->isMemberOfOwnerCompany()) {
$file->setIsImportant(false);
$file->setCommentsEnabled(true);
$file->setAnonymousCommentsEnabled(false);
}
// if
$file->setIsVisible(true);
}
$file->save();
if ($file->getType() == ProjectFiles::TYPE_DOCUMENT) {
// handle uploaded file
$upload_id = array_var($file_data, 'upload_id');
$uploaded_file = array_var($_SESSION, $upload_id, array());
$revision_comment = array_var($file_data, 'revision_comment');
$revision = $file->handleUploadedFile($uploaded_file, true, $revision_comment);
// handle uploaded file
@unlink($uploaded_file['tmp_name']);
unset($_SESSION[$upload_id]);
} else {
if ($file->getType() == ProjectFiles::TYPE_WEBLINK) {
$url = array_var($file_data, 'url', '');
if ($url && strpos($url, ':') === false) {
$url = "http://" . $url;
$file->setUrl($url);
$file->save();
}
$revision = new ProjectFileRevision();
$revision->setFileId($file->getId());
$revision->setRevisionNumber($file->getNextRevisionNumber());
$revision->setFileTypeId(FileTypes::getByExtension('webfile')->getId());
$revision->setTypeString($file->getUrl());
$revision->setRepositoryId('webfile');
$revision_comment = array_var($file_data, 'revision_comment', lang('initial versions'));
$revision->setComment($revision_comment);
$revision->save();
}
}
$object_controller = new ObjectController();
//Add properties
if (!$skipSettings) {
$file->setTagsFromCSV(array_var($file_data, 'tags'));
//.........这里部分代码省略.........