It looks like it's not showing up in the package manager. Can you edit the package and make sure mysql and sqlsrv are checked for the supported database drivers? Looks like it's not set for either.
Oooh! A shiny new addition to my Expo presentation!
Hmmm... could add a "Publish Now" button to that. User's group would need to have "publish" permission for the context for the button to show.
That's 'resource_unpublished'
GitHub!!! Please!!!
[ed. note: sottwell last edited this post 8 years, 6 months ago.]
I have added some code to the plugin to add a "publish now" button. Here's the whole thing after I've meddled with it.
<?php
# Plugin to display a warning that the viewed resource will not be visible when the user logs out of the manager.
# Fires on: OnLoadWebDucument
# Author: [email protected]
if (!$modx->resource->get('published')&&$modx->user->hasSessionContext('mgr')) {
$modx->getService('lexicon','modLexicon');
$modx->lexicon->load('resource');
if ($modx->lexicon('resource_unpublished')) {
$message = $modx->lexicon('resource_unpublished');
}
else {
$message = "Page is not published";
}
// add "Publish Now" button, clear cache and refresh page
// 8 Nov 2015 sottwell
$button = '';
if($modx->hasPermission('publish')) {
$button = '<form action="" method="post" style="display:inline-block;"><input type="submit" id="pubnow" name="pubnow" value="Publish Now"></form>';
if(isset($_POST['pubnow']) && ($_POST['pubnow'] == 'Publish Now')) {
$rid = $modx->resource->get('id');
$result = $modx->runProcessor('resource/publish', array('id' => $rid));
$url = $modx->makeURL($rid);
$modx->sendRedirect($url);
}
}
$modx->regClientHTMLBlock('
<div style="position: fixed; top: 0; width:100%; height: 50px; background-color: #f33; opacity: 0.6;">
<div style="padding: 15px; margin: 0 auto; width: 800px; color: #fff; text-shadow: 1px 1px 5px #000">'.$message . ' - ' . $button . '</div>
</div>
');
}
[ed. note: sottwell last edited this post 8 years, 5 months ago.]
-
- 1,145 Posts
Yea, that github thing, I did not dig it at all.
I understand the usefulness of collaboration, but Github lingo has been one of the worst experiences I have come across in terms of workflow and getting things uploaded peacefully.
I am still trying to learn the stupid thing.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
- 24,544 Posts
I rely on GitHub as a backup for almost all my MODX dev. work. I think the secret is learning to use command-line Git commands to interact with GitHub. When you create a GitHub Repo, GitHub shows you the commands to clone it locally using Git Bash or something similar.
I have a Git Bash terminal set up inside PhpStorm (I don't use PhpStorm's Build-in Git features). I can pop open the terminal window and do whatever I want with Git, including pushing stuff to GitHub.
Since I'm using MyComponent, everything I do is in a file and it's easy to run or debug unit tests inside PhpStorm. I've just been working on UpgradeMODX and the ability to step through all its code in a unit test and watch the variables change saved me *many* hours of frustration.
If Git, MyComponent, or PhpStorm went away tomorrow, I'd have to shoot myself. I don't know how to work without them.
This conflicts badly with a typical Bootstrap fixed top menu. One solution is to modify the HTML block's style attribute in the plugin to attach it to the bottom of the page instead of the top.
I think that after the Expo I'll play with this a bit to have it use a chunk and getChunk instead of being hard-coded. Maybe even add its own assets/components/pubwarner/css/ for styling, something like the QuickBar snippet.