getParentMenu
0 = unpublish
1 = publish
1415
public static function getParentMenu($publish=null, $parent=null, $type=null) 
	{		
		$criteria=new CDbCriteria;
		if($publish != null)
			$criteria->compare('t.publish',$publish);
		if($parent != null)
			$criteria->compare('t.parent_id',$parent);
		
		$model = self::model()->findAll($criteria);

		if($type == null) {
			$items = array();
			if($model != null) {
				foreach($model as $key => $val) {
					$items[$val->id] = $val->title->message;
				}
				return $items;
			} else {
				return false;
			}
		} else
			return $model;
	}
1151814
function onPublish( $contentObjectAttribute, $contentObject, $publishedNodes )
    {
        $contentClassAttribute = $contentObjectAttribute->attribute( 'contentclass_attribute' );
        $ret = eZIdentifierType::assignValue( $contentClassAttribute, $contentObjectAttribute );

        return $ret;
    }
352210
@Override
    public HttpPublishing getHttpPublishing() {
        if (delegate == null) {
            return this.httpPublishing;
        } else {
            return this.httpPublishing == null ? delegate.getHttpPublishing() : this.httpPublishing;
        }
    }
358406
private void sendPublishStopNotify() {
        Status stopStatus = new Status(StatusCodes.NS_UNPUBLISHED_SUCCESS);
        stopStatus.setClientid(getStreamId());
        stopStatus.setDetails(getPublishedName());

        StatusMessage stopMsg = new StatusMessage();
        stopMsg.setBody(stopStatus);
        pushMessage(stopMsg);
        setState(StreamState.STOPPED);
    }
901650
@Override
	public void dismissed(ExtensionPopupMenuComponent selectedMenuComponent) {
		for (int i = 0; i < getMenuComponentCount(); ++i) {
			Component menuComponent = getMenuComponent(i);
			if (PopupMenuUtils.isExtensionPopupMenuComponent(menuComponent)) {
				((ExtensionPopupMenuComponent) menuComponent).dismissed(selectedMenuComponent);
			}
		}
	}
30622
def delete(self, *args, **kwargs):
        
        from bakery import tasks
        from django.contrib.contenttypes.models import ContentType
        # if obj.save(unpublish=False) has been passed, we skip the task.
        unpublish = kwargs.pop('unpublish', True)
        # Delete it from the database
        super(AutoPublishingBuildableModel, self).delete(*args, **kwargs)
        if unpublish:
            ct = ContentType.objects.get_for_model(self.__class__)
            tasks.unpublish_object.delay(ct.pk, self.pk)
248707
def unpublish(self):
        
        if self.is_draft and self.publishing_linked:
            publishing_signals.publishing_pre_unpublish.send(
                sender=type(self), instance=self)
            # Unlink draft and published copies then delete published.
            # NOTE: This indirect dance is necessary to avoid triggering
            # unwanted MPTT tree structure updates via `delete`.
            type(self.publishing_linked).objects \
                .filter(pk=self.publishing_linked.pk) \
                .delete()  # Instead of self.publishing_linked.delete()
            # NOTE: We update and save the object *after* deleting the
            # published version, in case the `save()` method does some
            # validation that breaks when unlinked published objects exist.
            self.publishing_linked = None
            self.publishing_published_at = None

            # Save the draft to remove its relationship with the published copy
            publishing_signals.publishing_unpublish_save_draft.send(
                sender=type(self), instance=self)

            publishing_signals.publishing_post_unpublish.send(
                sender=type(self), instance=self)
1209346
public void publishEvent(final ApplicationEvent event) {
        if (this.eventPublisher != null) {
            LOGGER.trace("Publishing event [{}]", event);
            this.eventPublisher.publishEvent(event);
        }
    }
347717
public void unpublish(final WebApp webApp) {
		NullArgumentException.validateNotNull(webApp, "Web app");
		LOG.debug("Unpublishing web application [{}]", webApp);
		final ServiceTracker<WebAppDependencyHolder, WebAppDependencyHolder> tracker = webApps
				.remove(webApp);
		if (tracker != null) {
			tracker.close();
		}
	}
