Update a notification configuration.

@param string $id
@param string $content
@param string $type
@param bool $hide_button

@return void
496064
public function update_notification( $id, $content = null, $type = null, $hide_button = null, $cond_func = null ) {
        if ( ! isset( $this->notices[$id] ) ) {
            $this->add_notification( $id, $content, $type, $hide_button, $cond_func );	
        }	

        if ( $content ) {
            $this->notices[$id]['content'] = $content;
        }

        if ( $type ) {
            $this->notices[$id]['type'] = $type;
        }

        if ( $hide_button ) {
            $this->notices[$id]['hide_button'] = $hide_button;
        }

        if ( $cond_func ) {
            $this->notices[$id]['cond_func'] = $cond_func;
        }

        $this->save();
    }
368824
final protected function header(string $content, string $type = null)
    {
        Response::header($content, $type);
    }
1145380
public void showIndeterminate(final int id, int status) {
        final BaseNotificationItem notification = get(id);

        if (notification == null) {
            return;
        }

        notification.updateStatus(status);
        notification.show(false);
    }
434414
public function publishNewType(Type $toType, $newStatus)
    {
        $this->contentTypeGateway->publishTypeAndFields(
            $toType->id,
            $toType->status,
            $newStatus
        );
    }
112754
public function view($type = null, $id = null)
    {
        $this->_validateActionIsEnabled('view');

        $this->_event('beforeView', [
            'id' => $id
        ]);

        $data = $this->Model->get($id, [
            'contain' => $this->type['contain']
        ]);
        $this->set('data', $data);

        $this->_event('afterView', [
            'id' => $id
        ]);
    }
724298
public function setRelation($contentType, $id)
    {
        if (empty($this->relation[$contentType]) || !in_array($id, $this->relation[$contentType], false)) {
            $this->relation[$contentType][] = $id;
        }
    }
164715
public static function log($type, $source): void
    {
        if (
            (!($source instanceof \stdClass) && $type === self::TYPE_EXCEPTION) ||
            (!($source instanceof JsonRpcRequest) && \in_array($type, [self::TYPE_REQUEST, self::TYPE_RESPONSE], true))
        ) {
            return;
        }

        /** @var JsonRpcRequest $jsonRpcRequest */
        $jsonRpcRequest = app('JsonRpcRequest');
        $hideIndices = !empty($jsonRpcRequest->controller->hideDataLog) ? $jsonRpcRequest->controller->hideDataLog : false;
        $method = !empty($jsonRpcRequest->method) ? $jsonRpcRequest->method : 'Unknown';

        switch ($type) {
            case self::TYPE_REQUEST:
                $logLevel = 'info';
                $message = 'Request';
                $context = !empty($source->call) ? (array)$source->call : [];
                break;

            case self::TYPE_RESPONSE:
                $logLevel = 'info';
                $message = sprintf('Successful request to method "%s" (id-%s) with params: ', $source->method, $source->id);
                $context = !empty($source->call) ? (array)$source->call : [];
                break;

            case self::TYPE_EXCEPTION:
                $logLevel = 'error';
                $message = sprintf('JsonRpcException %d: %s',
                    isset($source->code) ? $source->code : 0,
                    !empty($source->message) ? $source->message : '');
                $context = !empty($jsonRpcRequest->call) ? (array)$jsonRpcRequest->call : [];
                break;

            default:
                $logLevel = 'info';
                $message = 'No log type specified';
                $context['params'] = [];
                break;
        }

        $hideDataRules = !empty($hideIndices[$type][$method])
            ? $hideIndices[$type][$method]
            : false;

        $hideData = function (&$item, $key, $rules) {
            if (\in_array($key, $rules, true)) {
                $item = '****';
            }
        };

        if ($hideDataRules && !empty($context['params'])) {
            array_walk($context['params'], $hideData, $hideDataRules);
        }

        Log::channel(config('jsonrpc.log_channel'))
            ->$logLevel($message, $context);

    }
1087229
public void setContent(final String contentString, final String type) {
        final Content newContent = new Content();
        newContent.setType(type == null ? Content.HTML : type);
        newContent.setValue(contentString);
        final ArrayList<Content> contents = new ArrayList<Content>();
        contents.add(newContent);
        setContents(contents);
    }
