MojoMojo

 view release on metacpan or  search on metacpan

lib/MojoMojo/Controller/Admin.pm  view on Meta::CPAN

        return 1;
    }
}

=head2 update_user ( *private*)

Update user based on user listing.

=cut

sub update_user : Local {
    my ( $self, $c, $user ) = @_;
    $user = $c->model("DBIC::Person")->find($user) || return;

    #  if ($action eq 'active') {
    $user->active( ($user->active == 1) ? 0 : 1 );

    #  }
    $user->update;
    $c->stash->{user} = $user;
}

lib/MojoMojo/Schema/Result/Page.pm  view on Meta::CPAN

Create a new content version for this page.

%args is each column of L<MojoMojo::Schema::Result::Content>.

=cut

# update_content: this whole method may need work to deal with workflow.
# maybe it can't even be called if the site uses workflow...
# may need fixing for better conflict handling, too. maybe use a transaction?

sub update_content {
    my ( $self, %args ) = @_;

    my $content_version = (
          $self->content
        ? $self->content->max_version()
        : undef
    );
    my %content_data =
      map { $_ => $args{$_} }
      $self->result_source->related_source('content')->columns;

lib/MojoMojo/Schema/Result/Page.pm  view on Meta::CPAN

        # clear the precompiled (will be recompiled on view)
        if ( my $wantme_content = $wantme_page->content ) {
            $wantme_content->precompiled(undef);
            $wantme_content->update;
        }

        # ok, she don't want me anymore ;)
        $want_me->delete();
    }

}    # end sub update_content

=head2 add_version

    my $page_version_new = $page->add_version(
        creator => $user_id,
        name_orig => $page_new_name,
    );

Arguments: %replacementdata



( run in 0.337 second using v1.01-cache-2.11-cpan-95122f20152 )