608843
public void showPublishDialog() {

        CmsPublishDialog.showPublishDialog(new HashMap<String, String>(), new CloseHandler<PopupPanel>() {

            /**
             * @see com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google.gwt.event.logical.shared.CloseEvent)
             */
            public void onClose(CloseEvent<PopupPanel> event) {

                deactivateCurrentButton();

            }
        }, new Runnable() {

            public void run() {

                showPublishDialog();
            }

        }, null);
    }
724747
@Override
    public void unsubscribeAll(EventPublisher source) {
	checkPermission();
	if (source == null) {
	    throw new IllegalArgumentException("Parameter cannot be null");
	}
	super.unsubscribeAll(source);
    }
525737
function (next) {

									minify(
										outputJsFile,
										_.extend({optimize: true},uglifyOptions),
										function(err){
											if ( err ){
												return next(err);
											}

											if ( isForPublish ){
												publisher(
													outputJsFile,
													function (err) {
														return next(err);
													},
													options.forceminified
												);
											}else {
												return next();
											}

										}
									);

								}
990039
public String buildPublishOptions() {

        // show only for direct publish actions
        StringBuffer result = new StringBuffer(128);
        boolean showOptionSiblings = (isMultiOperation()
            || isOperationOnFolder()
            || (isDirectPublish() && hasSiblings() && hasCorrectLockstate()));
        boolean showOptionSubresources = (isMultiOperation() || isOperationOnFolder());

        result.append("<p>");
        if (showOptionSiblings) {
            // show only for multi resource operation or if resource has siblings and correct lock state
            if (!isMultiOperation() && !isOperationOnFolder()) {
                result.append(key(Messages.GUI_DELETE_WARNING_SIBLINGS_0));
                result.append("<br>");
            }
            result.append("<input type='checkbox' name='");
            result.append(PARAM_PUBLISHSIBLINGS);
            result.append("' value='true' onclick=\"reloadReport();\"");
            if (Boolean.valueOf(getParamPublishsiblings()).booleanValue()) {
                result.append(" checked='checked'");
            }
            result.append(">&nbsp;");
            result.append(key(Messages.GUI_PUBLISH_ALLSIBLINGS_0));
            result.append("<br>\n");
        } else {
            result.append("<input type='hidden' name='");
            result.append(PARAM_PUBLISHSIBLINGS);
            result.append("' value='");
            result.append(Boolean.valueOf(getParamPublishsiblings()));
            result.append("'");
            if (Boolean.valueOf(getParamPublishsiblings()).booleanValue()) {
                result.append(" checked='checked'");
            }
            result.append(">\n");
        }
        if (showOptionSubresources) {
            // at least one folder is selected, show "publish subresources" checkbox
            result.append("<input type='checkbox' name='");
            result.append(PARAM_SUBRESOURCES);
            result.append("' value='true' onclick=\"reloadReport();\"");
            if (Boolean.valueOf(getParamSubresources()).booleanValue()) {
                result.append(" checked='checked'");
            }
            result.append(">&nbsp;");
            if (isMultiOperation()) {
                result.append(key(Messages.GUI_PUBLISH_MULTI_SUBRESOURCES_0));
            } else {
                result.append(key(Messages.GUI_PUBLISH_SUBRESOURCES_0));
            }
            result.append("<br>\n");
        } else {
            result.append("<input type='hidden' name='");
            result.append(PARAM_SUBRESOURCES);
            result.append("' value='");
            result.append(Boolean.valueOf(getParamSubresources()));
            result.append("'");
            if (Boolean.valueOf(getParamSubresources()).booleanValue()) {
                result.append(" checked='checked'");
            }
            result.append(">\n");
        }
        // code for the 'publish related resources' button
        boolean disabled = false;
        if ((OpenCms.getWorkplaceManager().getDefaultUserSettings().getPublishRelatedResources() == CmsDefaultUserSettings.PUBLISH_RELATED_RESOURCES_MODE_FORCE)
            && !OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER)) {
            disabled = true;
        }
        result.append("<input type='checkbox' name='");
        result.append(PARAM_RELATEDRESOURCES);
        result.append("' value='true' onclick=\"reloadReport();\"");
        if (Boolean.valueOf(getParamRelatedresources()).booleanValue()) {
            result.append(" checked='checked'");
        }
        if (disabled) {
            result.append(" disabled='disabled'");
        }
        result.append(">&nbsp;");
        result.append(key(Messages.GUI_PUBLISH_RELATED_RESOURCES_0));
        result.append("<br>\n");
        result.append("</p>\n");
        return result.toString();
    }