418087
public function alert($content, $type = 'success', $options = [])
    {
        if (!is_array($content)) {
            $content = [
                'body' => $content,
            ];
        }

        $content = array_merge($content, [
            'options' => $options,
        ]);

        $this->session->getFlashBag()->add($type, $content);
    }
634518
public function update(RemoveNewsletterUserRequest $request, $id)
    {
        $activated_at = ($request->input('activation') ? date('Y-m-d G:i:s') : null);
        $subscriber   = $this->subscriber->find($id);

        $new = $request->input('newsletter_id',[]);
        $has = $subscriber->subscriptions->pluck('id')->all();

        $added   = array_diff($new, $has);
        $removed = array_diff(array_unique(array_merge($new, $has)), $new);

        // if email edited we have to change it
        if($request->input('email') != $subscriber->email){
            // unsubscribe all and delete
            $this->subscription_worker->unsubscribe($subscriber,$has);

            // make new subscriber and add all
            $newsubscriber = $this->subscriber->create([
                'email' => $request->input('email'), 'activated_at' => $activated_at, 'activation_token' => md5($request->input('email').\Carbon\Carbon::now()),
            ]);

            $this->subscription_worker->subscribe($newsubscriber,$new);

            alert()->success('Abonné édité');
            return redirect('build/subscriber/'.$newsubscriber->id);
        }
        else{
            $subscriber = $this->subscriber->update(['id' => $id,'activated_at' => $request->input('activation') ? date('Y-m-d G:i:s') : null]);

            $this->subscription_worker->subscribe($subscriber,$added);
            $subscriber = $this->subscription_worker->unsubscribe($subscriber,$removed);

            if(!$subscriber){
                alert()->success('Abonné édité et supprimé');
                return redirect('build/subscriber');
            }

            alert()->success('Abonné édité');
            return redirect('build/subscriber/'.$subscriber->id);
        }
    }
973991
public function markNotificationAsRead($notification_id)
    {
        $notification = $this->notifications()
            ->where('id', $notification_id)
            ->whereNull('read_at');

        if ($notification->exists()) {
            $notification->first()->markAsRead();
        }
    }
1113498
public function notificationAjax(string $title, string $message, string $type = 'default', bool $send_payload = TRUE): void
    {
        if ($this->isAjax())
        {
            $this->payload->notifications[] = $this->createNotification($title, $message, $type);

            if ($send_payload === TRUE)
            {
                $this->sendPayload();
            }
        }
    }
417948
public function addMessage($type, $content)
	{
		if(isset($_SESSION[$this->sessionKey])) {
			$messages = $_SESSION[$this->sessionKey];
		}
		
		$messages[] = [
			'content' => $content,
			'type' => $type,
		];
		
		$_SESSION[$this->sessionKey] = $messages;
	}
690276
function(node) {
  NodeView.call(this, node);

  this.$el.attr({id: node.id});
  this.$el.addClass("content-node publication-info");

  this.$el.on('change', "#license", _.bind(this.updateLicense, this));
  this.$el.on('change', "#published_on", _.bind(this.updatePublicationDate, this));
}
373947
function(newContent, type) {
		mfp.content = newContent;

		if(newContent) {
			if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
				mfp.currTemplate[type] === true) {
				// if there is no markup, we just append close button element inside
				if(!mfp.content.find('.mfp-close').length) {
					mfp.content.append(_getCloseBtn());
				}
			} else {
				mfp.content = newContent;
			}
		} else {
			mfp.content = '';
		}

		_mfpTrigger(BEFORE_APPEND_EVENT);
		mfp.container.addClass('mfp-'+type+'-holder');

		mfp.contentContainer.append(mfp.content);
	}
218667
public function themeHasActivated($type, $id)
    {
        $message = \trans('orchestra/control::response.themes.update', [
            'type' => Str::title($type),
        ]);

        return $this->redirectWithMessage(
            \handles("orchestra::control/themes/{$type}"), $message
        );
    }
246578
private function add ($message, $type = Notification::ERROR, $isRaw = false, $canHide = true)
		{
			$this->_data[] = new Notification ($message, $type, $isRaw, $canHide);
		}