• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP plugin_active函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中plugin_active函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_active函数的具体用法?PHP plugin_active怎么用?PHP plugin_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plugin_active函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: lang

/**
 * Shortcut function for retrieving single lang value
 *
 * @access public
 * @param string $name
 * @return string
 */
function lang($name)
{
    // Get function arguments and remove first one.
    $args = func_get_args();
    if (is_array($args)) {
        array_shift($args);
    }
    // if
    // Get value and if we have NULL done!
    if (plugin_active('i18n')) {
        $value = lang_from_db($name);
    } else {
        $value = Localization::instance()->lang($name);
    }
    if (is_null($value)) {
        return $value;
    }
    // if
    // We have args? Replace all %s with arguments
    if (is_array($args) && count($args)) {
        foreach ($args as $arg) {
            $value = str_replace_first('%s', $arg, $value);
        }
        // foreach
    }
    // if
    // Done here...
    return $value;
}
开发者ID:bklein01,项目名称:Project-Pier,代码行数:36,代码来源:localization.php


示例2: checkEventManager

 function checkEventManager()
 {
     $events_manager_actived = plugin_active('events-manager/events-manager.php');
     (bool) $events_manager_actived;
     if ($events_manager_actived) {
         $notice = null;
     } else {
         $notice = __("Event Manager Importer : Event Manager is not enabled. Please enable it before our plugin.", "emi");
     }
     parent::set_notice($notice);
 }
开发者ID:Cedric31,项目名称:wp-events-manager-importer,代码行数:11,代码来源:emi_setup.class.php


示例3: emiStart

function emiStart()
{
    if (is_admin() && plugin_active('events-manager/events-manager.php')) {
        add_action('wp_ajax_get_file_info', 'get_file_info');
        add_action('wp_ajax_nopriv_get_file_info', 'get_file_info');
        upload_create();
        $EmiController = new EmiController();
    } else {
        if (!plugin_active('events-manager/events-manager.php')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
            deactivate_plugins('wp-events-manager-importer/emi.php');
        }
    }
}
开发者ID:Cedric31,项目名称:wp-events-manager-importer,代码行数:14,代码来源:emi.php