785635
function onPublish( $contentObjectAttribute, $contentObject, $publishedNodes )
    {
        eZDebug::writeDebug( 'Start', __METHOD__ );
        $paex = $contentObjectAttribute->content();
        if ( !$paex instanceof eZPaEx )
        {
            return true;
        }

        // Update empty paex data from parent paex
        // NOTE: if the current user don't have permission to edit paex data, and is
        // creating a new object (publishing version 1), force paex object update
        // to get values set in parent
        if ( !$paex->canEdit() && $contentObject->attribute( 'current_version' ) == 1 )
            $paex->updateFromParent( true );
        else
            $paex->updateFromParent();

        eZDebug::writeDebug( 'End', __METHOD__ );
        return true;
    }
184640
function publish() {
			if (!options.distBranch) {
				rbot.log.info('Skipping publishing from "' + pubSrcDir + '" to ' + pubDistDir + ' (no distBranch)');
				return;
			} else if (!commit.releaseId) {
				rbot.log.info('Skipping publishing from "' + pubSrcDir + '" to "' + pubDistDir + '" in branch "'
						+ options.distBranch + '" (no releaseId/tag)');
				return;
			}
			rbot.log.info('Publishing to branch "' + options.distBranch + '"');
			rbot.log.info('Copying publication directories/files from "' + pubSrcDir + '" to "' + pubDistDir + '"');
			// copy all directories/files over that need to be published
			// so that they are not removed by the following steps
			rbot.log.info(utils.copyRecursiveSync(pubSrcDir, pubDistDir, options.distExcludeDirRegExp,
					options.distExcludeFileRegExp).toString());
			// cmd('cp -r ' + path.join(pubSrcDir, '*') + ' ' + pubDistDir);
			chkoutRun(null, publishRun);
			function publishRun() {
				try {
					cmd('git fetch ' + options.repoName + ' ' + options.distBranch);
					pubHash = cmd('git rev-parse HEAD');
				} catch (e) {
					if (util.isRegExp(options.distBranchCreateRegExp) && options.distBranchCreateRegExp.test(e.message)) {
						cmd('git checkout -q --orphan ' + options.distBranch);
					} else {
						throw e;
					}
				}
				if (pubHash) {
					cmd('git checkout -q --track ' + options.repoName + '/' + options.distBranch);
				}
				cmd('git rm -rfq .');
				cmd('git clean -dfq .');
				rbot.log.info('Copying publication directories/files from "' + pubDistDir + '" to "' + commit.buildDir
						+ '"');
				rbot.log.info(utils.copyRecursiveSync(pubDistDir, commit.buildDir).toString());
				// cmd('cp -r ' + path.join(pubDistDir, '*') + '
				// .');

				// give taskateers a chance to update branch file
				// contents
				utils.updateFiles(options.distBranchUpdateFiles, options.distBranchUpdateFunction, commit.buildDir,
						rollCall.error);

				cmd('git add -A');
				cmd('git commit -q -m "' + tmpltData.distBranchPubMsg + '"');
				cmd('git push -f ' + options.repoName + ' ' + options.distBranch);

				rollCall.addRollback(rollbackPublish);
				rollCall.then(pack.publish);
			}
		}
279864
def visible(self):
        
        return self.status not in (PublishStatus.DRAFT.value,
                                   PublishStatus.GONE.value)
1020227
function removeContextMenus (level) {
          while (_contextMenus.length && (!level || _contextMenus.length > level)) {
            var cm = _contextMenus.pop();
            $rootScope.$broadcast(ContextMenuEvents.ContextMenuClosed, { context: _clickedElement, contextMenu: cm });
            cm.remove();
          }
          if(!level) {
            $rootScope.$broadcast(ContextMenuEvents.ContextMenuAllClosed, { context: _clickedElement });
          }
        }