コード例 #1
0
ファイル: floatbox.php プロジェクト: hardikamutech/loov
 public function __construct()
 {
     parent::__construct();
     if (!OW::getUser()->isAuthenticated()) {
         throw new Redirect403Exception();
     }
     $service = HOTLIST_BOL_Service::getInstance();
     if ($service->findUserById(OW::getUser()->getId())) {
         $this->assign('userInList', true);
         $this->assign('text_notification', OW::getLanguage()->text('hotlist', 'text_remove_from_list'));
         $removeFromListForm = new RemoveFromHotListForm();
         $this->addForm($removeFromListForm);
     } else {
         $this->assign('userInList', false);
         if (OW::getPluginManager()->isPluginActive('usercredits')) {
             $creditService = USERCREDITS_BOL_CreditsService::getInstance();
             $action = $creditService->findAction('hotlist', 'add_to_list');
             $actionPrice = $creditService->findActionPriceForUser($action->id, OW::getUser()->getId());
             $amount = $actionPrice->amount;
         } else {
             $userCreditsAction = new HOTLIST_CLASS_Credits();
             $amount = $userCreditsAction->getActionCost();
         }
         $status = BOL_AuthorizationService::getInstance()->getActionStatus('hotlist', 'add_to_list');
         if (isset($status['authorizedBy']) && $status['authorizedBy'] == 'base') {
             $this->assign('floatbox_text', OW::getLanguage()->text('hotlist', 'floatbox_text_simple'));
         } else {
             $this->assign('floatbox_text', OW::getLanguage()->text('hotlist', 'floatbox_text', array('amount' => abs($amount))));
         }
         $addToListForm = new AddToHotListForm();
         $this->addForm($addToListForm);
     }
 }
コード例 #2
0
ファイル: activate.php プロジェクト: hardikamutech/loov
<?php

/**
 * Copyright (c) 2014, Skalfa LLC
 * All rights reserved.
 *
 * ATTENTION: This commercial software is intended for exclusive use with SkaDate Dating Software (http://www.skadate.com) and is licensed under SkaDate Exclusive License by Skalfa LLC.
 *
 * Full text of this license can be found at http://www.skadate.com/sel.pdf
 */
$widget = BOL_ComponentAdminService::getInstance()->addWidget('HOTLIST_CMP_IndexWidget', false);
$placeWidget = BOL_ComponentAdminService::getInstance()->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_DASHBOARD);
BOL_ComponentAdminService::getInstance()->addWidgetToPosition($placeWidget, BOL_ComponentAdminService::SECTION_RIGHT, 0);
require_once dirname(__FILE__) . DS . 'classes' . DS . 'credits.php';
$credits = new HOTLIST_CLASS_Credits();
$credits->triggerCreditActionsAdd();