示例4: renderControl

 /**
  * Renders attachment control based on Object type
  *
  * @param void
  * @return string
  */
 function renderControl($control_name)
 {
     switch ($this->getRelObjectManager()) {
         case 'Companies':
             return select_company($control_name, $this->getRelObjectId(), array('class' => 'combobox'));
             break;
         case 'Contacts':
             return select_contact($control_name, $this->getRelObjectId(), null, array('class' => 'combobox'));
             break;
         case 'ProjectFiles':
             if (plugin_active('files')) {
                 return select_project_file($control_name, active_project(), $this->getRelObjectId(), null, array('class' => 'combobox'));
             }
             return '';
             break;
         case 'ProjectMessages':
             return select_message($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
             break;
         case 'ProjectMilestones':
             return select_milestone($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
             break;
         case 'ProjectTasks':
             break;
         case 'ProjectTaskLists':
             return select_task_list($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
             break;
         case 'ProjectTickets':
             if (plugin_active('tickets')) {
                 return select_ticket($control_name, active_project(), $this->getRelObjectId(), array('class' => 'combobox'));
             }
             return '';
             break;
         default:
             return '';
             break;
     }
     // switch
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:44,代码来源:PageAttachment.class.php


示例5: label_tag

    ?>
  <div>
    <?php 
    echo label_tag(lang('projects copy links'), 'projectFormCopyLinks');
    ?>
    <?php 
    echo checkbox_field('project[copy_links]', true, array_var($project_data, 'copy_links'), array('id' => 'projectFormCopyLinks'));
    ?>
  </div>
<?php 
}
// if
?>

<?php 
if (plugin_active('wiki')) {
    ?>
  <div>
    <?php 
    echo label_tag(lang('projects copy pages'), 'projectFormCopyPages');
    ?>
    <?php 
    echo checkbox_field('project[copy_pages]', true, array_var($project_data, 'copy_pages'), array('id' => 'projectFormCopyPages'));
    ?>
  </div>
<?php 
}
// if
?>

  <?php 
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:copy_project.php


示例6: clearFolders

 /**
 * Clear all folders
 *
 * @param void
 * @return null
 */
 private function clearFolders() {
   if(!plugin_active('files')) { return null; }
   $folders = $this->getFolders();
   if (is_array($folders)) {
     foreach ($folders as $folder) {
       $folder->delete();
     } // foreach
   } // if
 } // clearFolders
开发者ID:rjv,项目名称:Project-Pier,代码行数:15,代码来源:Project.class.php


示例7: edit_locale

 /**
  * Edit locale
  *
  * @param void
  * @return null
  */
 function edit_locale()
 {
     $locale = I18nLocales::findById(get_id());
     if (!$locale instanceof I18nLocale) {
         flash_error(lang('locale dnx'));
         $this->redirectTo('i18n', 'index');
     }
     // if
     if (!$locale->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo('i18n', 'index');
     }
     // if
     $this->setTemplate('edit_locale');
     $locale_data = array_var($_POST, 'locale');
     if (!is_array($locale_data)) {
         $tag_names = '';
         //$tag_names = plugin_active('tags') ? $locale->getTagNames() : '';
         $locale_data = array('name' => $locale->getName(), 'description' => $locale->getDescription(), 'language_code' => $locale->getLanguageCode(), 'country_code' => $locale->getCountryCode(), 'editor_id' => $locale->getEditorId(), 'translation_url' => $locale->getTranslationUrl(), 'tags' => is_array($tag_names) ? implode(', ', $tag_names) : '');
         // array
     }
     // if
     //tpl_assign('locale_data', $locale_data);
     //tpl_assign('locale', $locale);
     if (is_array(array_var($_POST, 'locale'))) {
         $locale->setFromAttributes($locale_data);
         try {
             DB::beginWork();
             $locale->save();
             ApplicationLogs::createLog($locale, 0, ApplicationLogs::ACTION_EDIT);
             if (plugin_active('tags')) {
                 // tags currently at project level and locale NOT project level
                 //$locale->setTagsFromCSV($locale_data['tags']);
             }
             DB::commit();
             flash_success(lang('success edit locale'));
             $this->redirectTo('i18n', 'index');
         } catch (Exception $e) {
             DB::rollback();
             tpl_assign('error', $e);
         }
         // try
     }
     tpl_assign('locale', $locale);
     tpl_assign('locale_data', $locale_data);
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:52,代码来源:I18nController.class.php


示例8: get_url

      <a href="<?php 
            echo get_url('page_attachment', 'add_attachment', array('page_name' => 'project_overview', 'rel_object_manager' => 'ProjectMessages', 'order' => $counter, 'redirect_to' => get_url('project', 'edit', null, null, true)), null, true);
            ?>
"><?php 
            echo lang('add message');
            ?>
</a> |
      <a href="<?php 
            echo get_url('page_attachment', 'add_attachment', array('page_name' => 'project_overview', 'rel_object_manager' => 'ProjectMilestones', 'order' => $counter, 'redirect_to' => get_url('project', 'edit', null, null, true)), null, true);
            ?>
"><?php 
            echo lang('add milestone');
            ?>
</a> |
<?php 
            if (plugin_active('tickets')) {
                ?>
      <a href="<?php 
                echo get_url('page_attachment', 'add_attachment', array('page_name' => 'project_overview', 'rel_object_manager' => 'ProjectTickets', 'order' => $counter, 'redirect_to' => get_url('project', 'edit', null, null, true)), null, true);
                ?>
"><?php 
                echo lang('add ticket');
                ?>
</a>
<?php 
            }
            ?>
    </div>
<?php 
        }
        // foreach
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:add_project.php


示例9: render_object_tags

/**
 * Render the tags of a specific object
 *
 * @param ProjectDataObject $object
 * @return string
 */
function render_object_tags(ProjectDataObject $object)
{
    if (plugin_active('tags')) {
        tpl_assign('object', $object);
        //tpl_assign('tags', $object->getTags());
        return tpl_fetch(get_template_path('object_tags', 'tags'));
    }
    return '';
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:15,代码来源:application.php


示例10: trace

<?php

trace(__FILE__, 'start');
set_page_title(lang('view task'));
project_tabbed_navigation('tasks');
project_crumbs(array(array(lang('tasks'), get_url('task')), array($task_list->getName(), $task_list->getViewUrl()), array(lang('view task'))));
$options = array();
if ($task->canEdit(logged_user())) {
    $options[] = '<a href="' . $task->getEditUrl() . '">' . lang('edit') . '</a>';
}
if ($task->canDelete(logged_user())) {
    $options[] = '<a href="' . $task->getDeleteUrl() . '">' . lang('delete') . '</a>';
}
if (plugin_active('time')) {
    if (ProjectTime::canAdd(logged_user(), active_project())) {
        $options[] = '<a href="' . get_url('time', 'add', array('task' => $task->getId())) . '">' . lang('add time') . '</a>';
    }
}
if ($task->canChangeStatus(logged_user())) {
    if ($task->isOpen()) {
        $options[] = '<a href="' . $task->getCompleteUrl() . '">' . lang('mark task as completed') . '</a>';
    } else {
        $options[] = '<a href="' . $task->getOpenUrl() . '">' . lang('open task') . '</a>';
    }
    // if
}
// if
?>

<div id="taskDetails" class="block">
  <div class="header"><?php 
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:31,代码来源:view_task.php


示例11: edit_file

 /**
  * Edit file
  *
  * @access public
  * @param void
  * @return null
  */
 function edit_file()
 {
     $this->setTemplate('add_file');
     $file = ProjectFiles::findById(get_id());
     if (!$file instanceof ProjectFile) {
         flash_error(lang('file dnx'));
         $this->redirectToReferer(get_url('files'));
     }
     // if
     if (!$file->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('files'));
     }
     // if
     $file_data = array_var($_POST, 'file');
     if (!is_array($file_data)) {
         $tag_names = plugin_active('tags') ? $file->getTagNames() : '';
         $file_data = array('folder_id' => $file->getFolderId(), 'description' => $file->getDescription(), 'is_private' => $file->getIsPrivate(), 'is_important' => $file->getIsImportant(), 'comments_enabled' => $file->getCommentsEnabled(), 'anonymous_comments_enabled' => $file->getAnonymousCommentsEnabled(), 'tags' => is_array($tag_names) && count($tag_names) ? implode(', ', $tag_names) : '');
         // array
     }
     // if
     tpl_assign('file', $file);
     tpl_assign('file_data', $file_data);
     if (is_array(array_var($_POST, 'file'))) {
         try {
             $old_is_private = $file->isPrivate();
             $old_is_important = $file->getIsImportant();
             $old_comments_enabled = $file->getCommentsEnabled();
             $old_anonymous_comments_enabled = $file->getAnonymousCommentsEnabled();
             DB::beginWork();
             $handle_file = array_var($file_data, 'update_file') == 'checked';
             // change file?
             $post_revision = $handle_file && array_var($file_data, 'version_file_change') == 'checked';
             // post revision?
             $revision_comment = $post_revision ? trim(array_var($file_data, 'revision_comment')) : '';
             // user comment?
             $file->setFromAttributes($file_data);
             if (!logged_user()->isMemberOfOwnerCompany()) {
                 $file->setIsPrivate($old_is_private);
                 $file->setIsImportant($old_is_important);
                 $file->setCommentsEnabled($old_comments_enabled);
                 $file->setAnonymousCommentsEnabled($old_anonymous_comments_enabled);
             }
             // if
             $file->save();
             if (plugin_active('tags')) {
                 $file->setTagsFromCSV(array_var($file_data, 'tags'));
             }
             $msg_name = basename($file->getFilename());
             if ($handle_file) {
                 $file->handleUploadedFile(array_var($_FILES, 'file_file'), $post_revision, $revision_comment);
                 $msg_name .= '(' . ')';
             }
             // if
             ApplicationLogs::createLog($file, active_project(), ApplicationLogs::ACTION_EDIT);
             DB::commit();
             flash_success(lang('success edit file', $msg_name));
             $this->redirectToUrl($file->getDetailsUrl());
         } catch (Exception $e) {
             //@unlink($file->getFilePath());
             DB::rollback();
             tpl_assign('error', $e);
         }
         // try
     }
     // if
 }
开发者ID:469306621,项目名称:Languages,代码行数:74,代码来源:FilesController.class.php


示例12: lang

        <div class="private" title="<?php echo lang('private task list') ?>">
          <span><?php echo lang('private task list') ?></span>
        </div>
      <?php endif ?>

    </div>

    <?php if (!is_null($task_list->getDueDate())) : ?>
    <div class="dueDate"><span><?php echo lang('due date') ?>:</span> <?php echo ($task_list->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) ? format_date($task_list->getDueDate(), null, 0) : format_descriptive_date($task_list->getDueDate(), 0) ?></div>
    <?php endif ?>

    <?php if ($task_list->getDescription()): ?>
    <div class="desc"><?php echo (do_textile($task_list->getDescription())) ?></div>
    <?php endif ?>

    <?php if (plugin_active('tags')): ?>
    <div class="taskListTags"><span><?php echo lang('tags') ?>:</span> <?php echo project_object_tags($task_list, $task_list->getProject()) ?></div>
    <?php endif ?>

    <?php if (count($task_list_options)): ?>
    <div class="options"><?php echo implode(' | ', $task_list_options) ?></div>
    <?php endif ?>

    <?php if (is_array($task_list->getOpenTasks())): ?>
    <div class="openTasks">
      <ul id="<?php echo $task_list->getId() ?>"><!--table class="blank"-->
        <?php foreach ($task_list->getOpenTasks() as $task): ?>
        <li id="<?php echo $task->getId() ?>" class="<?php odd_even_class($task_list_ln) ?>"><!--tr class="<?php odd_even_class($task_list_ln); ?>"-->
          <!-- Task text and options -->
          <!--td class="taskText"-->
            <div class="task-text">
开发者ID:rjv,项目名称:Project-Pier,代码行数:31,代码来源:task_list.php


示例13: edit

 /**
  * Edit a wiki page
  * 
  * @return void
  */
 function edit()
 {
     if (!WikiPage::canEdit(logged_user())) {
         flash_error(lang('no wiki page edit permissions'));
         $this->redirectToReferer(get_url('wiki'));
     }
     //Get the page from the url params
     $page = Wiki::getPageById(get_id(), active_project());
     if (!instance_of($page, 'WikiPage')) {
         //If the page doesn't exist, redirect to wiki index
         flash_error(lang('wiki page dnx'));
         $this->redirectToReferer(get_url('wiki'));
     }
     // if
     //Check that the user can edit this entry
     if (!$page->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo(get_url('wiki'));
     }
     // if
     // Check that the page isn't locked
     if ($page->isLocked() && !$page->canUnlock(logged_user())) {
         flash_error(lang('wiki page locked by', $page->getLockedByUser()->getUsername()));
         $this->redirectToUrl($page->getViewUrl());
     }
     // if
     //Here we will edit a wiki page
     $preview = false;
     $data = array_var($_POST, 'wiki', false);
     if (false !== $data) {
         $preview = array_key_exists('preview', $data);
     }
     if (!$preview && $data) {
         //if(null !== ($data = array_var($_POST, 'wiki'))){
         //If we have received data
         //Make a new revision
         $revision = $page->makeRevision();
         $revision->setFromAttributes($data);
         $page->setProjectIndex($data['project_index']);
         $page->setProjectSidebar($data['project_sidebar']);
         $page->setPublish($data['publish']);
         $page->setParentId($data['parent_id']);
         // Check to see if we want to lock this page
         if (isset($data['locked'])) {
             if ($data['locked'] == 1 && $page->canLock(logged_user()) && !$page->isLocked()) {
                 // If we want to lock this page and the user has permissions to lock it, and the page is not already locked
                 $page->setLocked(true);
                 $page->setLockedById(logged_user()->getId());
                 $page->setLockedOn(DateTimeValueLib::now());
             } elseif ($data['locked'] == 0 & $page->canUnlock(logged_user()) && $page->isLocked()) {
                 // Else if we want to unlock the page, and the user is allowed to, and the page is locked
                 $page->setLocked(false);
             }
             // if
         }
         // if
         //Set the users ID
         $revision->setCreatedById(logged_user()->getId());
         try {
             //Start the transaction
             DB::beginWork();
             //Save the page and create revision
             //The page will make sure that the revision's project and page Id are correct
             $page->save();
             ApplicationLogs::createLog($page, active_project(), ApplicationLogs::ACTION_EDIT);
             if (plugin_active('tags')) {
                 //Set the tags
                 $page->setTagsFromCSV($data['tags']);
             }
             //Commit changes
             DB::commit();
             flash_success(lang('success edit wiki page'));
             //Redirect to the page we just created
             $this->redirectToUrl($page->getViewUrl());
         } catch (Exception $e) {
             //Get rid of any Db changes we've made
             DB::rollback();
             //Assign the problem to the template so we can tell the user
             tpl_assign('error', $e);
         }
         //try
     } else {
         if (array_var($_GET, 'revision')) {
             //If we want to make a new revision based off a revision
             $revision = $page->getRevision($_GET['revision']);
         } else {
             $revision = $page->getLatestRevision();
         }
     }
     //if
     if (!$data) {
         // there was no input POSTed
         $data['content'] = $revision->getContent();
     }
     $data['preview_content'] = do_textile($data['content']);
//.........这里部分代码省略.........
开发者ID:bklein01,项目名称:Project-Pier,代码行数:101,代码来源:WikiController.class.php


示例14: time

 /**
  * Display time management tool
  *
  * @access public
  * @param void
  * @return null
  */
 function time()
 {
     if (plugin_active('time')) {
         tpl_assign('projects', logged_user()->getProjects());
         tpl_assign('users', owner_company()->getUsers());
         $status = array_var($_GET, 'status') ? array_var($_GET, 'status') : 0;
         $times = ProjectTimes::getTimeByStatus($status);
         $redirect_to = array_var($_GET, 'redirect_to');
         if ($redirect_to == '') {
             $redirect_to = get_url('administration', 'time', array('status' => $status));
             $redirect_to = str_replace('&amp;', '&', trim($redirect_to));
         }
         // if
         tpl_assign('times', $times);
         tpl_assign('redirect_to', $redirect_to);
     } else {
         $this->redirectTo('administration');
     }
 }
开发者ID:469306621,项目名称:Languages,代码行数:26,代码来源:AdministrationController.class.php


示例15: edit_link

    /**
    * Edit project link
    *
    * @param void
    * @return null
    */
    function edit_link() {
      
      $project_link = ProjectLinks::findById(get_id());
      
      if (!ProjectLink::canEdit(logged_user())) {
        flash_error(lang('no access permissions'));
        $this->redirectTo('links','index');
      } // if
      
      if (!($project_link instanceof ProjectLink)) {
        flash_error(lang('project link dnx'));
        $this->redirectTo('links');
      } // if
      
      $this->setTemplate('edit_link');
      $this->addHelper('files', 'files');

      $project_link_data = array_var($_POST, 'project_link');
      
      if (!is_array($project_link_data)) {
        $tag_names = plugin_active('tags') ? $project_link->getTagNames() : '';
        $project_link_data = array(
          'title'       => $project_link->getTitle(),
          'url'         => $project_link->getUrl(),
          'description' => $project_link->getDescription(),
          'folder_id'   => $project_link->getFolderId(),
          'tags' => is_array($tag_names) ? implode(', ', $tag_names) : '',
        ); // array
      } // if

      tpl_assign('project_link_data', $project_link_data);
      tpl_assign('project_link', $project_link);
      
      if (is_array(array_var($_POST, 'project_link'))) {
        $project_link->setFromAttributes($project_link_data);
        $project_link->setProjectId(active_project()->getId());
        
        try {
          DB::beginWork();
          $project_link->save();
          ApplicationLogs::createLog($project_link, active_project(), ApplicationLogs::ACTION_EDIT);
          if (plugin_active('tags')) {
            $project_link->setTagsFromCSV($project_link_data['tags']);
          }
          DB::commit();
          
          flash_success(lang('success edit link'));
          $this->redirectTo('links');
        } catch(Exception $e) {
          DB::rollback();
          tpl_assign('error', $e);
        } // try
      }
      tpl_assign('project_link', $project_link);
      tpl_assign('project_link_data', $project_link_data);
    } // edit_link
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:62,代码来源:LinksController.class.php


示例16: edit

 /**
  * Show and process edit milestone form
  *
  * @access public
  * @param void
  * @return null
  */
 function edit()
 {
     $this->setTemplate('add_milestone');
     $milestone = ProjectMilestones::findById(get_id());
     if (!$milestone instanceof ProjectMilestone) {
         flash_error(lang('milestone dnx'));
         $this->redirectTo('milestone', 'index');
     }
     // if
     if (!$milestone->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('milestone'));
     }
     $milestone_data = array_var($_POST, 'milestone');
     if (!is_array($milestone_data)) {
         $tag_names = plugin_active('tags') ? $milestone->getTagNames() : '';
         $milestone_data = array('name' => $milestone->getName(), 'due_date' => $milestone->getDueDate(), 'description' => $milestone->getDescription(), 'assigned_to' => $milestone->getAssignedToCompanyId() . ':' . $milestone->getAssignedToUserId(), 'tags' => is_array($tag_names) ? implode(', ', $tag_names) : '', 'is_private' => $milestone->isPrivate());
         // array
     }
     // if
     tpl_assign('milestone_data', $milestone_data);
     tpl_assign('milestone', $milestone);
     if (is_array(array_var($_POST, 'milestone'))) {
         $old_owner = $milestone->getAssignedTo();
         // remember the old owner
         if (isset($_POST['milestone_due_date'])) {
             $milestone_data['due_date'] = DateTimeValueLib::makeFromString($_POST['milestone_due_date']);
         } else {
             $milestone_data['due_date'] = DateTimeValueLib::make(0, 0, 0, array_var($_POST, 'milestone_due_date_month', 1), array_var($_POST, 'milestone_due_date_day', 1), array_var($_POST, 'milestone_due_date_year', 1970));
         }
         //$milestone_data['due_date'] = DateTimeValueLib::make(0, 0, 0, array_var($_POST, 'milestone_due_date_month', 1), array_var($_POST, 'milestone_due_date_day', 1), array_var($_POST, 'milestone_due_date_year', 1970));
         $assigned_to = explode(':', array_var($milestone_data, 'assigned_to', ''));
         $old_is_private = $milestone->isPrivate();
         $milestone->setFromAttributes($milestone_data);
         if (!logged_user()->isMemberOfOwnerCompany()) {
             $milestone->setIsPrivate($old_is_private);
         }
         $milestone->setProjectId(active_project()->getId());
         $milestone->setAssignedToCompanyId(array_var($assigned_to, 0, 0));
         $milestone->setAssignedToUserId(array_var($assigned_to, 1, 0));
         try {
             DB::beginWork();
             $milestone->save();
             if (plugin_active('tags')) {
                 $milestone->setTagsFromCSV(array_var($milestone_data, 'tags'));
             }
             ApplicationLogs::createLog($milestone, active_project(), ApplicationLogs::ACTION_EDIT);
             DB::commit();
             // If owner is changed send notification but don't break submission
             try {
                 $new_owner = $milestone->getAssignedTo();
                 if (array_var($milestone_data, 'send_notification') == 'checked') {
                     if ($old_owner instanceof User) {
                         // We have a new owner and it is different than old owner
                         if ($new_owner instanceof User && $new_owner->getId() != $old_owner->getId()) {
                             Notifier::milestoneAssigned($milestone);
                         }
                     } else {
                         // We have new owner
                         if ($new_owner instanceof User) {
                             Notifier::milestoneAssigned($milestone);
                         }
                     }
                     // if
                 }
                 // if
             } catch (Exception $e) {
             }
             // try
             flash_success(lang('success edit milestone', $milestone->getName()));
             $this->redirectTo('milestone');
         } catch (Exception $e) {
             DB::rollback();
             tpl_assign('error', $e);
         }
         // try
     }
     // if
 }
开发者ID:469306621,项目名称:Languages,代码行数:86,代码来源:MilestoneController.class.php


示例17: replace_ticket_link_callback

/**
 * Call back function for ticket link
 * 
 * @param mixed $matches
 * @return
 */
function replace_ticket_link_callback($matches)
{
    if (!plugin_active('tickets')) {
        return null;
    }
    if (count($matches) < 2) {
        return null;
    }
    // if
    if (!logged_user()->isMemberOfOwnerCompany()) {
        $object = ProjectTickets::findOne(array('conditions' => array('`id` = ? AND `project_id` = ? AND `is_private` = 0 ', $matches[1], active_project()->getId())));
    } else {
        $object = ProjectTickets::findOne(array('conditions' => array('`id` = ? AND `project_id` = ?', $matches[1], active_project()->getId())));
    }
    // if
    if (!$object instanceof ProjectTicket) {
        return '<del>' . lang('invalid reference', $matches[0]) . '</del>';
    } else {
        return '<a href="' . externalUrl($object->getViewUrl()) . '" title="' . lang('ticket') . '">' . $object->getTitle() . '</a>';
    }
    // if
}
开发者ID:bklein01,项目名称:Project-Pier,代码行数:28,代码来源:init.php


示例18: edit

 /**
  * Edit a wiki page
  * 
  * @return void
  */
 function edit()
 {
     if (!WikiPage::canEdit(logged_user())) {
         flash_error(lang('no wiki page edit permissions'));
         $this->redirectToReferer(get_url('wiki'));
     }
     //Get the page from the url params
     $page = Wiki::getPageById(get_id(), active_project());
     if (!instance_of($page, 'WikiPage')) {
         //If the page doesn't exist, redirect to wiki index
         flash_error(lang('wiki page dnx'));
         $this->redirectToReferer(get_url('wiki'));
     }
     // if
     //Check that the user can edit this entry
     if (!$page->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo();
     }
     // if
     //Here we will edit a wiki page
     if (null !== ($data = array_var($_POST, 'wiki'))) {
         //If we have received data
         //Make a new revision
         $revision = $page->makeRevision();
         $revision->setFromAttributes($data);
         $page->setProjectIndex($data['project_index']);
         $page->setProjectSidebar($data['project_sidebar']);
         //Set the users ID
         $revision->setCreatedById(logged_user()->getId());
         try {
             //Start the transaction
             DB::beginWork();
             //Save the page and create revision
             //The page will make sure that the revision's project and page Id are correct
             $page->save();
             ApplicationLogs::createLog($page, active_project(), ApplicationLogs::ACTION_EDIT);
             if (plugin_active('tags')) {
                 //Set the tags
                 $page->setTagsFromCSV($data['tags']);
             }
             //Commit changes
             DB::commit();
             flash_success(lang('success edit wiki page'));
             //Redirect to the page we just created
             $this->redirectToUrl($page->getViewUrl());
         } catch (Exception $e) {
             //Get rid of any Db changes we've made
             DB::rollback();
             //Assign the problem to the template so we can tell the user
             tpl_assign('error', $e);
         }
         //try
     } else {
         if (array_var($_GET, 'revision')) {
             //If we want to make a new revision based off a revision
             $revision = $page->getRevision($_GET['revision']);
         } else {
             $revision = $page->getLatestRevision();
         }
     }
     //if
     //Assign revision object
     tpl_assign('revision', $revision);
     //Assign the page object
     tpl_assign('page', $page);
     //Set the template
     $this->setTemplate('edit');
 }
开发者ID:469306621,项目名称:Languages,代码行数:74,代码来源:WikiController.class.php


示例19: getRelatedForms

 /**
  * Get project forms that are in relation with this message
  *
  * @param void
  * @return array
  */
 function getRelatedForms()
 {
     trace(__FILE__, 'getRelatedForms()');
     if (!plugin_active('form')) {
         return null;
     }
     if (is_null($this->related_forms)) {
         $this->related_forms = ProjectForms::findAll(array('conditions' => '`action` = ' . DB::escape(ProjectForm::ADD_COMMENT_ACTION) . ' AND `in_object_id` = ' . DB::escape($this->getId()), 'order' => '`order`'));
         // findAll
     }
     // if
     return $this->related_forms;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:19,代码来源:ProjectMessage.class.php


示例20: weekly_schedule

 /**
  * Shows weekly schedule in a calendar view
  * 
  * @param void
  * @return null
  */
 function weekly_schedule()
 {
     $this->addHelper('textile');
     // Gets desired view 'detail', 'list' or 'calendar'
     // $view_type is from URL, Cookie or set to default: 'calendar'
     $view_type = array_var($_GET, 'view', Cookie::getValue('weeklyScheduleViewType', 'calendar'));
     $expiration = Cookie::getValue('remember' . TOKEN_COOKIE_NAME) ? REMEMBER_LOGIN_LIFETIME : null;
     Cookie::setValue('weeklyScheduleViewType', $view_type, $expiration);
     $monthYear = array_var($_GET, 'month');
     if (!isset($monthYear) || trim($monthYear) == '' || preg_match('/^(\\d{4})(\\d{2})$/', $monthYear, $matches) == 0) {
         $year = gmdate('Y');
         $month = gmdate('m');
     } else {
         list(, $year, $month) = $matches;
     }
     // TODO make first day of week configurable
     $from_date = DateTimeValueLib::makeFromString('monday' . (date('w') == 1 ? '' : ' last week'));
     $to_date = $from_date->advance(60 * 60 * 24 * 7 * 3, false);
     // +3 weeks
     $upcoming_milestones = ProjectMilestones::getActiveMilestonesInPeriodByUser(logged_user(), $from_date, $to_date);
     $upcoming_tickets = array();
     if (plugin_active('tickets')) {
         $upcoming_tickets = ProjectTickets::getOpenTicketsInPeriodByUser(logged_user(), $from_date, $to_date);
     }
     $active_projects = array();
     $projects_index = array();
     $counter = 1;
     if (is_array($upcoming_milestones)) {
         foreach ($upcoming_milestones as $milestone) {
             if (!isset($projects_index[$milestone->getProjectId()])) {
                 $projects_index[$milestone->getProjectId()] = $counter;
                 $active_projects[] = $milestone->getProject();
                 $counter++;
             }
             // if
         }
         // foreach
     }
     // if
     if (is_array($upcoming_tickets)) {
         foreach ($upcoming_tickets as $ticket) {
             if (!isset($projects_index[$ticket->getProjectId()])) {
                 $projects_index[$ticket->getProjectId()] = $counter;
                 $active_projects[] = $ticket->getProject();
                 $counter++;
             }
             // if
         }
         // foreach
     }
     // if
     tpl_assign('from_date', $from_date);
     tpl_assign('to_date', $to_date);
     tpl_assign('view_type', $view_type);
     tpl_assign('upcoming_tickets', $upcoming_tickets);
     tpl_assign('late_tickets', array());
     // logged_user()->getLateTickets());
     tpl_assign('upcoming_milestones', $upcoming_milestones);
     tpl_assign('late_milestones', array());
     // logged_user()->getLateMilestones());
     tpl_assign('projects', $active_projects);
     tpl_assign('projects_index', $projects_index);
 }
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:69,代码来源:DashboardController.class.php



注:本文中的plugin_active函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP plugin_basename函数代码示例发布时间:2022-05-15
下一篇:
PHP pluginSplit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap